Thursday, January 24, 2013

Remove line by vi in known_hosts file

When IP of servers are changed you got:

[roman@local ~]$ ssh my_server
Warning: the RSA host key for 'cheetah' differs from the key for the IP address ''
Offending key for IP in /home/roman/.ssh/known_hosts:3
Matching host key in /home/roman/.ssh/known_hosts:76
Are you sure you want to continue connecting (yes/no)?

We need to remove old server info online 3:
vi /home/rivanov/.ssh/known_hosts +3
press to remove current line"


Wednesday, January 23, 2013

Maven3 does not update repository to latest plugins

Maven update for plugins (--update-plugins) does not work in maven3. No way to get latest file
only one solution - exact version to specify, but in this case maven-metadata.xml is not updated even new plugin is downloaded and used on launch.

- "Automatic Plugin Version Resolution"
- "Plugin Metaversion Resolution"

Launch maven plugin by exact version


mvn groupID:artifactID:version:goal
mvn org.apache.maven.plugins:maven-checkstyle-plugin:2.5:checkstyle

Monday, January 21, 2013

Fedora 18 for Dell Vostro 1510

1. New Installation in fedora 18 is crap.... I broke my mind when I tried to install it on required partition - far from intuitive.

2. change power button to ask what to do (source):

In order to get the Power Shutdown selection menu in Fedora 16, you must download dconf-editor with sudo yum install dconf-editor
Once this is done, open dconf editor from gnome, and navigate to ORG/Gnome/Setting Daemon/Plugins/Power and then modify the action on power button to be "Interactive".

3. Skype and google talk plugin it is necessary to install from terminal (source):
"yum localinstall skype-"

4. Problem with microphone...
lspci | grep Audio
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)

I did restart, install of
yum install gnome-media
changed level of microphone in "Sound" application, tab "Input" and it become alive.

5. install Cromium (source):
yum install wget
cd /etc/yum.repos.d/
yum install chromium

6. Install Flash player to browsers
Follow instructions from:

7. Open terminal from Nautilus current folder:
yum install nautilus-open-terminal
No logout is required, just close all active Nautilus windows and launch it again.

8.Add rpmfusion repository, to add more packages (lha, unrar, unace archive support and more other stuff):

sudo yum localinstall --nogpgcheck

sudo nano /etc/yum.repos.d/rpmfusion-nonfree.repo
set in all rows: "gpgcheck=0"

9. Install Archive support packages (requires rpmfusion):
sudo yum install unrar p7zip p7zip-plugins lha arj unace dpkg

10. how to set up Caps Lock as language switch.
standard way to setup this in "Keyboard" or "Language and Regions" - does not work! :(
bug, workaround work perfectly well!

11. Install mp3 and other codecs for Fedora18
it will require to download gpg keys from but beware that nonfree kay is empty and will not work s so you might consider to use "gpgcheck=0" (see above).
Additional step require to put key in proper place with renaming to your architecture(i386 or x86_64):
cp RPM-GPG-KEY-rpmfusion-nonfree-fedora-18 /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-18-i386
cp RPM-GPG-KEY-rpmfusion-free-fedora-18 /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-18-i386


Oracle recompile invalid objects

SQL to select all invalid objects(that have errors or need to be just recompiled because Oracle is lazy):
   object_type ,
   status != 'VALID';
SQL to grab objects and try to recompile them to fileter out that have Errors and object that just invalidated by Oracle for any internal reason:
   'ALTER ' || object_type || ' ' ||
   owner       || '.' ||
   object_name || ' COMPILE;'
   status != 'VALID'
   and (object_type='VIEW'
   or object_type='MATERIALIZED VIEW'
   or object_type='TRIGGER'
   or object_type='FUNCTION'
   or object_type='PROCEDURE'
   or object_type='PACKAGE'

   'ALTER PUBLIC ' || object_type || ' ' ||
   object_name || ' COMPILE;'
   status != 'VALID'
   and object_type='SYNONYM'
   and owner='PUBLIC';

   'ALTER ' || object_type || ' ' || OWNER || '.' ||
   object_name || ' COMPILE;'
   status != 'VALID'
   and object_type='SYNONYM'

-- SYNONYMs could be compiled only as sysdba , so do it by "sqlplus sys/oraclexe as sysdba"

   'ALTER ' || object_type || ' ' ||
   owner       || '.' ||
   object_name || ' COMPILE;'
   status != 'VALID'
   and object_type='SYNONYM'
   and owner<>'PUBLIC';
   'ALTER PACKAGE' || ' ' ||
   owner       || '.' ||
   object_name || ' COMPILE BODY;'
   status != 'VALID'
   and object_type='PACKAGE BODY';

Sunday, January 20, 2013

How to show git branch/status information in bash

extension for terminal/command line to use git more effectively:

For Mac users, (zsh):

For bash(works fine for Ubuntu):
I do following update for /home/USER/.bash/ :
PROMPT_START="$WHITE$Time12a $Yellow$PathShort$ResetColor"

For simple branch show(works very fast), (link second comment):
Simply add following line it ~/.bashrc
PS1='[\u@\h`__git_ps1` \W]\$ '

Saturday, January 5, 2013

Gitolite - permissions examples

Attention: Gitolite version 2.
Deny permission completely(no access for clone) for user @trial user group, all other full access:

@trial  = denis

repo    my_repo
   - =   @trial
   RW+  =   @all
   config gitolite-options.deny-repo = 1

Give user Jenkins permission only for Read/Fetch/Clone, all other full access:

repo    my_repo
   R    =   jenkins
   -    =   jenkins
   RW+  =   @all

Forbid "git push --force" for 'master' branch only to avoid repository history damage, all other branches could be rewinded ('--force'):

repo    my_repo
   RW  master  = @all
   -   master  = @all
   RW+         = @all

Examples: site1, site2,

Friday, January 4, 2013

Hotkeys for terminal advanced usage

Web Source:

the most useful and less known commands:

1) Ctrl+D = Log out from the current terminal. In X, this may log you out after a shuting down the emulator.
It is very useful if you have a lot of open terminals(with ssh connection to remote server) and you want to logout from them quickly(without typing 'exit' in each on them)

2) Ctrl+R = History search (Finds the last command matching the letters you type).
Previously I used "history | grep my_command", but this looks like more elegant.

3)Ctrl+L = Clears terminal output.