Skip to content

Instantly share code, notes, and snippets.

View paulbdavis's full-sized avatar

Paul Davis paulbdavis

View GitHub Profile
@paulbdavis
paulbdavis / conkyjson
Last active February 16, 2020 23:03
conky rc for json output to i3 bar
out_to_x no
own_window no
out_to_console yes
background no
max_text_width 0
# Update interval in seconds
update_interval 2.0
# This is the number of times Conky will update before quitting.
@paulbdavis
paulbdavis / conkyjson-script
Created February 4, 2013 19:16
conky json kickoff script
#!/usr/bin/env bash
echo '{"version":1}'
echo '['
echo '[],'
exec conky -c "$HOME/.conkyjson"
@paulbdavis
paulbdavis / kernel-codename
Last active October 1, 2017 15:56
Bash Script for getting your current Linux Kernel's Codename from the kernel source makefile. Uses a cache file so it does not do excessive curl calls (especially when run in something like conky)
#!/usr/bin/env bash
pattern="NAME\s\?=\s\?"
kernelVersion=$(uname -r | sed "s/-.*//g")
# strip trailing .0 version, since the git tags on kernel.org do not have them
kernelVersion=${kernelVersion/%".0"/}
cacheFile="$HOME/.kernelcodename"
if [ -f "$cacheFile" ]
then
@paulbdavis
paulbdavis / i3zenburn-colors
Created February 14, 2013 20:55
i3 zenburn colors
# colors
client.focused #688060 #688060 #303030 #ffcfaf
client.focused_inactive #3f3f3f #3F3F3F #7f9f7f #3f3f3f
client.unfocused #3f3f3f #3F3F3F #DCDCCC #3f3f3f
client.urgent #dca3a3 #dca3a3 #DCDCCC #3f3f3f
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
@paulbdavis
paulbdavis / zenburn.html
Created February 14, 2013 21:10
Zenburn Color Scheme
<table class="wikitable" style="text-align:center">
<caption>Zenburn color definitions (originally defined for <a href="/w/index.php?title=Vim&amp;action=edit" class="new" title="Vim">Vim</a>)</caption>
<tr>
<th>Category</th>
<th>Example Text</th>
<th colspan="2">Foreground</th>
<th colspan="2">Background</th>
<th>Extra</th>
</tr>
<tr>
@paulbdavis
paulbdavis / Xresources
Created February 24, 2013 23:04
My Xresources file for Zenburn colors with XTerm
#define FONT -xos4-terminus-medium-r-normal--16-160-72-72-c-80-iso10646-1
#define WIDEFONT -misc-fixed-medium-r-normal-ja-13-120-100-100-c-180-iso10646-1
XTerm*faceName: DejaVu Sans Mono
XTerm*faceSize: 10
*customization: -color
XTerm*termName: xterm-256color
XTerm*font: FONT
XTerm*wideFont: WIDEFONT
XTerm*boldFont: FONT
XTerm*reverseWrap: true
@paulbdavis
paulbdavis / external-ip
Last active December 14, 2015 22:09
Script to get your external ip, with caching (use a cron job to remove the file periodically, or whatever)
#!/usr/bin/env bash
if [ "$1" = "-r" ]
then
rm $HOME/.externalip
exit 0;
fi
cacheFile="$HOME/.externalip"
if [ ! -f "$cacheFile" ] || [ ! "$(cat $cacheFile)" ]
then
FROM myrepo/base
MAINTAINER me
RUN mkdir /app
RUN apt-get update && apt-get -y install packages i need;
ENV HOME /root
RUN echo 'ssh host info for git repo server' > /root/.ssh/known_hosts
@paulbdavis
paulbdavis / eventcmd
Last active January 2, 2016 20:29
mcabber eventcmd script
#!/usr/bin/env bash
EVENT_TYPE="$1"
EVENT_SUBTYPE="$2"
JID="$3"
FILE="$4"
TITLE="XMPP"
SOUND_DIR="$HOME/.mcabber/sounds"
SOUND_DEVICE="alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00-CODEC.analog-stereo"
TIMEOUT=10000
@paulbdavis
paulbdavis / server-setup.sh
Created January 13, 2014 20:17
Ubuntu server setup (docker, node, mongo, bitcoind)
#!/usr/bin/env bash
# add ppas
add-apt-repository -y ppa:chris-lea/node.js
add-apt-repository -y ppa:bitcoin/bitcoin
#mongo
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' > /etc/apt/sources.list.d/mongodb.list
#docker
wget -qO- https://get.docker.io/gpg | apt-key add -