Posts

scp data from server behind proxy / firewall / dmz

ps: I do not write often, because i am awful lazy doing it. This morning i realized  i have some data on old host (behind firewall) and is gonna be wiped by the hosting provider if not backed up soon. Blockers,  old.host  cannot talk to new.host as it is behind the proxy server .  proxy.host  is owned by  old hosting provider   i need to make  new.host talk to old.host via proxy.host . Our Imaginary server names  old server : old.host  behind a proxy server : proxy.host new host :  new.host Possible Solution:  +-----------------+ +----------------+ +--------------------+ +--------------+ | | | internet | | | | old.host | | | | | | | | | |new.host + | | | | | |2. | | data

How to add command alias in linux

Image
Alias is a common way to add user specific customization to any linux command. to view list of alias on your system, To add alias With command above we have set alias for df command, so if we run df on tty/console we will actually get the output of “df –kh” Output of df before we setup alias. Output of df after we setup alias. To remove the alias use, Note: 1. To set the alias permanently add it in ~/.bashrc which will be specific to user. 2. To set the alias permanently add it in /etc/.bashrc which will be applicable to all users on the host.

How to find execution time of any command or script

Image
To know how much time a command has elapsed from invocation to completion of execution could be useful. We may want to test a script to know how much time it takes to complete its task, before we push it on a production linux box. This can be achieved very simply on Linux. Syntax: time (command|script) In the command above we have tested how much time it takes for "who" to complete. Real is wall clock time - time from start to finish of the call. This is all elapsed time including time slices used by other processes and time the process spends blocked (for example if it is waiting for I/O to complete) User is the amount of CPU time spent in user-mode code (outside the kernel) within the process. This is only actual CPU time used in executing the process. Other processes and time the process spends blocked do not count towards this figure. Sys is the amount of CPU time spent in the kernel within the process. This means executing CPU time spent