pause/resume tail -f


PAUSE:Ctrl+s
RESUME: Return/Ctrl+q

source: here

Posted in bike | Leave a comment

vim tabs and identation

syn on
set number
set tabstop=2
set expandtab
set shiftwidth=2

Posted in bash, Debian, python | Leave a comment

mac address lookup with bash

This script relies on wireshark, it has to be installed

#!/bin/bash
#macaddresslookup.sh
if [[ ! $1 ]]
then echo "Usage: $0 "
exit 1
else
mac=$1
#echo ${mac:0:8}
oui=${mac:0:8}
grep -i $oui /usr/share/wireshark/manuf
fi

You can also download the file:
http://anonsvn.wireshark.org/wireshark/trunk/manuf

Posted in bash, Debian | Tagged , , , | Leave a comment

resuming ssh transfers

how to send and/or resume:


rsync --partial --progress --rsh=ssh tarball_with_legal-files.tar.gz root@example.net:/mnt/directory/

Posted in bash, Debian | Tagged , , , , , | Leave a comment

changing the default browser (XFCE4)

root@machine:# vim /usr/share/applications/defaults.list

%s/google-chrome.desktop/exo-web-browser.desktop/g

Posted in bike | Leave a comment

tcpdump by example

tcpdump -ni eth0 -XS -s 0 -c 5

Posted in bike | Leave a comment

installed version for a package in debian


#!/bin/bash
# installed_version.sh
# written by f varas, with lots of love and awk, which are basically the same.
# how it works:
# this script will tell you the _installed_ version of the
# package name you pass as argument.
if [ "x$1" != "x" ]
then dpkg -l | grep "^ii.*$1" | awk '{ printf "%-35s %s\n", $2 , $3 }'
else echo "usage: version_installed.sh "
fi

Posted in bash, Debian, tech | Tagged , , , | Leave a comment

red spdif light always on on macbook 4,1 with Linux

I’ve been using debian for a while on my macbook 4,1 and the spdif light stays always on. This is disturbing.
As root, I used amixer set IEC958 off to shut the damn red ligh off.

Good Luck!

Posted in Debian | Tagged , , , , | Leave a comment

ssh over a non standard port

if you have servers with non standard ports for ssh, you can
a) ssh -p 2009 user@machine
scp -P 2009 …

b) edit your ~/.ssh/config

Host www.example.com
Port 50002

then, just ssh user@machine will work

Posted in bash, Debian | Tagged , , , , , | Leave a comment

Getting the version of a kernel module

If you need to know the version of a GNU/Linux kernel module:
modprobe {module}

Posted in bash, Debian | Tagged , , , , , | Leave a comment