Using tcpdump to capture network traffic on the command line

By Joao

To listen for traffic and write to stdout:
tcpdump -i -n -A expression

  • -i The interface id to listen on ( run tcpdump -D to get a list of available interfaces )
  • -n Don’t convert host addresses to names (avoid dns resolution)
  • -A Print packets in ASCII, excluding link level headers. Use -X for both hex and ASCII printout.

See man pcap-filter for a full description of ‘expression’
Examples include:
tcpdump -i 11 -n -A -s 65535 port 80
tcpdump -i 11 -n -A -s 65535 dst host 10.0.0.1

Other usefull flags:
-w write packets to a file which can later be replayed with -r

categoriaTechnology commentoNo Comments dataSeptember 7th, 2011
Read All

Sendmail from/to example

By Joao

Sending an email from the command line using sendmail with the send/to fields set:

sendmail -v -f sender@zonalivre.org recipient@zonalivre.org
Subject: Test Email
Email content here

.

categoriaTechnology commentoNo Comments dataAugust 16th, 2011
Read All

Turn off blinking/visual bell in gnome 3

By Joao

When using a terminal, tab auto completion makes the whole screen blink (aka visual bell). I find this annoying as hell. To work around it:

Start gconf-editor
Navigate to /apps/metacity/general
Either turn off “visual_bell”, or change “visual_bell_type” from “fullscreen” to “frame_flash”

categoriaTechnology commentoNo Comments dataJuly 18th, 2011
Read All

winetricks fails when installing vcrun2010

By Joao

Problem:
You run
winetricks vcrun2010

But get the message:

Using native,builtin override for following DLLs: msvcr100
Executing early_wine regedit c:\winetrickstmp\override-dll.reg
——————————————————
Executing wget -O msxml3.msi -nd -c –read-timeout=300 –retry-connrefused –header Accept-Encoding: gzip,deflate http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi
–2011-03-12 23:10:19– http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi
Resolving download.microsoft.com… 213.199.149.141, 213.199.149.144
Connecting to download.microsoft.com|213.199.149.141|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2011-03-12 23:10:20 ERROR 404: Not Found.

——————————————————
Note: command ‘wget -O msxml3.msi -nd -c –read-timeout=300 –retry-connrefused –header Accept-Encoding: gzip,deflate http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi’ returned status 8. Aborting.
——————————————————
——————————————————
vcrun2010 failed
——————————————————

The VC2010 runtime redistributable setup needs to load msxml3. winetricks tries to download it from a location in the microsoft.com website where it is no longer available. Instead, search the web for the file “msxml3.msi” and edit winetricks to point to it, eg:


vi winetricks

Find the load_msxml3 function, and replace the download location:

From:

w_download msxml3 http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi d4c2178dfb807e1a0267fce0fd06b8d51106d913

To:

w_download msxml3 ftp://ftp.uni-rostock.de/pub/tools/microsoft/XML/US/msxml3.msi

categoriaTechnology commento2 Comments dataMarch 13th, 2011
Read All

Adding a signatures to all messages in Microsoft Outlook

By Joao

Signature options are under:

Tools->Options->”Mail Format”->Signatures

categoriaTechnology commentoNo Comments dataJanuary 6th, 2011
Read All

Query which files are installed by an RPM package

By Joao

rpm --query --filesbypkg techrx

categoriaTechnology commento2 Comments dataNovember 18th, 2010
Read All

Converting .flac to .mp3 in Linux

By Joao

flac -cd sourcefile.flac | lame -h - destfile.mp3

categoriaTechnology commento1 Comment dataMay 21st, 2010
Read All

Turn on query logging in MySQL

By Joao

Add the following to /etc/my.cnf:

log=/var/log/queries.log

Then restart mysqld.

All queries will be logged to that file. In MySQL 4.1 the log file must already exists beforehand. Check /var/log/mysqld.log during startup in case it’s not logging anything.

categoriaTechnology commentoNo Comments dataJanuary 7th, 2010
Read All

Cannot start Microsoft Office Outlook. Cannot open the Outlook window.

By Joao

Start->run..then type the following -> “Outlook.exe /resetnavpane”

categoriaTechnology commentoNo Comments dataDecember 3rd, 2009
Read All

Problem loading ssh keys remotely

By Joao

When I try to load my ssh-key from a remote location I get the message:

Could not open a connection to your authentication agent.

The way to get around this is to load a shell session inside the ssh-agent:


ssh-agent bash
ssh-add
ssh-add ~/.ssh/somekeyfile

categoriaTechnology commentoNo Comments dataNovember 16th, 2009
Read All