Useful shortcuts for vi editor

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/

Thursday, 11 December 2014

Basic Calculator VBS example

MsgBox("Calculator!")
a=CInt(InputBox("First number:","Enter number"))
b=CInt(InputBox("Second number:","Enter number"))
c=a+b
msgbox(a & "+" & b & " = "&c)

How to run Visual Basic Script file in Windows?

Please follow the instructions:
  1. Run notepad 
  2. Copy below text into notepad
  3. Save as .vbs format
  4. Double click the file
Example VBS file:

Dim objFS, objFolder
Dim strDir
strDir = CStr(InputBox("Create a directory tool:","Input your new directory"))
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.CreateFolder(strDir)
WScript.Echo "I created the folder " & strDir & " using with this powerful tool!"
WScript.Echo "powered by ozsoyler.blogspot.com"
WScript.Quit

Wednesday, 10 December 2014

How to use secure copy in Linux Terminal?

To upload:
$ scp [desired files] [login_user]@[host]:/[remote path]
e.g.
$ scp *.txt alper@10.10.10.10:/home/alper/mynewtextfiles

To download:
$ scp [login_user]@[host]:/[remote path] [local directory] 
e.g.
scp alper@10.10.10.10:/home/alper/mynewtextfiles/* /home/alper2/mydirectory/ 

Tuesday, 9 December 2014

How to know hostname from IP in Terminal?

$ nmblookup -A <IP>
e.g. nmblookup -A 10.10.10.10

e.g. nmblookup -A $(who | awk -F\( '{ print $2}' |  rev | cut -c 2- | rev )

Monday, 8 December 2014