Skip to content

Instantly share code, notes, and snippets.

View l0b0's full-sized avatar

Victor Engmark l0b0

View GitHub Profile
let
pkgs =
import (
builtins.fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/d934204a0f8d9198e1e4515dd6fec76a139c87f0.tar.gz";
sha256 = "1zfby2jsfkag275aibp81bx1g1cc305qbcy94gqw0g6zki70k1lx";
}
) {
overlays = [
(final: prev: {

Keybase proof

I hereby claim:

  • I am l0b0 on github.
  • I am l0b0 (https://keybase.io/l0b0) on keybase.
  • I have a public key whose fingerprint is E5D2 3A00 D8C6 93B4 C2AC D93C EC92 D395 260D 3194

To claim this, I am signing this object:

@l0b0
l0b0 / git-bisect.sh
Created August 8, 2012 13:19
Git bisect example
#!/usr/bin/env bash
# Example of git-bisect use
# Commented code can be copied to verify the state of the code
# Alice creates a repository with a simple Bourne/Dash script
cd -- "$(mktemp -d)"
git init
> test.sh cat <<"EOF"
if [ "`id -u`" -ne 0 ]
@l0b0
l0b0 / gist:3217470
Created July 31, 2012 14:38
Simple merge example
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
cd "$(mktemp --directory)"
git init
cat > test.txt <<EOF
alfa
bravo
charlie
@l0b0
l0b0 / update-wordpress.sh
Created February 6, 2012 22:13
WordPress update script
#!/bin/sh
#
# $Id: update-wordpress.sh 393 2008-06-19 10:29:18Z vengmark $
#
# NAME
# update-wordpress.sh - Update WordPress to latest stable version.
#
# SYNOPSIS
# update-wordpress.sh [options]
#
@l0b0
l0b0 / minecraft.sh
Created September 8, 2011 11:15 — forked from pepijndevos/minecraft.sh
Running Minecraft with *less* memory tenfolded my FPS.
java -Xmx256M -verbose:gc -XX:+UseConcMarkSweepGC -XX:+UseAdaptiveGCBoundary -Djava.library.path=bin/natives -cp "bin/*" net.minecraft.client.Minecraft Notch foo
@l0b0
l0b0 / fstab-missing.sh
Created December 22, 2010 13:32
fstab entries which are not local filesystem entries
grep -v '^$\|^#' /etc/fstab | while read fs_spec fs_file dummy
do
if [ ! -e "$fs_spec" ] && [ "$fs_spec" != 'none' ]
then
echo "$fs_spec"
fi
if [ ! -e "$fs_file" ]
then
echo "$fs_file"
fi
@l0b0
l0b0 / unformat.sh
Created December 9, 2010 15:26
Unformat disk size
# Convert strings like '5kb', '2MB' and '500TB' to their byte equivalents
# Based on http://stackoverflow.com/questions/4399475/unformat-disk-size-strings
unformat()
{
echo $1 | sed -e 's/b//i;s/k/*1000/i;s/m/*1000000/i;s/g/*1000000000/i;s/t/*1000000000000/i' | bc
}
@l0b0
l0b0 / makefile-missing.sh
Created December 7, 2010 16:15
Find files missing from the local Makefile
find . -maxdepth 1 -print0 | \
sort --zero-terminated | \
while IFS= read -rd $'\0' path
do
grep "$(basename -- "${path:2}")" -- Makefile >/dev/null || echo "Could not find $path"
done
@l0b0
l0b0 / test_asap.sh
Created December 7, 2010 14:22
Test when something changes
while true
do
inotifywait -e modify,attrib,move,delete .
make test
done