Showing posts with label Hacks. Show all posts
Showing posts with label Hacks. Show all posts

Wednesday, September 19, 2007

Tiddlywiki

http://www.tiddlywiki.com/

To set up:

wget http://www.tiddlywiki.com/empty.html
firefox file:///`pwd`/empty.html

Done.
<snip>
The easiest way to learn about TiddlyWiki is to use it! Try clicking
on various links and see what happens - you cannot damage
tiddlywiki.com or your browser.
</snip>

Tuesday, May 30, 2006

How To Speed Up Firefox [Howto]

Here's something for broadband people that will really speed Firefox up:

1.Type "about:config" into the address bar and hit return. Scroll down and
look for the following entries:

network.http.pipelining network.http.proxy.pipelining
network.http.pipelining.maxrequests

Normally the browser will make one request to a web page at a time. When you
enable pipelining it will make several at once, which really speeds up page
loading.

2. Alter the entries as follows:

Set "network.http.pipelining" to "true"

Set "network.http.proxy.pipelining" to "true"

Set "network.http.pipelining.maxrequests" to some number like 30. This means
it will make 30 requests at once.

3. Lastly right-click anywhere and select New-> Integer. Name it
"nglayout.initialpaint.delay" and set its value to "0". This value is the
amount of time the browser waits before it acts on information it recieves.

If you're using a broadband connection you'll load pages MUCH faster now!

Vaibhav.

How to Export sound in Linux [Howto]

Exporting sound :-

Run 'artsd -n -u -p 5001' on system on which u want to hear sound.
Run 'export ARTS_SERVER=ip_of_system_on_which_sound_it_to_be_heard:5001'
on system where sound application will be run (like mplayer)
Run 'mplayer -ao arts soundfile.mp3'

Monday, May 29, 2006

How to set up ssh keys for Linux

How to set up ssh keys for Linux

1. Run "ssh-keygen -t dsa" on the machine which is the client.
Files Generated :
$(HOME)/.ssh/id_dsa : Your private Key
$(HOME)/.ssh/id_dsa.pub : Your public Key
You can enter empty passphrase.
Type can rsa and dsa for version 2 and rsa1 for version 1.
2. Now ssh into the server.You need to type password this time.
you have to transfer the publickey to server.
cd $(HOME)/.ssh
cat $(HOME)/.ssh/id_dsa.pub >> authorized_keys2

Note : Don't introduce any extra spaces, slashes or any other characters
If the file already exists, append the output of id_dsa.pub to EOF.

3. Repeat for Other machine if you want.
4. Now you can login without entering passwords.
On some machines, it might ask you to verify the host key,
but will happen only for the first time.

Changing MySQL root password

Changing MySQL root password

Sometimes you forget the root password, or something went wrong
modifying it. Here's how to reset the root password for mysql on a
Redhat Linux box:

[root@host root]#killall mysqld
[root@host root]#/usr/libexec/mysqld -Sg --user=root &
[root@host root]# mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1 to server version: 3.xx.xx
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> USE mysql

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> UPDATE user
-> SET password=password("newpassword")
-> WHERE user="root";
Query OK, 2 rows affected (0.03 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)
mysql> exit;
[root@host root]#killall mysqld

Then start MySQL again:

/etc/init.d/mysqld start

Linux Tips

------------------------------------------------------------------------------------
Who is SUPER USER in linux

awk -F: '$3 == 0{print $1,"superuser!"}' /etc/passwd
------------------------------------------------------------------------------------
How to get Environment for a process
If the process id is 920.

(cat /proc/920/environ; echo) : tr "\000" "\n"
------------------------------------------------------------------------------------
How to list files with their complete path
If 'childdir' is the name of directory.

find childdir -type f -printf "%AY%Am%Ad%AH%AM %p\n" : sort -r : gawk
'{print $2}'
------------------------------------------------------------------------------------
How to find open files in linux

find /proc -regex "/proc/[0-9]*/fd/.*" -ls
------------------------------------------------------------------------------------
Formatting man pages

man ls : col -bx > myfile.txt
------------------------------------------------------------------------------------
Finding the biggest files

ls -l : sort +4n
------------------------------------------------------------------------------------
Searching files for content

find / -name "filename" : xargs grep -n content
------------------------------------------------------------------------------------
Largest Directories

du -kx : egrep -v "\./.+/" : sort -n
-----------------------------------------------------------------------------------
List today's files only

ls -al --time-style +%D : grep `date +%D`
------------------------------------------------------------------------------------
Encrypt some plain text

perl -e 'print crypt("ke", "password");'
-----------------------------------------------------------------------------------
Look for unusual SUID root files

find / -uid 0 -perm -4000 -print
-----------------------------------------------------------------------------------
Look for unusual large files (> 10 Mb)

find / -size +10000k -print
-----------------------------------------------------------------------------------

Linux Command Line Tips

Linux Command Line Tips

http://www.pixelbeat.org/timeline.html

How to Search in Google

How to Search in Google

1. allintitle: graph partition triangle
2. +("index of") +("/ebooks":"/book") +(chm:pdf:zip:rar) +apache
3. allinurl: +(rar:chm:zip:pdf:tgz) TheTitle
4. allinurl:config.txt site:.jp
5. allinurl:admin.txt site:.edu
6. "Index of /something"
7. filetype:doc site:edu

Links:-

http://www.googleguide.com/advanced_operators_reference.html
http://www.google.com/help/operators.html

Networking Hacks

How to chat without using talk

At Server side:
nc -l -p 5600 -vv
At client Side:
nc 10.100.116.37 5600

Here 10.100.116.37 is the ip of server. 5600 is the port.

How to transfer file with out using ftp

At Server Side:
nc -v -w 30 -p 5600 -l > filename.back
At Client Side:
nc -v -w 2 10.100.116.37 5600 < filename

How to mail using telnet

C: client
S: Server

C:telnet smtp.iitb.ac.in 25
S:220 smtp2.iitb.ac.in ESMTP
C:helo
S:250 smtp2.iitb.ac.in
C:mail from:<root@10.100.106.50>
S:250 ok
C:rcpt to:<guptav@cse.iitb.ac.in>
S:250 ok
C:data
S:354 go ahead
C:Subject: This is subject line.
C:hi vaibhav,
C:how r u? i m fine.
C:bye for now
C:vaibhav
C:.
S:250 ok 1095622024 qp 2471
S:502 unimplemented (#5.5.1)
C:quit
S:221 smtp2.iitb.ac.in
S:Connection closed by foreign host.

SMTP Commands

SMTP commands are ASCII messages sent between SMTP hosts.

*Command: Description
*DATA: Begins message composition.
*EXPN <string> : Returns names on the specified mail list.
*HELO <domain> : Returns identity of mail server.
*HELP <command>: Returns information on the specified command.
*MAIL FROM <host> : Initiates a mail session from host.
*NOOP : Causes no action, except acknowledgement from server.
*QUIT : Terminates the mail session.
*RCPT TO <user>: Designates who receives mail.
*RSET : Resets mail connection.
*SAML FROM <host> : Sends mail to user terminal and mailbox.
*SEND FROM <host> : Sends mail to user terminal.
*SOML FROM <host> : Sends mail to user terminal or mailbox.
*TURN : Switches role of receiver and sender.
*VRFY <user> : Verifies the identity of a user.

Tuesday, April 18, 2006

Forgot password for Windows 2000?

Hi,
well, this trick can work only if you have got a dual boot machine with linux as one of the os. Also, either you should be a root or the windows partition should be mounten with appropriate permission.

just delete the file
"winnt/system32/config/sam"
and you are done. you can boot your machine in windows and can get entry with
user : administrator
passwd :

leave the password field null.