Skip to content

Instantly share code, notes, and snippets.

View obfusk's full-sized avatar
🏳️‍🌈
hacking ⇒ ¬sleeping 😸

FC (Fay) Stegerman obfusk

🏳️‍🌈
hacking ⇒ ¬sleeping 😸
View GitHub Profile
@obfusk
obfusk / head-and-tail.bash
Last active December 19, 2015 09:49
head+tail with perl
# One-line version of head-and-tail.plx (w/o --no-overlap and w/o
# proper handling of tail less than number of lines):
seq 1 100000 | HEAD=5 TAIL=2 SEP=$'...\n' perl -e 'my($h,$t,$s,$l)=($ENV{"HEAD"}||10,$ENV{"TAIL"}||10,$ENV{"SEP"}||"",0);my @b=();while(<>){print if $.<=$h;$b[$.%$t]=$_;$l=$.};print $s;for(my $i=$t-1;$i>=0;--$i){print $b[($l-$i)%$t]}'
# For files (not streams), this seems to work just fine too (but it
# will not overlap):
( head -n 5; echo ...; tail -n 2 ) < some-file
@obfusk
obfusk / vim.sh
Created July 12, 2013 20:50
open more than 10 tabs in vim
vim --cmd 'set tabpagemax=20' -p ...
@obfusk
obfusk / git.sh
Created July 14, 2013 15:00
git remote with multiple push urls
git remote add all URL1
git remote set-url all --add --push URL1
git remote set-url all --add --push URL2
@obfusk
obfusk / export.sh
Last active December 19, 2015 17:49
chromium sandbox
# run chromium builds from https://download-chromium.appspot.com w/ sandbox from ubuntu package
# NB: this will only work as long as the sandbox API stays the same
export CHROME_DEVEL_SANDBOX=/usr/lib/chromium-browser/chromium-browser-sandbox
@obfusk
obfusk / README.md
Last active December 21, 2015 15:58
b43 firmware for 14e4:4331 on ubuntu 12.04

Instructions

$ cd /some/dir
$ wget http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2
$ wget .../SHA512SUMS
$ shasum -c SHA512SUMS
$ export FIRMWARE_INSTALL_DIR="/lib/firmware"
$ tar xjf broadcom-wl-5.100.138.tar.bz2
$ sudo b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" broadcom-wl-5.100.138/linux/wl_apsta.o
@obfusk
obfusk / dot.profile.caesium.bash
Last active December 21, 2015 15:59
[OLD] dotfiles
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
@obfusk
obfusk / apt
Last active December 21, 2015 15:59
apt, gem, cfg, npm, opt, pip; see also: sodium, ...
augeas-tools
build-essential
byobu
cheese
chromium-codecs-ffmpeg-extra
curl
debian-goodies
dialog
erlang
etckeeper
@obfusk
obfusk / README.md
Last active December 21, 2015 19:49
jitsi in /opt from .deb w/o apt

Instructions

  • get .deb
  • extract to /opt/pkg/jitsi # control.tar.gz, data.tar.gz, usr/
  • apply patches
  • ln -s /opt/pkg/jitsi/usr/bin/jitsi /usr/local/bin/jitsi
  • ln -s /opt/pkg/jitsi/usr/share/applications/jitsi.desktop /usr/share/applications/jitsi.desktop
@obfusk
obfusk / dev-tree
Created September 1, 2013 15:10
~/dev tree sodium
|-- OLD
| `-- obfusk
|-- dev
| |-- clj-obfusk-data
| |-- eft
| |-- localconfig
| |-- obfusk.coffee
| |-- rb-obfusk-data
| |-- rb-obfusk-util
| |-- taskmaster
@obfusk
obfusk / dot.abcde.conf
Last active December 22, 2015 12:49
.abcde.conf
ACTIONS=cddb,read,encode,move,clean
PADTRACKS=y
CDDBPROTO=5 # latin1
HELLOINFO='somebody@somehost'
SHOWCDDBFIELDS=year
LAMEOPTS='-h'
MAXPROCS=3