Skip to content

Instantly share code, notes, and snippets.

View gammy's full-sized avatar

gammy gammy

  • Stockholm
View GitHub Profile
@gammy
gammy / ne2000_28_10_15.diff
Created October 27, 2015 23:27
An updated patch for NE2000 emulation in dosbox. More to follow.
diff --git a/configure.ac b/configure.ac
index dc2aa0f..a8c552e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -372,6 +372,16 @@ else
AC_MSG_WARN([Can't find libpng, screenshot support disabled])
fi
+AH_TEMPLATE(C_NE2000,[Define to 1 to enable NE2000 ethernet passthrough, requires libpcap])
+AC_CHECK_HEADER(pcap.h,have_pcap_h=yes,)
@gammy
gammy / fdemutool.bash
Last active December 26, 2022 00:52
Mount/Read/Write Floppy Emulation USB sticks
#!/usr/bin/env bash
# This is a tool to assist in the usage of floppy disk hardware emulators:
# https://en.wikipedia.org/wiki/Floppy_disk_hardware_emulator
#
# Several of these devices (presumably cheaper ones) don't store
# floppy drives as files on an existing file system, but rather just
# store the raw data with a 96K offset. It renders the USB-stick
# useless for any other purposes.
#
# It also means that you need customized software to access the virtual
@gammy
gammy / lasercode.pl
Created May 20, 2015 13:53
lasercode.pl
#!/usr/bin/perl
# lasercode, a single-user IRC proxy for transparently handling encrirc-like
# encryption.
# Authors: #laserboy
# Try to aim for backwards compatability in some fashion
# Think portability and reusability
# BUGS:
# - TOPIC is supported, but the server truncs the message to 160 chars
@gammy
gammy / postgresql
Last active December 23, 2020 15:19
/etc/conf.d/postgresql from posgresql-openrc, adjusted to work on artix with the postgresql package.
# Comma-separated list of directories that contain a unix
# socket. Created and controlled by the related initscript. The
# directories created will be owned root:postgres with mode 1775.
#
# /run/postgresql is the default directory.
PG_SOCKET_DIRECTORIES="/run/postgresql"
# Which port and socket to bind PostgreSQL
PGPORT="5432"
@gammy
gammy / upgrade_docuwiki
Created June 12, 2020 21:53
DokuWiki upgrade helper which takes conf and data directories into account.
#!/usr/bin/env bash
# Gammies grimey dokuwiki updater.
#
# This script is dumb, but not as dumb as the upgrade plugin.
# Use with caution: I may not have considered all possible scenarios.
# One thing this script does not check is adequate permission to create files
# and subdirectories. Just basic sanity is performed.
#
# Written mainly for my own needs.
@gammy
gammy / player.html
Last active November 22, 2017 18:23
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>asciinema local player</title>
<style>
.asciinema-player-wrapper {
position: relative;
text-align: center;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>asciinema local player</title>
<link rel="stylesheet" type="text/css" href="asciinema-player.css" />
<style>
body {
background: #3b3b3b;
@gammy
gammy / .vimrc
Created November 11, 2017 21:58
Gammies vimrc
" Gammies vimrc. This will work for both vim and gvim.
" Use Vim settings, rather then Vi settings
" This must be first, because it changes other options as a side effect.
set nocompatible
set nomodeline " Disable trying to read modelines in files
" (best to keep it off if you're unaware of it anyway)
" Automatically vsplit "foo.h" if "foo.c" is loaded and "foo.h" exists
function! OpenCFile()
#!/usr/bin/env bash
which adb || exit
if [ -z "$1" ]
then
echo "Usage: $(basename $0) com.app.package.name dbname" >&2
exit 1
fi
pkg=$1
#!/usr/bin/env python3
from __future__ import print_function
import sys
try:
input = sys.argv[1]
if not input:
print("No!", file=sys.stderr)
sys.exit(1)