This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Quickly delete all traces of a user from the database and filesystem | |
# usage: ./deluser.sh username | |
USER=$1 | |
USERID=`sqlite3 ../database.db "select id from users where username = '${USER}'"` | |
for table in albums comments images posts; do | |
sqlite3 ../database.db "delete from ${table} where userid = ${USERID}" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
module Try | |
def try(method, args = []) | |
if self.respond_to? method | |
self.send method, *args | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A small script to convert all AVI files in a folder to mp4 h264 | |
# You can either use HandbrakeCLI or ffmpeg. | |
# ffmpeg requires to be compiled with libx264 which is not default in debian based distributions | |
# | |
# To use HandbrakeCLI do not forget to install the packages! | |
# For Linux Mint I had to do the following to get HandbrakeCLI running: | |
# sudo add-apt-repository ppa:stebbins/handbrake-snapshots | |
# sudo apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Python2 | |
execfile("./filename") | |
#Python3 | |
exec(open("./filename").read()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#This is free and unencumbered software released into the public domain. | |
#Because this script needs root to do some things, excessive amounts of | |
#checking have been done to terminate the script if anything fails. | |
#Read all instructions very carefully. When it asks to type "yes", it must be | |
#all uppercase or it will fail. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "file name" | |
read name | |
#both the 'start' and 'end' variables should be time stamps of the format hh:mm:ss | |
echo "start of clip" | |
read start | |
echo "end of clip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Upload text/images to clbin.com from the command line | |
# License: ISC http://www.isc.org/downloads/software-support-policy/isc-license/ | |
clip() { | |
if command -v xclip &> /dev/null; then | |
xclip -selection clip <<< "$@" | |
elif command -v xsel &> /dev/null; then | |
xsel -b -i <<< "$@" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hostup() { | |
if (( $# != 1 )); then | |
echo "Usage: hostup HOSTNAME" | |
else | |
until $(which ping) -W1 -c1 ${1} > /dev/null; do sleep 5; done && $(which say) "${1} is up" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# # keepalive # | |
# | |
# Keeps your processes running - handy quick-restart for services. | |
# | |
# USAGE: | |
# | |
# Run a server with: | |
# |
OlderNewer