Skip to content

Instantly share code, notes, and snippets.

View uggedal's full-sized avatar

Eivind Uggedal uggedal

View GitHub Profile
@uggedal
uggedal / gist:7691234
Last active December 29, 2015 15:29
relocation R_X86_64_32 against `main.func·001·f' can not be used when making a shared object; recompile with -fPIC
--- FAIL: TestCgoCrashHandler (0.88 seconds)
crash_test.go:78: expected "main: recovered done\nnew-thread: recovered done\nsecond-new-thread: recovered done\nmain-again: recovered done\n", but got "# command-line-arguments\n/usr/lib/gcc/x86_64-alpine-linux-uclibc/4.8.2/../../../../x86_64-alpine-linux-uclibc/bin/ld: /var/tmp/go-link-7nRypE/go.o: relocation R_X86_64_32 against `main.func·001·f' can not be used when making a shared object; recompile with -fPIC\n/var/tmp/go-link-7nRypE/go.o: could not read symbols: Bad value\ncollect2: error: ld returned 1 exit status\n/home/eu/src/alpine-docker/aports/go/src/go/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful exit status 0x100\n"
@uggedal
uggedal / base.list
Created August 18, 2013 15:58
Minimal Arch base group
bash
btrfs-progs
bzip2
coreutils
cronie
cryptsetup
device-mapper
dhcpcd
diffutils
file
@uggedal
uggedal / tree.js
Last active December 18, 2015 02:48
/*
var messages = [
{ id: 1, inReplyTo: 2 },
{ id: 2 },
{ id: 3, inReplyTo: 1 },
{ id: 4, inReplyTo: 999 },
{ id: 5, inReplyTo: 6 },
{ id: 6, inReplyTo: 3 },
{ id: 7, inReplyTo: 6 },
{ id: 8, inReplyTo: 6 },
set -e
# Required packages:
apt-get -y install ssh
# Vagrant user:
cat <<EOF > /etc/sudoers
%vagrant ALL=(ALL) NOPASSWD: ALL
EOF
groupadd -g 500 vagrant
@uggedal
uggedal / nginx.conf
Created May 28, 2013 17:28
Multiple location match in nginx
location ~ ^/(.*)/(.*)/other/stuff/(.*)/this-is-static {
location /static-cache {
# root/alias or other config here
}
try_files /static-cache/$1/$2/$3/this-is-static @app;
}
# or
location ~ ^/(.*)/(.*)/other/stuff/(.*)/this-is-static {
<style>
h1 {
font-size: 55em;
line-height: 1.25;
text-align: center;
}
</style>
<h1 id=time></h1>
<script>
@uggedal
uggedal / hack.css
Created October 23, 2012 13:28
mobile media queries hack
label,
input[type=text],
select {
float: left;
}
input[type=text]:after,
select:after {
content: " ";
clear: left;
@uggedal
uggedal / systemd.sh
Created September 25, 2012 11:52
systemctl is-enabled does not work with templated units
# systemctl --version
systemd 189
arch
+PAM -LIBWRAP -AUDIT -SELINUX -IMA -SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ
# uname -a
Linux sodium 3.0.42-1-lts #1 SMP Mon Aug 27 19:44:47 CEST 2012 x86_64 GNU/Linux
# cat /etc/issue
Arch Linux \r (\l)
@uggedal
uggedal / upgrade.sh
Created September 25, 2012 11:07
Upgrade postgresql from 9.1 to 9.2 on Arch Linux
systemctl stop postgresql && pacman -Syu --noconfirm && su - postgres -c 'mv /var/lib/postgres/data /var/lib/postgres/olddata' && su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'" && systemctl start postgresql.service && systemctl stop postgresql.service && pacman -S postgresql-old-upgrade --noconfirm && su - postgres -c 'pg_upgrade -d /var/lib/postgres/olddata/ -D /var/lib/postgres/data/ -b /opt/pgsql-9.1/bin/ -B /usr/bin/' && /var/lib/postgres/delete_old_cluster.sh && rm /var/lib/postgres/delete_old_cluster.sh && /var/lib/postgres/analyze_new_cluster.sh && systemctl start postgresql.service && pacman -Rs postgresql-old-upgrade --noconfirm
@uggedal
uggedal / Makefile
Created May 24, 2012 21:41
mediaqueri.es deployment with pacman
VERSION=1.0
.PHONY: all with-venv
all: with-venv
@./manage.py assets build
@python setup.py sdist
@cp dist/mediaqueries-$(VERSION).tar.gz pkg/
@cd pkg && makepkg -f --skipchecksums
@./manage.py assets clean