Skip to content

Instantly share code, notes, and snippets.

View bencord0's full-sized avatar

Ben Cordero bencord0

View GitHub Profile
@bencord0
bencord0 / vif-br0
Last active August 29, 2015 13:58
libvirt domain
#!/bin/bash
echo "vif-br0: $@"
test "$1" = "offline" && exit
ip link show "$vif" && {
ip link set dev "$vif" master br0
ip link set dev "$vif" up
}
@bencord0
bencord0 / etc-conf.d-net
Last active August 29, 2015 13:58
netctl bridging for static hosts
# /etc/conf.d/net
modules="iproute2"
bridge_add_eth0="br0"
config_eth0="null"
config_br0="192.168.1.##/24
2001:####:####:####::##/64"
routes_br0="default via 192.168.1.#
default via 2001:####:####:####::#"
@bencord0
bencord0 / bridge.xml
Created April 8, 2014 00:13
libvirt extras
<network ipv6='yes'>
<name>bridge</name>
<bridge name="br0"/>
<forward mode="bridge"/>
</network>
SALT_MASTER=${SALT_MASTER:-localhost}
cat << EOF > /etc/portage/package.keywords/app-admin
app-admin/salt **
EOF
cat << EOF > /etc/portage/package.keywords/dev-python
dev-python/async
dev-python/gitdb
dev-python/git-python
#!/bin/bash
VIRTHOST="${VIRTHOST:-xen:///system}"
VIRTHOSTVG="${VIRTHOSTVG:-vg}"
UUID=$(uuidgen)
echo $UUID
virsh -c "${VIRTHOST}" vol-create-as "${VIRTHOSTVG}" $UUID 50G
cat << EOF > vm-$UUID.xml
<domain type='xen'>
import os
from django.conf.urls.defaults import patterns
from django.http import HttpResponse
filepath, extension = os.path.splitext(__file__)
ROOT_URLCONF = os.path.basename(filepath)
def hello(request):
return HttpResponse('Hello World!')
urlpatterns = patterns('', (r'^/$', hello))
@bencord0
bencord0 / run_riak.sh
Created July 12, 2014 17:26
Running riak locally
#!/bin/bash
# Running riak from a local directory
# This script assumes that riak is installed system-wide and stores
# all data under the ./.riak directory.
# If riak is installed elsewhere, you want to store the data at a
# different path or you want to change the listening ports, you
# can adjust the environment variables below.
RIAKPORT=${RIAKPORT:-8091}
@bencord0
bencord0 / gist:6d2ca2f2e533daee1cc2
Created August 2, 2014 14:54
rebuild_uefi_kernel.sh
#!/bin/bash
set -e
cd /usr/src/linux
VERSION=$(make kernelversion)
make modules
make modules_install
depmod "$VERSION"
dracut -f -a lvm /boot/initramfs-"$VERSION".img "$VERSION"
@bencord0
bencord0 / README
Created September 28, 2014 20:51
Kerberized PAM logins
Needed packages
---------------
net-nds/openldap
sys-auth/nss_ldap
sys-auth/pam_krb5
sys-auth/pam_ldap
/etc/nsswitch.conf
------------------
passwd: ldap files
INFO: task zfs:2580 blocked for more than 30 seconds.
Tainted: P W O 3.16.5-gentoo #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
zfs D 0000000000000000 13472 2580 2479 0x00000004
ffff8803e9c9bc28 0000000000000002 ffff8803e9c9bfd8 ffff880411a303d0
0000000000012d40 ffffffff8f41a450 ffff8800c558f2a8 ffff8800c558f200
ffff8800c558f2b0 ffff8800c558f2e4 0000000000000000 ffff8803e9c9bc38
Call Trace:
[<ffffffff8ec2f5e8>] schedule+0x69/0x6b
[<ffffffffc00e292c>] __cv_timedwait+0xb2/0x107 [spl]