This file contains hidden or 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 | |
| # Takes the XML file from Dan with UIDs & Profile pic urls and turns it into | |
| # a CSV which we then run through AWK to populate some variables. These then | |
| # pass through to wget to save out the profile in the format UID.EXT | |
| TMP_CSV=/tmp/photos.csv; | |
| PROFILE_FILE=/home/jaymz/documents/vans/vans-usa/data-export/20100811/user_photos.xml; | |
| cat $PROFILE_FILE | sed -e 's/.*uid="\(.*\)" url="\(.*\)".*/\1,\2/g' > $TMP_CSV; |
This file contains hidden or 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
| /* Add a blank column at the start for the id field */ | |
| sed -e 's/\(.*\)/,\1/g' zipcodes.txt > /tmp/codes.txt && mv /tmp/codes.txt zipcodes.txt | |
| /* Table structure for the zipcode data from | |
| http://www.populardata.com/zipcode_database.html */ | |
| BEGIN; | |
| CREATE TABLE `zipsearch_zipcodeentry` ( | |
| `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, | |
| `zipcode` varchar(5) NOT NULL, | |
| `latitude` numeric(9, 6) NOT NULL, |
This file contains hidden or 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 | |
| # Finds all ASP files in the current folder and below and turns the include | |
| # definition into a PHP format one. The converted file is renamed to FILE.php | |
| # and the original file removed. Links in the format 'href="file.asp"' *only* | |
| # are changed to 'href="file.php"'. It then loops through to fix .asp | |
| # links in plain HTML files - this fits my use-case. | |
| for FILE in $(find ./ -name "*.asp") | |
| do |
This file contains hidden or 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
| from django import forms | |
| from django.utils.safestring import mark_safe | |
| from django.conf import settings | |
| class SimpleBBWidget(forms.Textarea): | |
| widget_buttons = u""" | |
| <button class="default" onclick="return surround('[b]','[/b]');"><b>B</b></button> | |
| <button class="default" onclick="return surround('[i]','[/i]');"><i>I</i></button> | |
| <button class="default" onclick="return insert_link();"><u>link</u></button> | |
| """ |
This file contains hidden or 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
| [10:43][wario][jaymz][/var/www/vanscom]$ cat /media/2739ccac-7602-425f-a1dd-52423c54faf0/home/jaymz/scripts/bridge | |
| sudo tunctl -t tap0 -u jaymz | |
| sudo /usr/sbin/brctl addbr br0 | |
| sudo /sbin/ifconfig eth0 0.0.0.0 promisc | |
| sudo /usr/sbin/brctl addif br0 eth0 | |
| sudo /sbin/ifconfig br0 10.10.91.62 | |
| sudo /usr/sbin/brctl addif br0 tap0 | |
| sudo ifconfig tap0 10.10.91.63 up | |
| sudo bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp' | |
| sudo route add -host 10.10.91.62 dev tap0 |
This file contains hidden or 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
| mkdir outfiles && for file in *.swf; do swfextract $file -p `swfextract $file | grep "PNG" | awk -F') ' '{print $2}' | awk -F',' '{print $1}'`; mv output.png outfiles/`basename $file .swf`.png; done |
This file contains hidden or 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/python2.6 | |
| # -*- coding: utf-8 -*- | |
| from xml.dom import minidom | |
| import MySQLdb | |
| import urllib | |
| import time | |
| # Conf for the script follows | |
| PK = 0 |
This file contains hidden or 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
| CREATE USER 'whatever'@'localhost' IDENTIFIED BY 'laPass'; | |
| GRANT ALL ON thedb.* TO 'whatever'@'localhost'; | |
| FLUSH PRIVILEGES; |
This file contains hidden or 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 python2 | |
| import sys | |
| import csv | |
| import ipaddr # via code.google.com/p/ipaddr-py/ | |
| # Reads a file of ip's and spits out decimal start/end points | |
| # http://ipinfodb.com/ip_database.php | |
| # Then load into mysql and select the country you fancy into a file: | |
| # SELECT ip_cidr, country_code FROM ip_group_country WHERE country_code IN ("IT", "DE") INTO OUTFILE '/tmp/eu-ips.txt'; |
This file contains hidden or 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
| get empty winners id's: | |
| SELECT DISTINCT w.winner_id FROM winners w join winner_metas m on w.winner_id=m.winner_id | |
| WHERE (m.meta_name='lastName' AND m.meta_data='') OR (m.meta_name='firstName' AND m.meta_data='') OR (m.meta_name='twitterUserName' AND m.meta_data='') | |
| ORDER BY w.winner_id DESC; | |
| get distinct surnames or twitter users: | |
| SELECT m.meta_data, w.winner_id FROM winners w join winner_metas m on w.winner_id=m.winner_id | |
| WHERE m.meta_name='twitterUserName' OR m.meta_name='lastName' |