Dec 022012
 

Find out more about IP addresses (IPv4 and IPv6) using the Python module IPy:

#!/usr/bin/env python

from IPy import IP

ip_s = raw_input('Please enter an IP address or range: ')
try:
    i = IP(ip_s)
except ValueError:
    print('Could not understand your input %s. Exiting.' % ip_s)
    from sys import exit
    exit(1)

print('I understood: %s' % i)
print('This is an IPv%d address.' % i.version())

#if i._prefixlen != 32: # a network
try:
    net = len(i) > 1 # a network
    size = len(i)
except:
    net = True
    size = "large"
if net:
    print('net: %s' % i.net())
    print('netmask: %s' % i.netmask())
    print('broadcast: %s' % i.broadcast())
    print('reverse notation of net address: %s' % i.reverseNames()[0])
    print('size of subnet: %s' % size)
else: # a single IP
    print('reverse notation: %s' % i.reverseNames()[0])

if i.version() == 6:
    print('normal notation: %s' % i.strNormal())
    print('full size notation: %s' % i.strFullsize())
print('hexadecimal notation: %s' % i.strHex())
print('string notation of binary value: %s' % i.strBin())
print('type of ip: %s' % i.iptype())
if i.get_mac(): print('found possible mac address: %s' % i.get_mac())
Mar 172012
 

This is a really compact and cheap router to take with you to hotels etc. to secure your internet access via VPN or redistribute a network.

The Hardware

You can get some information on the used hardware from my /proc/cpuinfo, /proc/meminfo and dmesg.

I put some photos I made of the PCB online on this PicasaWeb album.

More details to be found in OpenWrt’s wiki page on the router.

Aug 222011
 

Standards

The RFC 2217 standardizes the transmission of serial connection data via Ethernet, allowing to change remote serial port parameters (such as speed, parity, stop bits) over TCP using NVT (Network Virtual Terminal).

Implementations

Connection between your serial device and the Ethernet

Jun 262011
 

http://synergy-foss.org/pm/projects/synergy/wiki/UsingSynergy

Install:

cd ~/Downloads
curl -C - -O http://synergy.googlecode.com/files/synergy-1.4.5-MacOSX107-x86_64.dmg
open synergy-1.4.5-MacOSX107-x86_64.dmg
cd /Volumes/Synergy/
cp -r Synergy.app /Applications/

Start the server:

synergys -f --config ~/synergy.conf

where synergy.conf is:

# sample synergy configuration file
#
# comments begin with the # character and continue to the end of line.
# comments may appear anywhere the syntax permits.

section: screens
    seagull:
    lion:
end

section: links
    seagull:
            right = lion

    lion:
            left  = seagull

end

section: aliases
end

Connect the client

synergyc -f --name seagull 192.168.seagull.ip
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Jan 122011
 

Go to System → Preferences → Keyboard Shortcuts and set the shortcut for Hide all normal windows and set focus to desktop to something sane like Alt + D

update 2011-07-13: This happened again when I used Ubuntu 11.04 inside a NX session on a Mac OS X host computer. :(

resources

http://ubuntuforums.org/showthread.php?p=10025263#post10025263

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Jul 032010
 

Installation on Ubuntu:

sudo aptitude install ipwatchd-gnotify

if configured correctly (true by default) it will show you graphical warnings for IP conflicts as well as create log entries in /var/log/syslog (check for log messages containing ipwatchd).

Advanced configuration options are described and have to be set in the file/etc/ipwatchd.conf. This could be running a custom script as soon as an IP conflict is being detected for example.

When you detect an IP conflict, it might be an illegitimate attempt to take over your IP. So you want to tell the network who’s the real owner of that IP: this is done using arping and described in my blog post React to IP Takeover.

Jun 112010
 

You can use tcpdump to debug TCP/IP connections.

How it works

1st console run tcpdump:

philipp@lion:~$ sudo tcpdump -i lo
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes
09:55:05.968006 IP lion > lion: ICMP echo request, id 5745, seq 1, length 64
09:55:05.968025 IP lion > lion: ICMP echo reply, id 5745, seq 1, length 64
09:55:06.967003 IP lion > lion: ICMP echo request, id 5745, seq 2, length 64
09:55:06.967024 IP lion > lion: ICMP echo reply, id 5745, seq 2, length 64
^C
8 packets captured
16 packets received by filter
0 packets dropped by kernel

2nd console start any network activity (in this case a ping to localhost):

May 262010
 

When someone has taken your IP, react!

Set your IP to the correct one (belonging to you):

sudo ifconfig eth0 201.2.16.41 netmask 255.255.255.0

and run arping to get the IP back on your side:

sudo arping -U -c 3 -I eth0 201.2.16.41
sudo arping -A -c 3 -I eth0 201.2.16.41

Also have a look at my ipwatchd blog post on the ipwatch daemon, which can detect IP conflicts.

resources

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Apr 222010
 

Warning: my experience with gmailfs was not excellent! It was a bit slow and you always risk to lose data you stored on that account.


based on IMAP: http://sr71.net/projects/gmailfs/
(it used to be http://richard.jones.name/google-hacks/gmail-filesystem/gmail-filesystem.html but this was based on the Webinterface and that changed often)

gmailfs works with FUSE. So make sure Fuse is installed and works: http://wiki.ubuntuusers.de/fuse

Add user philipp to group fuse, install the python-fuse Ubuntu package and get the gmailfs code:

sudo usermod -aG fuse philipp
sudo aptitude install python-fuse
cd ~/Downloads
git clone git://git.sr71.net/gmailfs.git

you also need lgconstants.py from libgmail. See http://libgmail.cvs.sourceforge.net/viewvc/libgmail/libgmail/

Mar 232010
 

An easier solution just by setting a line in the configuration of the ssd daemon can be found in the blog post Chroot SFTP users.

http://forum.ubuntuusers.de/post/1884322/
http://manpages.ubuntu.com/manpages/karmic/man1/scponly.1.
http://wiki.ubuntuusers.de/scponly
http://sublimation.org/scponly/wiki/index.php/Main_Page

sudo aptitude install scponly

configuration:

sudo -s
cd /usr/share/doc/scponly/setup_chroot
gunzip setup_chroot.sh.gz
chmod +x setup_chroot.sh
./setup_chroot.sh

this adds the user etc…

sudo chmod u+s /usr/sbin/scponlyc

to not display the message of the day (motd) for raxo when logging in via shell and allow other users to put files in the incoming folder:

sudo -s
cd /home/scpuser
touch .hushlogin
chmod 777 incoming
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)