Skip to content

Instantly share code, notes, and snippets.

alias cp='rsync -p --progress'
# copy with progressbar
#!/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/
set -euf
clip() {
if command -v xclip &> /dev/null; then
xclip -selection clip <<< "$@"
elif command -v xsel &> /dev/null; then
xsel -b -i <<< "$@"
fi
@jadedgnome
jadedgnome / clbin
Last active August 29, 2015 14:09 — forked from makefu/clbin
#!/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
}
@jadedgnome
jadedgnome / gist:53c55ed450bad9240231
Last active August 29, 2015 14:05
rename the ouputted html file from redditPostArchiver with the reddit thread title. https://github.com/sJohnsonStoever/redditPostArchiver
ran(){
TITLE=$(curl --head -ILs http://redd.it/$1 |grep -i Location |grep -v /tb/| cut -d '/' -f 8)
SUBREDDIT=$(curl --head -ILs http://redd.it/$1 |grep -i location |grep -v /tb/| cut -d '/' -f 5)
python ~/bin/redditPostArchiver/archiver.py $1
mv $1.html $1_\[$SUBREDDIT\]_$TITLE.html
echo $PWD/$1_\[$SUBREDDIT\]_$TITLE.html
}
@jadedgnome
jadedgnome / utox-keepalive.sh
Created August 9, 2014 19:06
script to stop uTox from dying when I close it
#!/bin/bash
# ORIGINALLY FROM : http://pastebin.mozilla.org/5879198
# http://www.reddit.com/r/linux/comments/2czjru/skype_for_linux_redesign_is_ugly_but_functional/cjkl0cl
for i in `wmctrl -l | grep uTox | awk '{ print $1 }'`
do
wmctrl -i -r $i -b remove,hidden,skip_taskbar
done
@jadedgnome
jadedgnome / imagebam-dl.sh
Created August 9, 2014 15:33
download imagebam galleries
#!/bin/bash/
# usage : ./imagebam-dl.sh <URL>
for i in `curl -s "$1" |grep 'a href'| egrep -o "http.*" |grep /image/ | cut -d "'" -f1 | cut -d '"' -f1` ; do FOLDER=$(echo $1 | cut -d '/' -f 5) ; curl -s "$i" | grep 'img id' | grep -o "http.*" | cut -d '"' -f1 | xargs wget -nv -nc -P imagebam_"$FOLDER"/ ; done
#!/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"
# Add multimedia source
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install deb-multimedia-keyring # if this aborts, try again
apt-get update
# Go to local source directory
cd /usr/local/src
@jadedgnome
jadedgnome / retry bash function
Created July 27, 2014 12:44
retry bash function, copied from http://redd.it/25tgqg
retry(){
# FROM http://redd.it/25tgqg
local delay=1 n
if ! [[ $1 = *[^0-9]* ]]; then
if (($1 > 0)); then
delay=$1
fi
shift
fi
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update