22 Feb

Customizing Bespin

in

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} :

15 Feb

Bespin the next generation Web code editor

in

"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

13 Feb

NS2 on Ubuntu 9.10

in

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.  
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

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).
30 Jan

AMD ATI Catalyst™ 10.1 Display Driver for GNU/Linux

in

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.

30 Jan

Ground Control on Karmic

in

Ground control collaboration of launchpad and bazaar branches for easier development for the everyday user!

How to install ground control on karmic?!

From PPA :
$ sudo add-apt-repository ppa:doctormo/groundcontrol
$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get install groundcontrol

From source:
$ bzr branch lp:groundcontrol ; cd groundcontrol ; sudo python setup.py install

Set up a Projects directory
$ mkdir ~/Projects

Navigate to : Places -> Home Folder -> Projects folder

26 Jan

Django on Ubuntu

in

Django | The Web framework for perfectionists with deadlines

Settings it up:
sudo apt-get install django

Check out the options of the command django-admin

Start s project
hemanth@ubuntu:~/django$ django-admin startproject mysite
hemanth@ubuntu:~/django$ cd mysite
hemanth@ubuntu:~/django$ ls
__init__.py manage.py settings.py urls.py
This is the basis of the application

manage.py => application we use to RUN certain commands.

23 Jan

My Google wave ideas

My 55 ideas for Google Wave :{Some are on it's way} :
Go and vote here : You liked any?

1."Alloww grouping in contacts list like Friends,Co-workers,Bots so on. So when i click on Friends all of them in that group must be added to a single wave, so we need not add each of them."

2."Block/Ban/Kick users, sometimes spammers or sometimes from contact list itself!"

3."Ability to drag and drop media from hard-disk to wave"