tips

You are currently browsing articles tagged tips.

If you want to download files from machine A to machine B and have python installed on machine A, here is a very simple way to do it:

On machine A, open a command window and change directory to where the files are and run this command:

python -m SimpleHTTPServer

This command starts a web server serving files from that directory.

On machine B, just open a browser and type the ip address of machine A and port 8000 and you can see all the files. When the transfer is done, simply press control-C in the command window. A simple way to temporarily share your files across the network!

Tags: ,

Or, How do i get a crypted password for .screenrc ?

Here is a quick tip, hopefully it helps someone, I struggled with this for some time…

I have been using GNU screen program since a long time. This program is like a window manager for terminals and is especially useful for ISP and home shell accounts. You can have multiple shells running under the same session and can easily detach the sessions and reattach them from a different computer later etc.

I usually password protect my sessions by using the password command (ctrl A :password). But I had a hard time figuring out how to set that password in .screenrc file. The file obviously does not store it in plaintext and uses a crypted version of password. To get the crypted password, simply set your password in the screen session (ctrl A :password and then enter the password twice), then the crypted version gets automatically saved to screen’s copy buffer! All you need to do is have a line in your .screenrc which looks like this
password DTWxS2voQWkgI

After this all your new screen sessions will be automatically password protected (meaning you will need the password to reattach a session.)

Tags: , , , ,

Some excel functions

I keep forgetting some of the functions in excel and it is embarrassing to search for the same things every time.

PERMUT(n, r) = nPr = n! / (n – r)!
COMBIN(n, r) = nCr = n!/((n-r)!r!)
FACT(n) = n! = 1*2*3*…*n
BINOMDIST(s, n, p, cumul) Probability that there will be exactly s successes in n trials, each trial having a success probability of p (cumul = FALSE). If cumul is true it returns the probability that there will be at most s successes in n trials.

Tags: , , ,