Search This Blog

Showing posts with label debian tips. Show all posts
Showing posts with label debian tips. Show all posts

Saturday, February 14, 2009

IP spoofing with iceweasel

This tutorial explains how to spoof the IP addresses using iceweasel (firefox) web browser on machines running Debian Linux.

  1. Install the Iceweasel browser, tor button extension
    $sudo apt-get install iceweasel iceweasel-torbutton
  2. Install the privoxy, tor packages
    $sudo apt-get install privoxy tor
  3. Configure privoxy by adding the following line to /etc/privoxy/config
    forward-socks4a / 127.0.0.1:9050 .
    Note the '.' at the end. It is important.

  4. Restart the privoxy
    $sudo /etc/init.d/privoxy restart
    Restarting filtering proxy server: privoxy.
  5. Restart the tor daemon
    $sudo /etc/init.d/tor restart
    Stopping tor daemon: tor.
    Raising maximum number of filedescriptors (ulimit -n) to 32768.
    Starting tor daemon: tor...
    Feb 14 00:14:49.473 [notice] Tor v0.2.0.30 (r15956). This is experimental software. Do not rely on it for strong anonymity. (Running on Linux i686)
    Feb 14 00:14:49.474 [notice] Initialized libevent version 1.3e using method epoll. Good.
    Feb 14 00:14:49.474 [notice] Opening Socks listener on 127.0.0.1:9050
    done.
  6. Start the iceweasel. Use ctrl+2 to enable tor. The status of the tor button is visible in the right bottom box of the iceweasel window. The screenshots below might be helpful.





    Note: ctrl+2 acts as a toggle switch to enable/disable tor.

  7. Change the proxy. Right click on the tor button (bottom right corner of iceweasel) -> choose preferences -> select "use custom proxy settings"



  8. Click on "Test Settings" then click "ok" to test for proxy settings. If everything went successful, there will be a confirmation.



  9. Check the new spoofed "IP address" by visiting sites such as www.whatismyip.com etc., This will be the IP address seen by the websites you visit.

    Tor has its limitations. It will not give complete anonymity but something good enough for most purposes. Use at your own risk.

The above tutorial is tested in Debian Lenny, iceweasel 3.0.5, tor 0.2.0.30, privoxy 3.0.9, torbutton 1.2.0.

Back ground story :- While hopping around the internet, I came across some articles which claim to track the "identity thefters" via the IP address hits to a website. This is a good approach but we have to understand that it has its own limitations. Using this article, I just wanted to point out that it is very easy to hide one's IP address tracks. Dont be misled by the IP hits...

Thursday, November 22, 2007

browse gcc source code

To browse the source code of gcc use http://gcc.gnu.org/viewcvs/ . For example, to look at the contents of trunk/gcc/testsuite/gcc.c-torture/execute/ directory, just go to http://gcc.gnu.org/viewcvs/trunk/gcc/testsuite/gcc.c-torture/execute/ . Similarly, to view the contents of a particular file, say pr34130.c use http://gcc.gnu.org/viewcvs/trunk/gcc/testsuite/gcc.c-torture/execute/pr34130.c?revision=130258&view=markup

Situation:
Recently, a miscompilation bug has been discovered in gcc. It affects all the gcc versions from 3.3.6 to 4.2.2. This bug is fixed in 4.3.0 and a testcase trunk/gcc/testsuite/gcc.c-torture/execute/pr34130.c has been added to the testsuite so that the same problem does not arise in the future versions. I wanted to take a quick peek at this file but was not ready to download 1.2 gigabytes of gcc's svn repository just for this. The above tip came in handy under this scenario.

Alternate solutions:
1. If you are familiar with svn, it is possible to do
svn -q co svn://gcc.gnu.org/svn/gcc/trunk/gcc/testsuite/gcc.c-torture/execute execute
and download just the trunk/gcc/testsuite/gcc.c-torture/execute directory.

Related links :-
  • http://gcc.gnu.org/svn.html
  • http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34130
  • http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452108

Saturday, April 14, 2007

recipe for building texmacs package with pdebuild

As of Fri Apr 13, 2007, the stable branch of Debian (Etch) carries texmacs 1:1.0.6-10, unstable branch of Debian (Sid) carries texmacs 1:1.0.6-11 . Assuming that pdebuild is used for the first time, the following recipe can be used to build the unstable's texmacs packages on a machine running Debian Etch (stable).
$cp /usr/share/doc/pbuilder/examples/pbuilder-distribution.sh ~/bin/pbuilder-sid
$mkdir -p ~/pbuilder/result
$sudo aptitude install cdebootstrap
$pbuilder-sid create # if second time, use 'pbuilder-sid update'

$cat ~/bin/pdebuild-distribution.sh
#!/bin/sh

DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
BASE_DIR="$HOME/pbuilder"
pdebuild --buildsourceroot fakeroot \
--buildresult $BASE_DIR/result \
-- --basetgz $BASE_DIR/$DISTRIBUTION-base.tgz \
--distribution $DISTRIBUTION $@

$cp ~/bin/pdebuild-distribution.sh ~/bin/pdebuild-sid
$chmod +x ~/bin/pdebuild-sid
$cd ~/practice/
$wget http://ftp.debian.org/debian/pool/main/t/texmacs/texmacs_1.0.6-11.dsc
$wget http://ftp.debian.org/debian/pool/main/t/texmacs/texmacs_1.0.6.orig.tar.gz
$wget http://ftp.debian.org/debian/pool/main/t/texmacs/texmacs_1.0.6-11.diff.gz
$dpkg-source -x texmacs_1.0.6-11.dsc
$cd texmacs-1.0.6
$pdebuild-sid
The commands can be changed accordingly for other packages as well as for distributions other than sid. The ~/bin/pdebuild-distribution.sh performs similar function for pdebuild as /usr/share/doc/pbuilder/examples/pbuilder-distribution.sh does for pbuilder.

Tested on Debian Etch, using pbuilder 0.161

recipe for building texmacs package with pbuilder

As of Fri Apr 13, 2007, the stable branch of Debian (Etch) carries texmacs 1:1.0.6-10, unstable branch of Debian (Sid) carries texmacs 1:1.0.6-11 . Assuming that pbuilder is used for the first time, the following recipe can be used to build the unstable's texmacs packages on a machine running Debian Etch (stable).
$cp /usr/share/doc/pbuilder/examples/pbuilder-distribution.sh ~/bin/pbuilder-sid
$mkdir -p ~/pbuilder/result
$sudo aptitude install cdebootstrap
$pbuilder-sid create # if second time, use 'pbuilder-sid update'
$cd ~/practice/
$wget http://ftp.debian.org/debian/pool/main/t/texmacs/texmacs_1.0.6-11.dsc
$wget http://ftp.debian.org/debian/pool/main/t/texmacs/texmacs_1.0.6.orig.tar.gz
$wget http://ftp.debian.org/debian/pool/main/t/texmacs/texmacs_1.0.6-11.diff.gz
$pbuilder-sid build texmacs_1.0.6-11.dsc
The commands can be changed accordingly for other packages as well as for distributions other than sid. More info can be found at /usr/share/doc/pbuilder/pbuilder-doc.html

Tested on Debian Etch, using pbuilder 0.161

Monday, March 19, 2007

Disable system bell

1. The annoying system beep on tab completions can be disabled in Debian by adding the following lines to ~/.inputrc
$cat /home/rajulocal/.inputrc
# do not bell on tab-completion
set bell-style none
set bell-style visible
Unlike "xset b 0", the above hack works even if you are not running X.

Tested on Debian Etch (currently stable), on

$bash --version
GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

2. To disable the annoying bell sound in vim, gvim add the following line to ~/.vimrc
set vb t_vb=
More info for vim can be found at
:help visualbell
Tested on Debian Etch (currently stable), on vim 7.0.122

3. To disable the system bell sounds in tcsh, add the following line to ~/.cshrc
set nobeep
Tested it on Solaris 8, tcsh

Tuesday, March 06, 2007

convert mp3 to wav

place the following script in ~/bin and call it mp3towav.

guest@kusumanchi:~/bin$ cat mp3towav
#! /bin/sh

# bash script to convert .mp3 files to .wav files
# works even if the files have spaces in their names.
#
# Author : Kamaraju Kusumanchi
# Email : kamaraju at gmail dot com
#
# Usage : cd into the directory containing .mp3 files and then execute
# this.
#
# Ref :- Linux Multimedia Hacks, Tips & Tools for Taming Images, Audio and
# Video by Kyle Rankin, pg-100
#

for i in *.mp3; do
lame --decode "$i" "`basename "$i" .mp3`".wav
done
Make the script executable
guest@kusumanchi:~/bin$ chmod +x mp3towav
guest@kusumanchi:~/bin$ ls -al mp3towav
-rwxr-xr-x 1 guest guest 450 2007-03-06 20:19 mp3towav
Cd into the directory containing .mp3 files
guest@kusumanchi:~/bin$ cd /entertainment/telugu_songs/godavari/
guest@kusumanchi:/entertainment/telugu_songs/godavari$ ls -1 *mp3
01 - Ramachakkani Sitaki.mp3
02 - Uppongele Godavari.mp3
03 - Manasavacha.mp3
04 - Manasaa Gelupu.mp3
05 - Tippulu Tappulu.mp3
06 - Andamgaalena.mp3
Run the script
guest@kusumanchi:/entertainment/telugu_songs/godavari$ ~/bin/mp3towav
There will be messages such as
ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding.
input: 01 - Ramachakkani Sitaki.mp3
(44.1 kHz, 2 channels, MPEG-1 Layer III)
output: 01 - Ramachakkani Sitaki.wav (16 bit, Microsoft WAVE)
skipping initial 1105 samples (encoder+decoder delay)
Frame# 8878/8859 128 kbps L R
The corresponding .wav files will be created once the script completes. The .mp3 files are unmodified.
guest@kusumanchi:/entertainment/telugu_songs/godavari$ ls -1 *wav
01 - Ramachakkani Sitaki.wav
02 - Uppongele Godavari.wav
03 - Manasavacha.wav
04 - Manasaa Gelupu.wav
05 - Tippulu Tappulu.wav
06 - Andamgaalena.wav
Programs like k3b can now be used to burn these wave files onto a CD/DVD.

Monday, March 05, 2007

various ways of reading man pages

There are many ways to read man pages in Debian.

  1. man pagename
  2. In konqueror, man:pagename
  3. In vim, :Man pagename
  4. use vman, wman as described in Using vim as a man page reader
  5. In emacs, M-x man
  6. Install man2html and then go to http://localhost/cgi-bin/man/man2html in any browser
  7. xman -notopbox -bothshown &

Monday, February 19, 2007

Using vim as a man page reader

vim, gvim can be used to read man pages. To accomplish this add the following lines to ~/.bashrc file.
# Use vim as a manpage reader
function vman {
/usr/bin/man $* | /usr/bin/col -bp | /usr/bin/iconv -c | \
/usr/bin/view -c "set ft=man nomod nolist so=999 ts=8 wrap\
titlestring=man\ $1" -
}
# Use gvim as a manpage reader
function wman {
/usr/bin/man $* | /usr/bin/col -bp | /usr/bin/iconv -c | \
/usr/bin/gview -c "set ft=man nomod nolist so=999 ts=8 wrap\
titlestring=man\ $1" -
}
After this man pages can be read by using vman or wman. Sample commands look like
guest@kusumanchi:~$ vman rsync
guest@kusumanchi:~$ wman rsync
Tested this on Debian Etch, running vim 7.0.122, gvim 7.0.122, man 2.4.3, iconv 2.3.6.

Advantages of using vim as a man page reader
  1. 'marks' can be used to navigate the man pages which can sometimes be quite large. Other pagers such as 'less', 'more' do not have this feature.

  2. vim's search commands, navigation commands etc., can be used. No need to learn another software or another set of shortcuts.

  3. ":syn on" gives beautiful colors while reading the man page

  4. Let's say while reading the man page of ssh, you encounter ssh_config(5). Now to read the man page of ssh_config(5), simply place the cursor on that word and do ctrl-]. This will place you at the man page of ssh_config(5).

Sources:
  1. http://tech.groups.yahoo.com/group/vim/message/76376
  2. http://vim.sourceforge.net/tips/tip.php?tip_id=167

Wednesday, June 14, 2006

installing packages from marillat's repository

Marillat's repository contains useful debian packages like mplayer, acrobat reader etc., To install let's say libdvdcss2 package from this repository follow these instructions.

1) Go to the end of http://debian.video.free.fr/

2) Copy the appropriate repository address. For example if you are running Debian Sid (unstable) on an i386 machine then you need to copy this line

deb http://www.debian-multimedia.org sid main

3) paste this line into /etc/apt/sources.list . Note that you need to have root permissions to edit the sources.list file

4) update the sources by doing

wajig update

5) Now install the necessary package(s) by running

wajig install libdvdcss2

This method is much more easier compared to downloading the package and installing it by hand using 'dpkg -i'.

Comments/corrections/criticisms/typos etc., can be directed to kamaraju at gmail dot com

Tuesday, May 16, 2006

move tabs in konqueror

On the tab that you would like to move, click with the middle mouse button and then drag it to the required place.

This tip has been tested on a Debian Sid machine running

$konqueror --version
Qt: 3.3.6
KDE: 3.5.2
Konqueror: 3.5.2

Followers