Linux ssh-keygen and openssl commands

ssh-keygen This command will create a pair of private and public keys. It will ask for the location of the key and whether to use passphrase. [oren@localhost ~]$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/oren/.ssh/id_rsa): /home/oren/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter … Continue reading Linux ssh-keygen and openssl commands

Allowing process to bind to port lower than 1024 in Linux

In Linux by default process  has no permission to bind themselves to any port lower than 1024 (unless you are the root user of course). So if for example we want our node js application to listen on port 80, the default port for http, we will probably get the following exception: events.js:160 throw er; … Continue reading Allowing process to bind to port lower than 1024 in Linux

Javascript visibilty api

HTML 5 spec include nice api that allow us to know from the javascript if the page is visible to the user or not. we can also listen to event that is fired every time the visibility state change. The java script event for change in visibility is visibilitychange so we can listen to this event, and when … Continue reading Javascript visibilty api

Linux cp command

cp command is used to copy files and folders. The structure is the following: cp <options> <source1> <source2> <source3>... <destination> This are some of the most useful option: -R recursive, will copy also internal directories and their contents. Without this option, cp by default will skip on internal directories. -a  archiving, when copy files and directories, … Continue reading Linux cp command

Linux sed (stream editor) – part 2

Continuing from  part 1 of Linux Sed. If we want to run more than one sed's command on the text, we can use semicolons ';' or the -e . the structure is the following: sed -e '' -e '' Alternatively and more elegant is the semicolons  separator: sed '<command1>;<command2>;'  <fileName> Now let continue with the sed commands' list: … Continue reading Linux sed (stream editor) – part 2