Skip to content

Instantly share code, notes, and snippets.

View vodik's full-sized avatar

Simon Gomizelj vodik

  • Movable Ink
  • Toronto, Ontario
View GitHub Profile
@vodik
vodik / bulkw.c
Last active December 15, 2015 17:49
Small utility to write to many files at once.
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <err.h>
#include <glob.h>
static int write_to(const char *msg, const char *path)
{
FILE *fp = fopen(path, "w");
@vodik
vodik / gist:4013852
Created November 4, 2012 21:26
Upgrade path for archlinux-wiki
@vodik
vodik / config.example.bash
Created September 28, 2012 01:12
My old firewall script
#! vim: ft=sh
EXTERNAL=eth0
INTERNAL=br0
NAT=static
EXTERNAL_IP='x.x.x.x'
NETWORK='10.0.0.0/22'
@vodik
vodik / wanrec.sh
Created September 27, 2012 18:38 — forked from goodboy/wanrec.sh
script to record audio from sangoma cards
#!/bin/bash
# Tyler Goodlet [email protected] -- initial version
# Dependencies:
# -bash 4.0
# -gawk <ver?>
# TODO: add tcpdump tracing of SIP legs
# support bash 3.0 (i.e. remove coproc, associative arrays)
# script debug options - x for echo v for verbose: "set -<variable>" (to turn on), "set +<variable>" (to turn off)
module ItsNotWorking (
getLinks
) where
import Text.HTML.TagSoup
import Text.Regex.Posix
import Network.HTTP
isInteresting :: String -> Bool
isInteresting link = any (link =~) supported
@vodik
vodik / alsa.c
Created November 19, 2011 06:21
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@vodik
vodik / Makefile
Created November 16, 2011 05:40
Template for a WAVE reader.
CC = gcc
CFLAGS = -Wall -pedantic -std=gnu99 -g
LDFLAGS = -lasound
OBJ = wavereader.o alsa.o main.o
all: ademo
ademo: ${OBJ}
@echo CC -o $@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
int main(int argc, char *argv[])
{
int fd = open("/dev/spi_driver", O_RDONLY);
if (fd < 0)