Saturday, November 15, 2008
Man on the moon (well almost)
India becomes the 4th Nation to put a lunar probe on the moon ! I am proud to be the 4th country to do that(as against the alleged 3rd world country banter from Matthew Hayden who knows nothing more than being a sore loser)
Sunday, October 19, 2008
pasting code in vim
:set paste
paste the code
:set nopaste
set pastetoggle=F3 in your vimrc file is an alternative.
paste the code
:set nopaste
set pastetoggle=F3 in your vimrc file is an alternative.
Friday, October 17, 2008
Renaming Files in Linux
Type the following on commandline of a bash shell and change the logic as needed.
for i in `ls /home/ssinghal` ; do mv "$i" "$i.new" ; done
Tuesday, September 30, 2008
sudo without password
1. Log in to a unix box as root
2. Execute "visudo" to open sudo editor
3. Enter the following line
ALL=(ALL) NOPASSWD: ALL
2. Execute "visudo" to open sudo editor
3. Enter the following line
Tuesday, September 23, 2008
Database Objects - Finding Dependencies
You come across tables in databases that are being populated by other pl/sql procs, triggers e.t.c what becomes difficult is to figure out which process is actually updating a table.
The following query will list objects that refer a table "TABLE_A" which belongs to a schema "SCHEMA_A"
The following query will list objects that refer a table "TABLE_A" which belongs to a schema "SCHEMA_A"
select name,owner
from dba_dependencies
where referenced_name='TABLE_A'
and referenced_owner='SCHEMA_A'
Tuesday, August 19, 2008
JQuery - Getting Started
// Makes an element visible which has the id 'mydiv'
$("#mydiv").show();
// Makes each odd tr element to have a blue backcolor
$("tr:odd").css("background-color", "blue");
// What if we want to make the header row have a different look ? Show Me
$("#results tr:first").css("background", "black");
$("#results tr:first").css("color", "white");
$("#results tr:first").css("font-weight", "bold");
// We also could have assigned a class name to the header tr element like this
$("#results tr:first").addClass("header");
//All span that are inside a div element (may not be immediate child of the div) will be selected.
$("div span").css("border", "1px solid");
//Here is how we select the links that are descendent of span which are direct children of a div
$("div > span a")
//Here is how we can select a div with id mydiv
$("div#mydiv")
// Here is how we select all links under div elements that have css class set to mycss
$("div.mycss a")
// if we want to find a link that points to http://www.google.com then we would write
$("a[href=http://www.google.com]")
// Modifications
$("body").prepend("");
$("div#mydialog").html("Hi There!
");
$("#mytable").wrap("");
// How to replace all hr elements (horizontal line) with a br element
$("
").replaceAll("hr");
Reference : http://www.shafqatahmed.com/2008/08/mybutton-font-f.html
Tuesday, July 22, 2008
tcpdump : capturing data
capture all traffic on port 80 for a specific machine
sudo tcpdump -A -s 0 -i eth0 dst or src host and port 80
Reference : http://code.google.com/support/bin/answer.py?answer=71567&topic=12022
sudo tcpdump -A -s 0 -i eth0 dst or src host
Reference : http://code.google.com/support/bin/answer.py?answer=71567&topic=12022
Subscribe to:
Posts (Atom)
");