Skip to content

Instantly share code, notes, and snippets.

View wallentx's full-sized avatar
:shipit:
ȋ̴͎ ̶̘͝u̷̥͆s̴͖̾ē̷̠ ̶̟̉a̴͙̕ŗ̸͆č̶̬ḣ̷̭ ̴̡̄b̷̳̒ẗ̷͍ẘ̴̡

William Allen wallentx

:shipit:
ȋ̴͎ ̶̘͝u̷̥͆s̴͖̾ē̷̠ ̶̟̉a̴͙̕ŗ̸͆č̶̬ḣ̷̭ ̴̡̄b̷̳̒ẗ̷͍ẘ̴̡
View GitHub Profile
#!/bin/sh
#Toggle a default gap setting if it's not already set.
if [ -z "$BSPWM_GAPS" ]; then export BSPWM_GAPS=true; fi
#Get settings
. ~/.bspwm_theme
bspc config border_width $b_border_width
bspc config split_ratio $b_split_ratio
#
# bspwm hotkeys
#
super + c
echo "$(bspc query -D -d)" > /tmp/bspwmdtop_swap
#Not done yet.
super + v
bspc desktop $(bspwc query -D -d) -n tmp; \
@wallentx
wallentx / s3_bucket_policy_template.json
Created August 8, 2015 04:12
S3 bucket policy template
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"NameForBucketPolicy",
"Effect":"Allow",
"Principal":{
"AWS":[
"arn:aws:iam::111111111111:user/iam_user",
"arn:aws:iam::222222222222:user/iam_user",
@wallentx
wallentx / info.sh
Created September 10, 2015 19:46
lemonbar stuff
#!/bin/sh
# info.sh
# Output information with formatted background colors in lemonbar format
# This script can take arguments for what bar information to display(meant to be the names of the functions)
# clickable area aliases
AC='%{A:' # start click area
AB=':}' # end click area cmd
AE='%{A}' # end click area
# %{R} # swap current bg/fg
@wallentx
wallentx / panel
Created September 10, 2015 19:50
#!/usr/bin/env bash
# panel
# Start a panel on every monitor
# This script makes the assumption that monitors names are arranged left to right, named in increasing int value(1 2 3..)
# if this is not the case, you can override this with the num_mon variable below.
# Read the theme for display settings
. ~/.bspwm_theme
# Add panel scripts to path
#!/bin/sh
# panel_bar
# a script to interpret panel fifo information(workspace/window titles/system info)
# clickable area aliases
AC='%{A:' # start click area
AB=':}' # end click area cmd
AE='%{A}' # end click area
# Shell commands for clickable areas
@wallentx
wallentx / bashrc
Created September 29, 2015 17:25
bashrc
# functions
function swap() {
# Swap 2 filenames around, if they exist (from Uzi's bashrc).
local TMPFILE=tmp.$$
[ $# -ne 2 ] && echo "swap: 2 arguments needed" && return 1
[ ! -e $1 ] && echo "swap: $1 does not exist" && return 1
[ ! -e $2 ] && echo "swap: $2 does not exist" && return 1
@wallentx
wallentx / img2ascii.sh
Created October 6, 2015 19:05
convert small images like sprites to terminal ready ascii art. Not mine. I forgot where i downloaded it from.
#!/bin/bash
if [ $# -eq 0 ]; then
echo -e " \n \t ERROR: No arguments provided"
echo -e " \t USAGE: img2sf <path/to/image> <path/to/output>\n"
exit 1
fi
imgw=$(convert -print "%w\n" "$1" /dev/null)
@wallentx
wallentx / node_exporter.conf
Last active October 8, 2015 18:28
init script for node_exporter - to be placed in /etc/init/ - works on 14.04
# Run node_exporter
start on startup
script
/usr/bin/node_exporter
end script
@wallentx
wallentx / node-exporter
Created October 14, 2015 07:26
node-exporter init script for Amazon AMI/RHEL to be used with systemv. Place in /etc/init.d/ and ensure that line 12 matches your path
#!/bin/bash
#
#
#
# Start on runlevels 3, 4 and 5. Start late, kill early.
# chkconfig: 345 95 05
#
#
#!/bin/bash