Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# convert a Kryoflux stream of an Olivetti M20 disk to a raw disk image that
# can be used in MAME.
#
# usage:
# conv_m20.sh <dir> [<output-file>]
# where <dir> is the directory where the stream files are stored as
# dump.xx.y.raw files. <output-file> is dir to write the raw image to
# It defaults to <dir>.raw
package main
// go test array_test.go
import "fmt"
// accepts an array[4], passed-by-value
func func1(a [4]int, x int) {
a[1] = x
}
@jandelgado
jandelgado / demo_log_provider.py
Created May 11, 2018 08:07
Python twisted - change default log observer
import sys
from zope.interface import provider
from twisted.logger import ILogObserver, formatEvent
from twisted.logger import textFileLogObserver
from twisted.logger import LogLevelFilterPredicate
from twisted.logger import FilteringLogObserver
from twisted.logger import LogLevel
def DemoLogObserverFactory():
@jandelgado
jandelgado / pytest_twisted_reactor_example.py
Last active April 24, 2018 18:37
Pytest fixture to make twisted integration tests use a fresh reactor instance
import sys
import pytest
from twisted.application import service
@pytest.fixture
def fresh_reactor():
"""provides a "fresh" reactor instance for integration tests -
check when twisted version changes . Tested with twisted 17.9.0"""
try:
@jandelgado
jandelgado / update_no-ip.sh
Created April 29, 2015 19:24
Simple script to update dynamic dns using no-ip.com service
#!/bin/sh
USERNAME=<your no-ip.com username>
PASSWORD=<your no-ip.com password>
HOSTNAME=<your hostname (FQDN)>
curl -u $USERNAME:$PASSWORD "https://dynupdate.no-ip.com/nic/update?hostname=$HOSTNAME"