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
# webm | |
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm | |
# mp4 | |
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4 | |
# ogg (if you want to support older Firefox) | |
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend |
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 ruby | |
# gem install tumblr_client | |
# use 'tumblr' command to generate security credentials | |
# fill in security info from the generated file at ~/.tumblr | |
# fill in the source directory and destintion directory | |
# fill in blogname | |
# script will upload a file then move it to the destination directory | |
require 'rubygems' | |
require 'tumblr_client' |
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 | |
#Usage: ./imgrush.sh $(cat cats.txt) | |
echo -e "\e[91mImgrush all the cats!!!\e[0m" | |
for f in "$@"; do | |
echo -ne "\e[34mUploading:\e[0m" $f | |
url="https://imgrush.com/api/upload/url" | |
out=$(curl -s -F "url=$f" "$url") | |
hash=$(echo $out |sed -nre 's#.*"hash": "([^"]+)".*#\1#p') |
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
import sqlite3 | |
import time | |
import json | |
import urllib2 | |
def get_submissions(): | |
url="http://www.reddit.com/r/all/new/.json" #URL of the page that we want to fetch | |
headers = { 'User-Agent' : 'fetching new submissions script' } # our script "identifier" | |
req = urllib2.Request(url, None, headers) # We create new request here to open the url with above set headers | |
data = urllib2.urlopen(req).read() # Open url and make data variable equal whatever we get |
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 python | |
# | |
# Copyright (c) 2010 Giorgos Keramidas. | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: | |
# 1. Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. |
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/python | |
# ------------------------------ | |
# Script to parse reddit json | |
# Usage $cat *.json | redditJSON.py | |
# ------------------------------ | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') | |
import json |
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 | |
# USAGE ./bam.sh URL | |
url=$1 | |
out=$(echo $url |sed 's/^.\{,20\}//') | |
get=$(curl -s $url |grep ',"url":"' |sed -e 's/^.\{,241\}//' -e 's/\"','"auto.*//' -e 's/\\//g') | |
wget -c $get -O $out.mp4 |
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
import random | |
import subprocess | |
import urllib.request | |
import os | |
import sys | |
import requests | |
import threading | |
import timeit | |
from multiprocessing.pool import ThreadPool |