Skip to content

Instantly share code, notes, and snippets.

View provegard's full-sized avatar
Test-driving things

Per Rovegård provegard

Test-driving things
View GitHub Profile
@provegard
provegard / send-sms.sh
Created June 9, 2018 08:00
Send SMS script
#/bin/sh
dest=$1
test -n "$dest" || exit 1
read text
user=`whoami`
retries=5
cont=1
while test $retries -gt 0 -a $cont -ne 0; do
@provegard
provegard / getnifs.py
Created December 29, 2011 23:26
Python script for listing network interfaces with name, index and addresses
#!/usr/bin/python
# Based on getifaddrs.py from pydlnadms [http://code.google.com/p/pydlnadms/].
# Only tested on Linux!
from socket import AF_INET, AF_INET6, inet_ntop
from ctypes import (
Structure, Union, POINTER,
pointer, get_errno, cast,
c_ushort, c_byte, c_void_p, c_char_p, c_uint, c_int, c_uint16, c_uint32
@provegard
provegard / ssdp-test.py
Created December 5, 2011 21:52
Small SSDP server/client test in Python
#!/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'
@provegard
provegard / dump_wallet_addresses.py
Last active March 15, 2023 06:13
Python script for dumping wallet addresses and private keys
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# This software is in the public domain, furnished "as is", without technical
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
#
# Usage:
# ./dump_wallet_addresses.py <wallet binary>
#
@provegard
provegard / avahi-test.py
Created December 5, 2011 22:07
Test program for using Avahi in Python
#!/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