Skip to content

Instantly share code, notes, and snippets.

@ohhdemgirls
ohhdemgirls / ffmpeg-html5
Created January 14, 2017 00:49 — forked from yellowled/ffmpeg-html5
Convert videos to proper formats for HTML5 video on Linux shell using ffmpeg. Will probably convert this to a bash script later, but for the time being, here's some examples. Not sure there have actually sensible dimensions and bitrates for web video.
# 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
#!/bin/bash
# eroshare.com/igowild.com downloader
# Usage ./eroshare.sh https://eroshare.com/jhocqntr
for LINK in "$@" ;
# download albums & videos
do if [ $(echo "$LINK" | grep "eroshare.com/[A-Za-z0-9]\|igowild.com/[A-Za-z0-9]\|") ]
then URL=$(echo "$LINK" | cut -d'/' -f4) ;
TITLE=$(curl -Ls "$LINK" | grep "<title>.*</title>\|twitter:title\|og:title" | cut -d'"' -f4 | cut -d'>' -f2 | cut -d'<' -f1 | uniq | paste -sd ' ' | sed 's|^|-|') ;
USER=$(curl -Ls "$LINK" | grep -i "avatar avatar-small" | cut -d'"' -f2 | sed "s|\/u\/||g;s|\ ||g") ;
#!/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'
#!/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')
@ohhdemgirls
ohhdemgirls / r2db.py
Last active August 29, 2015 14:15 — forked from nikolak/r2db.py
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
@ohhdemgirls
ohhdemgirls / pwget
Last active August 29, 2015 14:13 — forked from ctrochalakis/gist:285136
Parallel WGET
#!/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.
#!/usr/bin/python
# ------------------------------
# Script to parse reddit json
# Usage $cat *.json | redditJSON.py
# ------------------------------
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import json
@ohhdemgirls
ohhdemgirls / bam.sh
Last active August 29, 2015 13:56
Videobam.com downloader
#!/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
#!/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
import random
import subprocess
import urllib.request
import os
import sys
import requests
import threading
import timeit
from multiprocessing.pool import ThreadPool