Useful shortcuts for vi editor

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

Alexa Rank

Global rank: 6,859,462

How to know system hardware and software information?

to get os version:
cat /etc/*release*

to get os kernel version:
cat /proc/version

to get cpu info:
# cat /proc/cpuinfo
or
# lscpu

to get ram info:
# cat /proc/meminfo

Wednesday 3 December 2014

How to find full path of a program in Windows?

CMD> where ping
C:\Windows\System32\PING.EXE
CMD> where sqlplus
D:\instantclient_11_2\sqlplus.exe

Tuesday 2 December 2014

What are taskmgr.exe keyboard shortcuts?

1st way: CTRL + ALT + DEL
2nd way: CTRL + SHIFT + ESC