Blog - Thiago de Freitas Oliveira Araujo(multitouch, NUI, robotics, SLAM, Linux, Embedded Systems, Pervasive Computing, Nature, Soccer,...)

26 Nov 2010

Emdebian.org down

No Comments Embedded Linux


As pointed out by a blog visitor, today (Argus) , the current Emdebian.org site(server) is down.

For keeping track with the tutorial posted and the info on previous posts(mainly with the Mini 2440 rootfs) , just use the currently available mirror server at:

http://ftp.uk.debian.org/emdebian/grip/

Also, as stated on the Embedded Debian mailing list by Wookey the new server has just arrived and is on setup period. The Emdebian team is already working on that and It should be up and running still in the weekend.

New emdebian server is being set up

Wookey
Fri, 26 Nov 2010 04:27:14 -0800

Our new server has now 'arrived' and is being
configured as we speak(well, we are arguing
about how best to set it up :-) 

Once there is something to actually serve
DNS will be pointed at it.hopefully later today,
but maybe over the weekend.

Wookey
--
Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/
19 Nov 2010

Get IP, Netmask, Gateway using python (UNIX)

No Comments Python


Recently, I needed to get the Ip, Netmask and Gateway of the TS-7400 using python, and I had somehow issues to get this info. So , this post is more a reminder to myself with a collection of 3 useful functions. Maybe, that can be useful for someone else too.

import os
import socket
import fcntl
import struct

SIOCGIFNETMASK = 0x891b

def get_network_mask(ifname):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    netmask = fcntl.ioctl(s, SIOCGIFNETMASK, struct.pack('256s', ifname))[20:24]
    return socket.inet_ntoa(netmask)

def get_ip_address(ifname):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    return socket.inet_ntoa(fcntl.ioctl(
        s.fileno(),
        0x8915,  # SIOCGIFADDR
        struct.pack('256s', ifname[:15])
    )[20:24])

def get_gateway(ifname):
	cmd = "ip route list dev "+ ifname + " | awk ' /^default/ {print $3}'"
	fin,fout = os.popen4(cmd)
	result = fout.read()
	return result

WP SlimStat