Thursday, August 30, 2012

Linux command 'Less' short list of commands

Linux command 'Less' short commands:
source, source2.

h - show help

f - scroll page forward
b - scroll page backward
g or "<" - go to begin of the file
G or ">" - go to end of the file

/PATERN - search
n - search for next appearance
N - search for previous appearance


tail mode:

Press Shift-F. This will take you to the end of the file, and continuously display new contents. In other words, it behaves just like tail -f.
To start less in the tail mode, execute:
$ less +F /var/log/messages
To scroll backwards, you must first exit the follow mode by pressing Control-c.

reload latest lines from file, one time 'tail mode':
Shift+G - got to the end of file
Shift + ">" - load till the end of file, press few times if you expect changes to file.

Friday, August 3, 2012

Quick Notes application for Ubuntu 12.04 with Unity support


I used gnote for a while - it is good but it lacks a Unity support in Ubuntu 12.04 that is inconvenience.
Googling over internet  .... point to interesting application ZIM (http://zim-wiki.org/)

Just install "sudo apt-get install zim",
launch it and Menu Edit -> Preferences ... tab "Plugin" , enable  plugin "Tray Icon".

video tutorial

Beware of bug that make it slow to open: https://bugs.launchpad.net/zim/+bug/995919
You need to install latest version from ppa:
sudo add-apt-repository ppa:jaap.karssenberg/zim
sudo apt-get update
sudo apt-get install zim

To launch Zim notes on Ubuntu start-up, in tray, create shell script zim-in-tray.
echo -e '#!/usr/bin/bash\nzim --plugin trayicon' > zim-in-tray
chmod ugo+rx zim-in-tray

Open "Startup Applications" from Dash, create new launch configuration and point to zim-in-tray.

Sunday, July 29, 2012

Oracle user become locked


http://oramrmessin.blogspot.com/2007/11/oracle-audit-failed-logon-attempts.html


SELECT 
os_username,
username,
userhost,
to_char(timestamp,'mm/dd/yyyy hh24:mi:ss') timestamp,
returncode
from dba_audit_session
where action_name = 'LOGON'
AND RETURNCODE > 0
AND TIMESTAMP > SYSDATE-1
and username = 'USER1'
order by timestamp ;


-- under system
ALTER USER USER1 ACCOUNT UNLOCK;




SQL to define who locked object:

SELECT c.owner, c.object_name, c.object_type, b.SID, b.serial#, b.status,
       b.osuser, b.machine, b.sql_id
  FROM v$locked_object a, v$session b, all_objects c
 WHERE b.SID = a.session_id AND a.object_id = c.object_id
;

SQL to define what SQL is performed during lock: 
 select * from sys.v_$sqlarea where sql_id = '<GET IT FROM PREVIOUS SQL>';

Saturday, July 28, 2012

ubuntu 12.04 items to install

0. Show images in menu items (Eclipse, Nautilus, ....).

gsettings set org.gnome.desktop.interface menus-have-icons true


1. Clipboard manager for working with a lot of text changes and storing https://apps.ubuntu.com/cat/applications/clipit/  have full integration with Unity.

2. Sistem Monitor, link


    sudo add-apt-repository ppa:indicator-multiload/stable-daily
    sudo apt-get update && sudo apt-get install indicator-multiload


3. Coffeine, link
 It will help to not let Laptop to lock screen when you watch movie.
lightsOn.sh - did not work for me.

4. Menu editor:

sudo apt-get install alacarte

Launch application "Main Menu", add them to Programming group, Do not forget to make "eclipse" file as executable.

5. dconf-editor
 desktop > unity > panel , update systray-whitelist with your application.

6. Audacious player (with Winamp view + Skins)
http://www.webupd8.org/2012/08/install-audacious-33-in-ubuntu-1204.html
http://ubuntugeneration.wordpress.com/2009/06/30/audacious-player-with-winamp-skin/ 
or http://www.winamp.com/skin/winampmp11/149846
and then "sudo cp WinampMP11.wsz /usr/share/audacious/Skins"


7. Notes for Ubuntu 12.04  (Unity friendly)
http://askubuntu.com/questions/75180/alternative-to-gnote-when-using-unity
http://zim-wiki.org/
Just install "zim", launch and Menu Edit -> Preferences ... tab "Plugin" , enable  plugin "Tray Icon".

video tutorial - http://www.youtube.com/watch?v=yBZpWgzO9Ps

8. Switch On Application list in "Stratup Applications"
http://www.iloveubuntu.net/how-enable-all-apps-startup-applications-ubuntu-1110


9. Resolving problem with window activation of LibreOffice.
sudo apt-get install lo-menubar
link

10. turn off startup sound.
Never understand why this  feature still required. To switch it off, read.


11. set up different timezones to always know their time (good if your friends live in different countries):
http://www.omgubuntu.co.uk/2012/10/how-to-add-other-timezones-to-ubuntus-clock-applet

12. For 2 monitors: Move window to a specific display using a keyboard shortcut
http://www.webupd8.org/2012/10/ubuntu-multi-monitor-tweaks-full-screen.html
To make shortcut work I did logout and login.


....


Sunday, July 15, 2012

How to remove "Trash" and "Workspace Switcher" from unity panel in Ubuntu 12.04

Noway - It is hardcoded :)

Please vote for https://bugs.launchpad.net/unity/+bug/997322
and
https://bugs.launchpad.net/ayatana-design/+bug/790591

workaround with recompilation of sources:
http://askubuntu.com/questions/38789/remove-the-workspace-switcher-launcher-from-unity-launcher/163952#163952

Saturday, May 26, 2012

Hot keys for ubuntu dash that helps a lot

Unity has more then just pretty view panel, mouse more and more become useless stuff for day to day rutines:
http://askubuntu.com/questions/28086/what-are-unitys-keyboard-and-mouse-shortcuts

My hints:
This helps me to shutdown Laptop without mouse usage -  press Alt , type "shutdown".
switching to application by index - Supper + <NUMBER>.
long-press the Super key - shows hints for hotkeys,

Friday, May 25, 2012

tomcat 7 books

I will read "Apache Tomcat 7 User Guide" from
http://findpdfbooks.com/search.php?search=tomcat+7

online version: http://tomcat.apache.org/tomcat-7.0-doc/