bash

22 Jun

Sendmails via sendmail with attachments

in

After Send mail via python it was time to try real `sendmail`.

[ From the FAQ pages of sendmail ]
How do I create attachments with sendmail?
You don't. Sendmail is a mail transfer agent (MTA). Creating e-mail messages, including adding attachments or signatures, is the function of a mail user agent (MUA). Some popular MUAs include mutt, elm, exmh, Netscape, Eudora and Pine. Some specialized packages (metamail, some Perl modules, etc.) can also be used to create messages with attachments.

22 Jun

Getme video

in

Simple recipe to get youtube video in avi or ogg format from your terminal.

Ingredients:
youtube-dl, ffmpeg, ffmpeg2theora
sudo apt-get install youtube-dl ffmpeg ffmpeg2theora

20 Jun

Random images from xkcd as wallpaper

in

After howto use real-time earth wallpaper i tired to make some random xkcd images as my wallpaper.
The below is a simple script which one can use to get random images from xkcd as desktop wallpapers at a time interval of 3600 seconds

Steps:
1. mkdir -p ~/.xckd
2. Place the code in this dir, call it xkcds.bash.
3. Setup a cron job or put the code in rc, as :
0 * * * * ~/.xkcd/xkcds.bash
[or]

12 Mar

Script to install Oracle

in

Simple hack to install oracle on Ubuntu

#!/bin/bash
sudo sh -c 'echo "deb http://oss.oracle.com/debian unstable main non-free" >> /etc/apt/sources.list'
wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install oracle-xe
sudo /etc/init.d/oracle-xe configure
cat >> $HOME/.bashrc << 'EOF'
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME
export ORACLE_SID=XE
EOF

To test if its working fine

CLI twitpic

  1. #!/bin/bash
  2. #==================================================================
  3. #
  4. # FILE: cli-twitpic.bash
  5. #
  6. # USAGE: ./cli-twitpic.bash
  7. #
  8. # DESCRIPTION: Allows you to upload pic from cli to twitpic and # also update the same as you status in twitter
  9. #
  10. # OPTIONS: ---
  11. # REQUIREMENTS: ---
  12. # BUGS: ---
  13. # NOTES: ---
  14. # AUTHOR: Hemanth H.M (), hemanth.hm@gmail.com
  15. # VERSION: 1.0
  16. # CREATED: 03/06/2010 01:45:02 AM IST
  17. # REVISION: ---
  18. #=======================================================

Insert into mysql DB from text files

  1. #!/bin/bash
  2. #==================================================================
  3. #
  4. # FILE: insertDb.sh
  5. #
  6. # USAGE: ./insert.sh
  7. #
  8. # DESCRIPTION: Illustration of inserted data from text to DB
  9. #
  10. # OPTIONS: ---
  11. # REQUIREMENTS: ---
  12. # BUGS: ---
  13. # NOTES: ---
  14. # AUTHOR: Hemanth H.M (), hemanth.hm@gmail.com
  15. # VERSION: 1.0
  16. # CREATED: 03/06/2010 12:30:36 AM IST
  17. # REVISION: ---
  18. #=================================================================#
  19. #Example scenario assume a list with words and meanings with spac
10 Feb

RSS feed as wallpaper

in

Pre-Req
convert utility :sudo apt-get install imagemagick
curl utility :sudo apt-get install curl
Any wallpaper : it's called rss.jpg here

The idea is pretty native :
Step 1 : Get the rss feed URL
Step 2 : Scrap for the data
Step 3 : Set the data as wallpaper

Code template