Skip to content

Instantly share code, notes, and snippets.

@viviparous
viviparous / gist:bee0108376966efb02671aaab4de2afe
Created Jul 3, 2017
Configure dnsmasq from scratch on Debian
View gist:bee0108376966efb02671aaab4de2afe
Assumption: you know how to install dnsmasq, and you have done so.
##############################/etc/default/dnsmasq
#contains useful information
#IGNORE_RESOLVCONF=yes
##############################/etc/resolv.conf
domain home
search home
nameserver 127.0.0.1
@viviparous
viviparous / geany.perl_snippets.conf
Last active May 11, 2019
perl entries for Geany's snippets.conf file
View geany.perl_snippets.conf
#In Geany, open the snippets.conf file: Tools→Configuration Files→snippets.conf
#add these entries
[Special]
bracescompact={my $p=shift; my $rv=0; if(\s$p eq "something"\s) {\s%cursor%\s; $rv=1; } return $rv; }\n
[Perl]
if=if (\s%cursor%\s)%bracescompact%
sub=sub mySub %bracescompact%
package=package myPkg {\n\tsub new {my ($class,$name)=@_;\n\tmy $self={\n\tval1=>$name||$class,\n\tval2=>"default",\n\tval3=>()\n\t};\n\tmy $obj=bless $self,$class;\n\t$obj->_init;\n\treturn $obj;\n\t}\n\tsub _init %bracescompact%\n};\n
View SimpleHTTPServerWithUpload.py
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@viviparous
viviparous / chat.go
Created May 30, 2016 — forked from drewolson/chat.go
simple golang chat server
View chat.go
package main
import (
"bufio"
"net"
)
type Client struct {
incoming chan string
outgoing chan string
@viviparous
viviparous / gist:fb3742f54e7338671fdd7df7fff3cf5f
Last active May 1, 2016
Rip entire audio CD to a single file ("bin" format), playable by mplayer. Good for classical music, jazz, and other music that is best listened to "whole".
View gist:fb3742f54e7338671fdd7df7fff3cf5f
Rip entire audio CD to a single file ("bin" format), playable by mplayer.
Good for classical music, jazz, and other music that is best listened to "whole".
On Linux: easy to do.
On M-Windows: takes time to *find* the binary tools or compile them yourself.
Tools to use:
dd
toc2cue (comes with cdrdao)
bchunk
@viviparous
viviparous / pcritic.sh
Created Jul 6, 2015
linux: call bash script from find command; bash script runs perlcritic on each file found; output appended to file, separated by name of file examined
View pcritic.sh
#! /bin/bash
#find lib/ -type f -name "*.pm" | while read file; do ./pcritic_shell.sh "$file"; done
OFILE=critic_out.txt
echo Process $1
echo "= = = = = = = =" >> $OFILE
echo "= = = = = = = =" >> $OFILE