Skip to content

Instantly share code, notes, and snippets.

@ifnull
ifnull / mobile.conf
Created April 2, 2013 17:56
RewriteCond for mobile detection and RewriteRule
# http://detectmobilebrowsers.com/
RewriteCond %{HTTP_USER_AGENT} (android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|netfront|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ (ce|phone)|xda|xiino [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a\ wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r\ |s\ )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1\ u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(\ i|ip)|hs\-c|ht(c(\-|\ |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(\ |\-|\/)|ibro|idea|ig01|ikom|im1k|i
@ifnull
ifnull / gist:5377214
Last active December 16, 2015 04:29
Set user and group for share folder. UNDOCUMENTED
config.vm.share_folder "www", "/var/www", "../", :owner => "apache", :group => "www-data"
# References
# https://github.com/mitchellh/vagrant/issues/897
# http://docs-v1.vagrantup.com/v1/docs/config/vm/share_folder.html
@ifnull
ifnull / phish-f--cker.sh
Created April 24, 2013 07:22
Someone try to phish your Facebook account? Want to fill their database with junk logins? Here you go...
#!/bin/bash
URL="http://www.some.phishing.site.com/login.php?login_attempt=1" # Put the POST URL here.
count=1
echo "Press [CTRL+C] to stop.."
while :
do
USERNAME=`echo "$(uuidgen)" | tr '[:upper:]' '[:lower:]'`
DOMAIN=`echo "$(uuidgen)" | tr '[:upper:]' '[:lower:]'`
PASSWORD=`echo "$(uuidgen)" | tr '[:upper:]' '[:lower:]'`
@ifnull
ifnull / gist:5478609
Last active December 16, 2015 18:30
Get the Facebook ID for a city page. This is useful when using the API to create events automatically from a CMS. You can test this using Graph API Explorer.
https://graph.facebook.com/search?fields=&q=costa mesa,ca&type=page&category=city&limit=1
@ifnull
ifnull / jpg2mp4.sh
Created May 3, 2013 07:37
Convert a series of JPGs to and MP4
# -r The first one. Desired length of video (i.e. 7 is 7 seconds).
# -start_number Starting index (i.e. foobar0099.jpg)
ffmpeg \
-f image2 \
-r 7 \
-start_number 99 \
-i ./images/foobar%04d.jpg \
-c:v libx264 \
-r 30 \
@ifnull
ifnull / gist:5589970
Created May 16, 2013 07:17
Monitor Apache log
tail -F -n10 /var/log/apache2/error.log
@ifnull
ifnull / bfgminer.rb
Last active December 17, 2015 13:29
require 'formula'
class Bfgminer < Formula
url 'http://luke.dashjr.org/programs/bitcoin/files/bfgminer/3.0.2/bfgminer-3.0.2.zip'
sha1 'b7e6498761eb2d9941ee48f83138ef56f0f7e2e3'
head 'https://github.com/luke-jr/bfgminer.git', :using => :git
homepage 'https://github.com/luke-jr/bfgminer'
depends_on 'autoconf' => :build
@ifnull
ifnull / Movieclips.pm
Created May 23, 2013 21:42
FlashVideo::Site:: module for get-flash-videos
package FlashVideo::Site::Movieclips;
use strict;
use FlashVideo::Utils;
sub find_video {
my ($self, $browser, $embed_url) = @_;
my $video_id = ($browser->content =~ /<meta name="video_id" content="([^"]+)"/i)[0];
@ifnull
ifnull / gist:5647460
Created May 25, 2013 00:49
Disable Chrome Security
open -a '/Applications/Google Chrome.app' --args --disable-web-security
C:\Program Files\Chrome\Chrome.exe --disable-web-security
@ifnull
ifnull / gist:5673839
Last active December 17, 2015 21:19
Install get-flash-videos with site module Movieclips.pm
# Install Homebrew
# http://mxcl.github.io/homebrew/
# Install system dependencies
brew install rtmpdump git
# Install perl dependencies
sudo perl -MCPAN -e 'install YAML::Base'
sudo perl -MCPAN -e 'install Crypt::Rijndael'
sudo perl -MCPAN -e 'install WWW::Mechanize'