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
git config --global user.name "David Renne" | |
git config --global user.email david_renne@yahoo.com | |
git config --global push.default current |
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
tcpdump -s 100 -n -X host rrcs-71-40-167-210.se.biz.rr.com and port 80 |
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
Testing with Internet Explorer / NAT Port Forwarding | |
It is possible to connect to the rails server inside the linux virtual machine from the host computer. | |
This allows testing the development site with Internet Explorer. | |
Note: This assumes the CentOS vm is running in NAT networking mode. | |
1) Find out what ip address the vm is using. Open a terminal in the vm and run /sbin/ifconfig | |
For this example the eth0 inet addr is 192.168.179.128. | |
2) Open System > Administration > Security Level and Firewall. (Enter the root password if necessary.) | |
3) On the "Firewall Options" tab, open the "Other ports" section and add ports 3000 and 8080. | |
4) Click ok and confirm the changes. | |
2) On the windows host, open C:\ProgramData\VMware\vmnetnat.conf with a text editor. |
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
if (window.location.hostname == 'localhost') { | |
$('[id]').each(function(){ | |
var ids = $('[id="'+this.id+'"]'); | |
if(ids.length>1 && ids[0]==this) | |
alert('Dev Err: Multiple IDs #'+this.id); | |
}); | |
} |
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
git config --global user.email "davidrenne@gmail.com" | |
git config --global user.name "David Renne" | |
git config --global core.editor "vim" | |
git config --global core.fileMode false | |
git config --global push.default current | |
git config --global alias.up 'pull --rebase --autostash' | |
git config --global alias.cp 'cherry-pick' | |
git config --global alias.s 'status' | |
git config --global alias.co 'checkout' | |
git config --global alias.c 'commit -a' |
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
from django.db import connection | |
for query in connection.queries : | |
print "\033[1;31m[%s]\033[0m \033[1m%s\033[0m" % (query['time'], | |
" ".join(query['sql'].split())) |
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
IF column A is an ID, and column C is a URL. Request the URL and get the single image on the page. Then create a new CSV off of this with the source of the image | |
=CONCATENATE("random_shit=`tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1`;wget -O /tmp/html$random_shit ",C2655,"; grep '<img' /tmp/html$random_shit | grep -v 'beach-logo' | grep -oP 'src=""([^""]*)' | cut -b 6- > /tmp/html_$random_shit; value=`cat /tmp/html_$random_shit`; echo """,A2655,",$value"" >> /tmp/all; rm /tmp/html_$random_shit; rm /tmp/html$random_shit;") |
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
#-*-coding:utf-8-*- | |
# This script requires an existing SQLite DB for output from Facebook Graph API, it should be stored in the same folder of this script if you do not specify the path to DB | |
""" | |
Facebook Graph API Explorer (http://developers.facebook.com/tools/explorer) | |
GO HERE FOR DEFINITIONS OF VARIABLES RETURNED BY API: | |
https://developers.facebook.com/docs/reference/api/post/ | |
JSON Viewer (http://jsonviewer.stack.hu/) |
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
#Repeat these scripts if you want to do branch management across similar repos in the same project obviously change your path /usr/local/repository & /usr/local/repository2 and copy more as needed | |
alias switch_branch='echo -n "Git branch name?>" && read response && cd /usr/local/repository && git fetch origin && git checkout $response && cd /usr/local/repository2 && git fetch origin && git checkout $response' | |
alias create_branch='echo -n "Git branch name?>" && read response && cd /usr/local/repository/ && git branch $response && git push origin $response && git checkout $response && cd /usr/local/repository2/ && git branch $response && git push origin $response && git checkout $response' | |
alias delete_branch='echo -n "Git branch name?>" && read response && cd /usr/local/repository/ && git checkout $response && git checkout master && git branch -d $response && git push origin :$response && cd /usr/local/repository2/ && git checkout $response && git checkout master && git branch -d $response && git push origi |
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
sudo apt-get install mailutils | |
sudo apt-get install libsasl2-modules | |
sudo echo "[smtp.mandrillapp.com] YOURUSER:YOURPASSWORD" > /etc/postfix/sasl_passwd | |
sudo chmod 600 /etc/postfix/sasl_passwd | |
sudo postmap /etc/postfix/sasl_passwd | |
sudo vim /etc/postfix/main.cf | |
delete relay host line |