This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Lists Linux block devices and for each one the controller | |
# it is connected to. | |
set -o pipefail | |
for i in /sys/block/sd*; do | |
# Find the path that contains the PCI ID of the controller. | |
link=$(readlink $i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Test program for using Avahi in Python. Publishes a dummy service. | |
import sys | |
import avahi | |
import dbus | |
from twisted.internet import reactor | |
# Service details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Python program that can send out M-SEARCH messages using SSDP (in server | |
# mode), or listen for SSDP messages (in client mode). | |
import sys | |
from twisted.internet import reactor, task | |
from twisted.internet.protocol import DatagramProtocol | |
SSDP_ADDR = '239.255.255.250' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Tiny program for listing network interface names and indexes in Linux. | |
* | |
* Compile with: gcc -std=c99 -o listifs listifs.c | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <net/if.h> | |
int main(int argc, char *argv[]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from xml.etree import ElementTree as ET | |
from cStringIO import StringIO | |
def parse_attrns(file): | |
"""Parse file to ElementTree instance. Patch non-prefixed attributes | |
with the namespace of the element they belong to. | |
""" | |
events = ("start", ) |
NewerOlder