Useful shortcuts for vi editor

Tuesday, 17 February 2015

How to define virtual drive on the system?

Only you need to run these commands in cmd.

e.g. subst v: "\\10.10.10.10\MyRemoteDirectory"

e.g. subst x: "D:\MyBackupDirectory"

to delete it;
subst v: /d

Friday, 13 February 2015

How to install/uninstall/search installed rpm package in Linux?

install rpm package:
e.g.
# rpm -Uvh jdk-1.6.0_35-fcs.i586.rpm
or
# rpm -ivh jdk-1.6.0_35-fcs.i586.rpm
(-U, upgrade -i, install –v, verbose –h gist of verbose)

uninstall rpm package:
e.g.
# rpm -ev jdk-1.6.0_35-fcs.i586.rpm

search installed rpm packages:
e.g.
$ rpm -qa | grep jdk

list the dependency of rpm packages:
# rpm -qRp jdk-1.6.0_35-fcs.i586.rpm
(-q, query -R, List package depends)

verify installed rpm package:
e.g.
# rpm -Vp jdk-1.6.0_35-fcs.i586.rpm
(-V, verify -p package name)

check state of files inside of rpm package:
e.g.
# rpm - qsp jdk-1.6.0_35-fcs.i586.rpm
(-s, state (installed, replaced or normal)

verify all installed rpm packages:
# rpm -Va
(-a, all)

How to install source package in linux?

Please follow the instructions:

e.g. sysstat-9.0.6.tar.gz installation;

Firstly, transfer the sysstat source package into your linux. 

Run these commands one by one;
-> tar -czvf sysstat-9.0.6.tar.gz
-> cd sysstat-9.0.6 then execute ./configure
-> make
-> make install

Usage of sar;
# sar 1 1000

Wednesday, 11 February 2015

How to find IP from url or domain address in windows?

e.g. tracert www.google.com

Tracing route to www.google.com [173.194.127.81]

Monday, 9 February 2015

How to run a program in start-up?

Please follow the instructions to define start-up program for Windows machines.

Press Windows key -> Click "All Programs" -> Right mouse click on "Startup" folder then click "Open" -> Define shortcut of the program in "Startup" folder -> Now, windows starts program as your shortcuts while starting system.

Thursday, 5 February 2015

What is "hiberfil.sys" file?

hiberfil.sys file is using when system goes to hibernate mode that all your session information are stored in this file. After system goes up, system uses this file to restore your last session.

To modify size of it;
powercfg -h -size 70
(it means hiberfil.sys file size will be the half of system RAM size)
(also, percentage should be at least %50 in here)

To disable it;
powercfg -h off

If you disable itpagefile.sys file size is same with system RAM size probably.

Reference: http://ozsoyler.blogspot.com.tr/2015/02/how-to-change-windows-swap-size.html

How to change windows swap size?

Windows uses pagefile.sys file as swap memory that you can easily manage it as you wish.

To do that, please follow the instructions;

Press Windows key -> Right click to "My Computer" -> Click to "Advanced system settings" -> Click to "Advanced" tab -> Click to "Settings" from "Performance" -> Click "Advanced" tab from "Performance Options" window -> Then, click to "Change" button -> Unselect to "Automatically manage paging file size for all drives" -> Lastly, select "Custom size" then modify "initial size" and "maximum size" according to related disk volume then click "OK"

Recommended: If you have too much RAM memory in your system (such as 32 GB RAM), you can disable pagefile.sys to accelerate your system. 

Tuesday, 3 February 2015

How to adjust hibernate option instead of using sleep option in advanced power options?

Please follow the instructions to adjust the hibernation.

Press Windows key and search "power options" -> Click to "Change plan settings" -> Then, click to "Change advanced power settings" -> Go to "Sleep" -> Then, "Sleep after" and change setting to "Never" -> Lastly, go to "Hibernate after" -> For example, change settings to "15 minutes" -> Anymore, if windows runs 15 minutes in standby, the system goes to "hibernation".

You may also run below commands in "cmd" to adjust your power settings according to power-saving approach.
powercfg -h on
powercfg -change standby-timeout-ac 0
powercfg -change monitor-timeout-ac 5
powercfg -change hibernate-timeout-ac 15

How to activate hibernate option in start menu?

Please follow the instructions to activate hibernate option for Windows machines.

Press Windows key and search "cmd" -> Right mouse click on "cmd" then select "Run as administrator" -> Run "powercfg -hibernate on" -> Press Windows key and search "power options" -> Click to "Change plan settings" -> Then, click to "Change advanced power settings" -> Go to "Sleep" and "Allow hybrid sleep" -> Change Settings to "Off" -> Now, you can see "Hibernate" option in start menu.

Monday, 2 February 2015

How to know the current connected user in sqlplus?

SQL> SHOW USER;

USER is "ALPER"

How to modify "sql page size"?

SQL> SET PAGESIZE 100

Anymore, there will be 100 lines for each page, after executes SQL queries.

Wednesday, 28 January 2015

How to recall an email in Microsoft Office Outlook?

To do that please follows the instructions;

Double click the email from "Sent Items" -> Click "Other Actions" -> Click "Recall This Message" -> Select desired options like "Delete unread copies of this message" -> Click "OK" -> Wait a while to see the result email from the mail server

* If one of recipients read this email, you cannot recall it. Therefore, you should receive the fail info message from the mail server after recall request.

That's all

How to run a command when starts up SUSE linux system?

Please add below row into "/etc/init.d/boot.local" file as root system user.

# su - alper -c "/home/alper/bin/startup.sh"

Monday, 26 January 2015

What is SUID and GUID?

SUID (Set User ID on execution) and GUID (Group User ID on execution) that uses to give execution permission for running as owner of file.

example of activated suid 
passwd command;
ls -l /usr/bin/passwd
-rwsr-xr-x

example of activated guid 
wall command;
ls -l /usr/bin/wall
-r-xr-sr-x

info: "s" means that the file is activated for suid or guid.

to activate suid;
chmod u+s myfile.txt

to deactivate suid;
chmod u-s myfile.txt

to activate guid;
chmod g+s myfile.txt

to deactivate guid;
chmod g-s myfile.txt

You may also want to read this entry; http://ozsoyler.blogspot.com/2014/11/what-is-sticky-bit.html

Wednesday, 21 January 2015

How to list symbolic links in the current directory?

define a link;
ln -s myfolder/myfile.txt myshortcut

to see it in the list;
$ find . -type l -ls

result;
Jan 21 09:03 ./myshortcut-> myfolder/myfile.txt

to see inside of file via shortcut;
$ cat myshortcut
hello

Thursday, 8 January 2015

How to define logic volume for oracle server?

1st step: Define physical volume (pv)
# pvcreate -f /dev/sda4

to check it;

# pvdisplay

2nd step: Define volume group (vg)

# vgcreate -s 16 /dev/my_vg_ora /dev/sda4
s; 
-s 16 (--physicalextentsize; 16 mb physical extent size)

to activate it;

# vgchange -a y /dev/my_vg_ora

to check it;

# vgdisplay

3rd step: Define logic volume (lv)

lvcreate -L 1024 -n example01 /dev/my_vg_ora

to check it;
# lvdisplay

4th step: Assign data file to tablespace

to do this step please refer to this entry

to check it;
# select * from dba_data_files;

Thursday, 1 January 2015

Oracle Highlights

Administrator
Architecture
Database Versions

Monday, 29 December 2014

How to change ssh welcome message?

Execute below operations as root user.

1. vi /etc/ssh/sshd_config
# comment out Banner row
# no default banner path
Banner /etc/ssh/ssh-banner-message.txt

2. vi /etc/ssh/ssh-banner-message.txt
# add a new message to text file

3. service sshd restart
# restart ssh service to see banner message

Thursday, 18 December 2014

How to use to_date function?

e.g.
select to_date('2014-12-18','yyyy-mm-dd') from dual;
output: 12/18/2014

select to_date('2014-12-18 12:15','yyyy-mm-dd hh:mi') from dual;
output: 12/18/2014 12:15:00 PM

select to_date('2014-12-18 13:15:55','yyyy-mm-dd hh24:mi:ss') from dual;
output: 12/18/2014 1:15:55 PM

select to_date('2014-12-18','yyyy-mm-dd') - 7 from dual;
output: 12/11/2014

select to_char(to_date('2014-12-18','yyyy-mm-dd') + 30,'DAY') from dual;
output: SATURDAY

select to_char(to_date('2014-12-18','yyyy-mm-dd') + 365,'MONTH') from dual;
output: DECEMBER

Friday, 12 December 2014

[ADVICE] PowerMenu to use "Always On Top"

You may use PowerMenu tool for using "Always On Top" on the window.

Download: http://www.abstractpath.com/powermenu/