SolveItproblems

SolveITProblems is a project of QFormat.net intellectual club

SolveITProblems это проект интеллектуального клуба QFormat.net

вторник, 15 мая 2012 г.

Externalize Grails DataSource

Hi! Are you tired from changing connection properties and rebuild your application in grails? So take the solution:
Add to your Config.groovy

grails.config.locations = [ "classpath:myown.properties"]


Create file myown.properties and write the following:

dataSource.driverClassName=com.mysql.jdbc.Driver
dataSource.url=jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=utf8
dataSource.username=root
dataSource.password=


You can add anything else too :)
So now you can make changes at your datasource and just restart your application...

среда, 25 апреля 2012 г.

Creating new a user (schema) on Oracle Database

Imagine you have sysadm access to the Oracle database and you need to create a new user with his own schema. You need to run just 2 queries:


CREATE USER username IDENTIFIED BY username //Create user "username" with password "username"
GRANT ALL PRIVILEGES to username // grant all privileged, so now you can connect and create your databases

Enjoy :)

четверг, 19 апреля 2012 г.

Шпаргалка по комагдам UNIX SHELL


ls – список файлов и каталогов
ls -al – форматированный список со скрытыми каталогами и файлами
cd dir – сменить директорию на dir
cd – сменить на домашний каталог
pwd – показать текущий каталог
mkdir dir – создать каталог dir
rm file – удалить file
rm -r dir – удалить каталог dir
rm -f file – удалить форсированно file
rm -rf dir – удалить форсированно каталог dir
cp file1 file2 – скопировать file1 в file2
cp -r dir1 dir2 – скопировать dir1 в dir2; создаст каталог dir2, если он не существует
mv file1 file2 – переименовать или переместить file1 в file2. если file2 существующий каталог - переместить file1 в каталог file2
ln -s file link – создать символическую ссылку link к файлу file
touch file – создать file
cat > file – направить стандартный ввод в file
more file – вывести содержимое file
head file – вывести первые 10 строк file
tail file – вывести последние 10 строк file
tail -f file – вывести содержимое file по мере роста, начинает с последних 10 строк
———————————————————————————————————————————————————————————


Настройка PORT Security в свитчах Cisco

Команды для того чтобы сконфигурировать порт безопасности через SecureCRT или Putty c SSH Enabled.
conf t
interface fa0/NN (номер порта)
switchport port-security
switchport port-security maximum 1
switchport port-security mac-address sticky
switchport port-security violation restrict
no shut
exit
exit
quit
Команда для просмотра состояние
show port-security
Если SecurityViolation (Count) отличаетсья от 0 -я , значит есть нарушение. Если преднамеренное нарушение (смена компьютера и т.д.) то нужно сбросить политики безопасности. Для этого также заходим на SWITCH там также заходим на порт , а именно

conf t

interface fa0/NN (номер порта)

а потом добавляем слово NO, как указано ниже

no switchport port-security

no switchport port-security maximum 1

no switchport port-security mac-address sticky
no switchport port-security violation restrict
shut
no shut
Затем по новой прописываем политику на данный порт. Для полной безопасности можно тупо прописать МАК адрес в настройку, чтобы он принимал не первый мак адрес а именно тот который мы прописали. Дял этого нужно получить мак адрес порта (sh interface fa0/NN), затем прописать его в данном порядке
no switchport port-security mac-adress sticky
Затем
switchport port-security mac-adress 0024.13ab.c0a7 - Где Мак Адресс, адресс порта.

понедельник, 13 февраля 2012 г.

Grails - Oracle Sequence problem (ORA-02289: sequence does not exist)

Hi, my program works well on local mysql but in test oracle server i faced an interesting problem.
 my laptop -ORA-02289: sequence does not exist
me -what do you want from me, it work in mysql?
my laptop -do something with sequences hibernate from grails dont create it for autoincrement fields
me -ok...

 And after that i've added one line of code into my domain classes and  go on my happy coding and testing :)
  static mapping = { 
 id generator:'sequence', params:[sequence:'ANY_WORD'] 
 }