Install SSL Certificate Tomcat bash script

  1. :

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

Customizing Bespin

Customizing Bespin with syntax and code highlighting
Read the intro to bespin before you continue
Prereq:
Python 2.5 with simplejson or Python 2.6

Peek into dryice.py :

#!/usr/bin/env python
# Simple script to run dryice conveniently in the Customizable package
import sys
import os
mydir = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(mydir, "lib"))
from dryice import tool
tool.main()

Sample json {manifest} :

Bespin the next generation Web code editor

"Bespin is a Mozilla Labs experiment on how to build an extensible Web code editor using HTML 5 technology."

I have tired an experimental embed of Bespin here
Do read more

NS2 on Ubuntu 9.10

To install The Network Simulator - ns-2 we need to bit of circus.

Install dependencies :
$ sudo apt-get install libpcap-dev gcc-4.3 g++-4.3 tcl tk tk8.4-dev tcl8.4-dev xorg-dev sgb

By default gcc version is 4.4, but has ns2 compiles well only will 4.3 we need to downgrade gcc !

Backup the current links and update symbolic links :

$ sudo mv gcc gcc.old
$ sudo mv i486-linux-gnu-gcc i486-linux-gnu-gcc.old
$ sudo ln -s gcc-4.3 gcc
$ sudo ln -s gcc-4.3 i486-linux-gnu-gcc

Download and Install ns2:

Generate index.html for a given directory

  1. #!/bin/bash
  2. #Author : Hemanth.HM
  3. #Email : hemanth.hm@gmail.com
  4. #Purpose : To genrate index.html for a give directory.
  5. #Usage : bash index.sh <dir>
  6.  
  7. dir=$1
  8. cwd=`pwd`
  9.  
  10. #Check for input
  11. [ -z ${dir} ] && echo "Usage : `basename $0` <dir>" && exit 1 || cd ${dir}
  12.  
  13. # In case the user gives the input as "."
  14. [ "${dir}" == "." ] && dir=`pwd`
  15.  
  16.  
  17. # Collect each file and add them to href's
  18. INDEX=`ls -1 ${dir} | sed "s/^.*/ <li\>\<a\ href=\"&\"\>&\<\\/a\>\<\\/li\>/
  19.  
  20. # Create an index.html file
  21. cat > index.html << EOI
  22. <html>
  23. <head>
  24. <style type="text/css">
  25.  

RSS feed as wallpaper

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

Log file viewer in PHP

  1. <?php
  2. // Author : Hemanth.HM
  3. // Purpose : To view log file on the browser.
  4.  
  5. function tail($file, $num_to_get=10)
  6. {
  7. $fp = fopen($file, 'r');
  8. $position = filesize($file);
  9. fseek($fp, $position-1);
  10. $chunklen = 4096;
  11. while($position >= 0)
  12. {
  13. $position = $position - $chunklen;
  14. if ($position < 0) { $chunklen = abs($position); $position=0;}
  15. fseek($fp, $position);
  16. $data = fread($fp, $chunklen).

AMD ATI Catalyst™ 10.1 Display Driver for GNU/Linux

Dependencies :

XOrg 6.8, 6.9, 7.0, 7.1, 7.2, 7.3 or 7.4
Linux kernel 2.6 or above
glibc version 2.2 or 2.3
POSIX Shared Memory (/dev/shm) support is required for 3D applications

P.S : uninstall the ATI Proprietary Linux Driver before installing a newer version, if installed.

$ cd /usr/share/ati ; sh ./fglrx-uninstall.sh ; sudo reboot

CAUTION : ATI has contributed packaging scripts to allow creation of other packages, but does not necessarily test, verify or warrant the reliability.

Drupal SEO