Skip to content

Instantly share code, notes, and snippets.

@013
013 / gist:2874931
Created June 5, 2012 13:19
Perl-Youtube-Downloader
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
my $url = $ARGV[0];
die"URL Needed\n" unless defined $url;
$url =~ /[\?&]v=(.{11})/g;
my $video_id = $1;
my $info_url = "http://www.youtube.com/get_video_info?video_id=" . $video_id;
my $content = get $info_url;
@013
013 / imgur.py
Created November 25, 2012 19:14
Random imgur downloader
#!/usr/bin/python
import sys, urllib, urllib2, random, string
def random_image():
chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
rand_img = ''.join(random.choice(chars) for x in range(5))
base = 'http://i.imgur.com/%s.png' % rand_img
return base
@013
013 / xor.py
Created December 2, 2012 00:19
XOR Encrypter
#!/usr/bin/python
# -*- coding: UTF-8 -*-
string = "something something something"
key = "cheese"
def crypt(string, key):
data = ''
for i in range(len(string)):
@013
013 / scrape.py
Created April 13, 2013 19:46
Generate magnet links and a couple other things
#!/usr/bin/python
import re, sys, bencode, binascii, urllib, hashlib
tracker = "http://swiftler.com:6969/scrape?info_hash="
def usage():
print """
Usage: ./scrape [OPTION] [FILE/HASH]
-h Use a hash to get seeders, leechers and completed downloads
Xft.autohint: 0
Xft.antialias: 1
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.dpi: 96
Xft.rgba: rgb
Xft.lcdfilter: lcddefault
URxvt*termName:rxvt-256color
URxvt*transparent: true
$(function() {
var scntDiv = $('#p_scents');
var i = $('#p_scents p').size() + 1;
$('body').on('click', '#addScnt', function() {
$('<p><label for="p_scnts"><input type="text" id="p_scnt" name="p_scnt_' + i +'" value="" /></label> <a href="#" id="remScnt">Remove</a></p>').appendTo(scntDiv);
i++;
return false;
});
@013
013 / removeprofile.bat
Created July 24, 2013 15:05
Remove a profile from Windows registry
@echo off
set username=
AT > NUL
IF %ERRORLEVEL% EQU 0 (
goto start
) ELSE (
ECHO This scripts needs to be run with Administrator privileges
goto end
)
@013
013 / mig.bat
Last active December 21, 2015 01:48
REM Do not change these until you have ran the script for a first time
set currentlogin=ral
set olduser=esguser
set newuser=CORP.USER
if NOT "%olduser%" == "esguser" (GOTO scan)
mkdir C:\m
xcopy \\srv-mir-fp02\ral$\1\* C:\m\ /E
REM AV Installation --------------------------------------------------------------------------------
<?php
$pages = 20;
$current_page = (int) $_GET['p'];
if ($current_page > 3) {
echo "1 ... ";
}
for($i=$current_page-3;$i<=$current_page+3;$i++) {
@013
013 / conShuffle.py
Last active October 1, 2016 20:04
Sky Router SR102 Connect/Disconnect Script
#!/usr/bin/python
import base64
import requests
skyrouter = "10.0.0.2"
userpass = "admin:sky"
# http://en.wikipedia.org/wiki/Basic_access_authentication#Client_side
b64userpass = base64.b64encode(userpass)