Showing posts with label Bash. Show all posts
Showing posts with label Bash. Show all posts

Sunday, October 13, 2013

Installing and removing node.js

How to install node.js on Mac OSX?
R> go to the http://nodejs.org/ site and click install

How to uninstall node.js on Mac OSX?
R> sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}

Thursday, October 10, 2013

rsync magic

How to transfer filtered files and its entire directory structure to other unix machine, fast, compressed and efficiently? well... rsync

rsync -azvr --include-files='*.log' --include-files='*/' -exclude-files='*' --prune-empty-dirs <source dir> <target dir>

Monday, September 9, 2013

GeekTool CPU+Mem+Disk

Today I add a new geeklet to my desktop (http://projects.tynsoe.org/en/geektool/), it shows cpu+mem+disk and i needed it, because I'm tired to open Monitor application on my Mac.







I download the base version from:
http://www.macosxtips.co.uk/geeklets/modules/upload/attachments/CPUMemDskUsage.glet
And then make some adjustments to make it work with Lion and to improve performance. At the end the script look like this:

Wednesday, August 28, 2013

Convert PST to MBOX


Importing from outlook to apple mail not difficult at all, at your mac os terminal:

1) install libpst (macports required)
sudo port install libpst

2) convert the pst
readpst -o <output directory> <my pst file>.pst

3) Import
At apple mail: File > Import mailboxes > Files in mbox format

thats all

Thursday, May 3, 2012

telnet: sending a mail with smtp

How to test SMTP using telnet, just like this:

$telnet <smtpserver> 25
ehlo
mail from: <source mail>
rcpt to: <target mail>
data
<all content you want>
.
quit

Monday, April 30, 2012

How to execute ssh command and stay logged in

After using implicit authentication a new challenge came, how to exec a command and stay logged in. just like this:

ssh -t <user>@<host> "ls -l; bash -login"

Thursday, April 26, 2012

look for a class on a bunch of jars...

Challenge: how to find a class inside a lot of jars which are inside an unknown directory hierarchy.
Answer: bash scripting

find . -name "*.jar" -exec jar tvf '{}' \; -print | grep -e "<classname>.class" -e "\./"