Skip to content

Instantly share code, notes, and snippets.

View KittyKatt's full-sized avatar

Katie KittyKatt

View GitHub Profile
@KittyKatt
KittyKatt / gist:3935470
Created October 22, 2012 23:25
mpd playlistinfo out
Title: Synchronicity, Pt. 2
Album: The Police Disc 2
Track: 11
Date: 2007-06-11
Genre: Rock
Composer: Sting
Performer: @ www.newestmp3s.com
Disc: 2/2
Pos: 188
Id: 563
@KittyKatt
KittyKatt / pomf
Last active March 24, 2018 14:49
pomf.se BASH script to upload images
#!/usr/bin/env bash
# pomf.se uploader
# requires: curl
dest_url='http://pomf.se/upload.php'
return_url='http://a.pomf.se'
if [[ -n "${1}" ]]; then
file="${1}"
if [ -f "${file}" ]; then
@KittyKatt
KittyKatt / scrotshooter
Last active December 18, 2015 17:29
screenshot taking and uploading tool
#!/usr/bin/env bash
# scrotshooter - screenshot taking and upload tool
# requires: curl, scrot
mydir="$HOME/Pictures/Screenshots"
shotfile=$(echo "screenshot-`date +'%Y-%m-%d_%H-%M-%S'`.png")
fileloc="$mydir/$shotfile"
while getopts ":d:" flags; do
case $flags in
@KittyKatt
KittyKatt / 4cha
Last active December 18, 2015 21:29
4chan Thread Archiver
#!/usr/bin/env bash
# 4chan Thread Archiver
# requires: wget
# Settings
archivefolder=/srv/http/kittykatt.us/served.kittykatt.us/projects/4chanarchive
archivesite='http://served.kittykatt.us/projects/4chanarchive'
thread="$1"
threadreal=$(echo "$thread" | sed 's/http:\/\///')
@KittyKatt
KittyKatt / mpd-np
Created June 24, 2013 02:38
MPD Now Playing script for IRC
#!/usr/bin/env bash
# mpd now playing script for IRC
# requires: bash 4.0+
bold="\x02"
color1="\x032"
color2="\x030"
color3="\x035"
color4="\x033"
@KittyKatt
KittyKatt / pac
Created July 7, 2013 07:15
pacman wrapper script for kori (ayakashi)
#!/usr/bin/env bash
# Pacman alias wrapper for kori
# Requires: pacman
if [[ -n "$1" ]]; then
case "$1" in
"install")
shift 1
if [[ -n "$1" ]]; then
sudo pacman -S $@
@KittyKatt
KittyKatt / json_awk
Created September 23, 2013 00:32
JSON parser in BASH using awk.
#!/usr/bin/env bash
function json_awk() {
_mykey="$1"
_mysearch="$2"
echo "$_mysearch" 2>/dev/null | awk -F"\",\"" -v k="$_mykey" '{
gsub(/{|}/,"")
for(i=1;i<=NF;i++){
if ( $i ~ k ){
# base our image on latest node
FROM node:latest
# create the bot directory
RUN mkdir -p /usr/src/bot
RUN mkdir -p /usr/src/bot/img
WORKDIR /usr/src/bot
# copy package.json and install dependencies
COPY package.json /usr/src/bot