Skip to content

Instantly share code, notes, and snippets.

@belminf
belminf / bootstrap.yaml
Last active February 2, 2016 22:47
Ansible playbook used to bootstrap Ubuntu servers. Blog post: http://iambelmin.com/2016/01/03/using-ansible-to-bootstrap-ubuntu/
---
- hosts: all
gather_facts: no
remote_user: root
pre_tasks:
- name: verify python installed
raw: dpkg -s python-simplejson > /dev/null 2>&1
register: python_installed
ignore_errors: True
@belminf
belminf / public_share.sh
Last active December 31, 2015 23:27
Modify smb.conf to allow guest access to "public" share, using with asuswrt-merlin
#!/bin/sh
# Grant guess access
sed -i '/\[public\]/,/^\[/ s/invalid users.*/guest only = yes\nwritable = yes/' /etc/smb.conf
# Remove user-specific ACLs
sed -i '/\[public\]/,/\[/ {/^\(valid\|invalid\|read\|write\)/d}' /etc/smb.conf
# Kill samba processes running
for pid in $(ps -w | grep [s]mbd | awk '{ print $1 }')
@belminf
belminf / install_vim.sh
Created December 14, 2015 13:51
Install VIM from source
## REQUIREMENTS:
# RHEL:
# $ sudo yum install python-devel ruby-devel ncurses-devel
## SOURCE:
# Get from https://github.com/vim/vim/releases
# $ wget https://github.com/vim/vim/archive/v7.4.972.tar.gz
## INSTALL:
@belminf
belminf / install_tmux.sh
Last active December 14, 2015 14:02
Install tmux statically from source
#!/bin/bash
# Exit on error
set -e
TMUX_URL=https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz
PREFIX=$HOME/local
TMP_DL_DIR="$(mktemp -d --suffix .tmux_install)"
cd $TMP_DL_DIR
## REQUIREMENTS:
@belminf
belminf / xsu.sh
Created August 18, 2015 12:57
Export xauth stuff when switching users
#!/bin/sh
# Help
usage() {
echo -e "Usage: $0 <user to switch to>"
}
# Check if we have enough args
if [ $# -ne 1 ]
then