Archives for category: linux
Did you ever feel the desire to show some commands in Unix or Linux to colleagues? Just to demonstrate things? Or, did you ever felt the desire just to show off 
:-)

You can use websites like http://www.screencast-o-matic.com/ or other screencapture software. Maybe the use ffmpeg in Ubuntu/Debian helps you out (p.e: ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg) But it creates video’s which must be uploaded and may become large. A lot of work and it takes a lot of time to create.


http://www.playterm.org/ Could help you out even more. A nice website where you can upload your cool terminal adventures. Type in ttyrec in your terminal, then perform some cool skills in your terminal and to complete this, just type exit. Upload the tty file on http://www.playterm.org/?upload=now and wait to get in the wall of fame on playterm!


ttyrec can be installed in Ubuntu by using apt-get.


However, there is also a nice alternative, which also works great: shelr. 


See http://shelr.tv . Full explanation here: http://shelr.tv/about


Happy shelling! ;-)
Are you one of the happy few to own a machine with too much RAM and have Ubuntu/Debian installed? Then you might consider use some of that memory to use it to change it to RAM drive. Sometimes it might be useful to decompress files or other file-operations wich can be time consuming on slower disks.

Here's what to do:

sudo -s
create a dir called /tmp/ramdisk
mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk

mount -t tmpfs -o size=4096M tmpfs /tmp/ramdisk/


Happy RAMDisking! :-)
 
 
Sometimes when you issue a ping to a certain host and you do not get a reply, you think the host is offline, but it is actually being blocked by a firewalll. 
What you can do is issue a ping and right after that run the arp -a command:

:/# ping <ip adress host> PING 192.168.212.103: (192.168.212.103): 56 data bytes  ^C (abort with CTRL - C)  
:/# arp -a | grep <ip adress host>  <hostname> (<ip adress host>) at (incomplete)  

So, if you do not get a MAC address, the machine is really offline

Sometimes you like run a continious ping to a specific host and do not want to keep staring at the result of the ping command. An audible notification would be nice.

Guess what, there is a command to solve this one.

while true; do ping -c1 <hostname> | grep '1 received' && espeak -vnl '<hostname> ping'; done
A short one this time :-)

An easy and fast way to update your Ubuntu Desktop (or server ofcourse) is by creating a script with just one line:
apt-get update && apt-get upgrade && apt-get autoremove && apt-get autoclean
Good luck.
Usually at the work office I'm very busy. But I take some time to browse on the internet on some of my favorourite sites. But many of the site I wish to visit are blocked, because they are categorised as “exploit or hacking related”... As I mentioned before, you can make use of a tunnel to your home network and you can browse freely. There is however another way. What if I get a PDF of the website I like to visit. I've built a tiny, and simple script: 

wget http://pdfmyurl.com?url=http://www.tweakers.net 
mv index.* tweakers.pdf 
mutt -s "EzineMailer" blah@blah.com < ~/scripts/tweakersmailer/body.txt -a tweakers.pdf 
rm *.pdf 



The mutt command can be used to send a mail from your commandline.
If you do not have mutt installed on your linux system: sudo apt-get install mutt
Now lets try sending a test mail: # echo testing | mail -s Bla myemail@somewhere.com 
and take a look at /var/log/exim4/mainlog. You should be good to go! If not run dpkg-reconfigure exim4-config and configure a smart host. Smart host for use of another SMTP server. Send attachment? Use mutt (apt-get install mutt) mutt -s "Testing" blahblah@test.com < body.txt -a myfile.txt (-a attachment) 

I am using a internal smart host. You can use an external smart host too. I forgot to mention, that I am using an Ubuntu server for this purpose. :-)
And finally, you can cron this script and you will get an automatically generated pdf in your mailbox. This site could help you with editting the crontab: http://cron.nmonitoring.com/cron-generator.html 
Just a quicky this time :-)

Are you Ubuntu user and ever wanted to ping to a MAC address? Well.. I did :-)

Here's how.

First of all, get the arp-scan package:
 sudo apt-get install arp-scan

Then issue the following command:

ping -c 2 `arp-scan <ipaddress>/<number of network bits> | awk '/<mac address>/ {print $1}'` 

For Example:

ping -c 2 `arp-scan 10.146.0.0/17 | awk '/00:1f:29:44:ad:a4/ {print $1}'`