Lionel Young lionelyoung

View add_mx_google.py
1 2 3 4 5 6 7 8 9 10
import xmlrpclib, webbrowser
 
# EDIT: webfaction credentials
username = "USERNAME"
password = "PASSWORD"
 
# EDIT: email address domain (must exist in control panel)
mail_domain = "example.com"
 
# EDIT: domain on which you want to access gmail (must exist in control panel)
View dualmonitor.sh
1 2 3 4 5 6 7 8 9 10
# If an external monitor is connected, place it with xrandr
# External output may be "VGA" "VGA-0" "VGA1" or "DVI-0" or "TMDS-1"
EXTERNAL_OUTPUT="VGA1"
INTERNAL_OUTPUT="LVDS1"
# EXTERNAL_LOCATION may be one of: left, right, above, or below
EXTERNAL_LOCATION="right"
case "$EXTERNAL_LOCATION" in
left|LEFT)
View manage_rtorrent_queue.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
# Moves torrents from the queue directory into the watch directory.
#
# Example usage:
# * manage_rtorrent_queue.sh movies 3
# * manage_rtorrent_queue.sh software 1
 
# Check for proper number of command line args.
 
EXPECTED_ARGS=2
View rrbayesian.py
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env python
#http://engineering.richrelevance.com/bayesian-ab-tests/
from numpy.random import beta as beta_dist
import numpy as np
N_samp = 10000 # number of samples to draw
clicks_A = 450 # insert your own data here
views_A = 56000
clicks_B = 345 # ditto
views_B = 49000
alpha = 1
View replace_with_shorturl.sh
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/bash
# Replace all long urls in MYFILE file with short urls using API from:
# https://github.com/briancray/PHP-URL-Shortener
 
MYFILE=~/somefile
DOMAIN=domain.com
URLSERVICE="http://$DOMAIN/shorten.php?longurl="
 
# Get URL from todo list
URLLIST=$(grep "http://" $MYFILE | sed 's/.*http:\/\/\([^ ]*\).*/http:\/\/\1/')
View fix_timestamp_galaxy_note
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env bash
cd ../src || exit 1
for f in 20*_*.*; do
TIMESTAMP=${f%.*} # Remove extension
TIMESTAMP=`echo $TIMESTAMP | sed 's/_001$//'` # Remove _001 from *.3gp files
TIMESTAMP=`echo $TIMESTAMP | awk 'sub("..$", "")'` # Remove last two characters (seconds in the timestamp)
TIMESTAMP=`echo $TIMESTAMP | sed 's/_//'`
echo Setting $f to $TIMESTAMP
touch -mt $TIMESTAMP $f
touch -t $TIMESTAMP $f
View all
1 2 3 4 5 6 7 8 9 10
'base_shipping_hidden_tax_amount'
'base_currency_code'
'subtotal_incl_tax'
'shipping_method'
'billing_name'
'subtotal_canceled'
'base_discount_refunded'
'base_shipping_refunded'
'total_paid'
'base_adjustment_negative'
View adwords_kw.r
1 2 3 4 5 6 7 8
kw = read.csv("~/Downloads/keywords.csv", skip=1)
kw.conv <- subset(kw, Keyword.state == "enabled" & Conv...1.per.click. > 0)
View(kw.conv)
 
convs <- unlist(c(kw.conv["Conv...1.per.click."]))
clicks <- unlist(c(kw.conv["Clicks"]))
 
prop.test(convs,clicks,alternative=c("greater"))
View gist:3735310
1 2 3 4 5 6 7 8 9
func xmlrpc(url string, methodName string, args ...string) string {
// Marshal XML
type Param struct {
Entry string `xml:"value>string"`
}
type methodCall struct {
XMLName xml.Name `xml:"methodCall"`
MethodName string `xml:"methodName"`
Params []Param `xml:"params>param"`
View gist:755145
1 2 3 4 5 6
ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 essid <ESSID>
iwconfig wlan0 key <TENDIGITPASSWORD>
ifconfig wlan0 up
dhclient wlan0
Something went wrong with that request. Please try again.