mysqldump -h example.com -u username -p database > file.sql
mysql -u username -p
mysql: source file.sql
Compress a directory into a tar file and maintain permissions
#!/usr/bin/python -tt | |
# MIT licensed by Abraham Williams - http://abrah.am | |
# Pulls your Facebook friends likes and interest and finds who you have the most in common with. | |
import urllib, json, sys | |
graph_url = 'https://graph.facebook.com/' | |
def print_intersect_count(access_token): | |
tally = {} |
// Past into the custom javascript field for your hosted page to use javascript to require phone numbers. | |
var phoneLabel = jQuery('[for=subscription_customer_attributes_phone]'); | |
phoneLabel.text('* Phone') | |
phoneInput = jQuery('#subscription_customer_attributes_phone'); | |
jQuery('#hosted-payment-form').submit(function(){ | |
if(phoneInput.val() == '') { | |
phoneLabel.text('* Phone: cannot be blank.') | |
phoneLabel.css('color', 'red'); | |
phoneInput.click(function(){ |
localStorage.getItem("twttr_anywhere"); | |
// "9436992-QKOV6cNsfeRe9Kagyy4AmQF7WX2efs3rRDgyEy7Bvsfeaf" |
function fillAnywhereTweetBox(url) { | |
twttr.anywhere("1", function (twitter) { | |
var name = getBloggerPageName(); | |
if (name == "the.hackerConundrum") { | |
var content = "Reading \"" + name +"\" - " + url + " by @abraham" | |
} else { | |
var content = "Reading \"" + name +"\" - " + url + " by @abraham" | |
} | |
twitter("#twitter-anywhere-gadget").tweetBox({ | |
counter: 0, |
<?php | |
// Download the latest version of TwitterOAuth from http://github.com/abraham/twitteroauth/downloads | |
// Unpack the download and place the twitteroauth.php and OAuth.php files in the same directory as this file. | |
// Register an application at http://dev.twitter.com/apps and from your new apps page get "my access token". | |
require_once('twitteroauth.php'); | |
$connection = new TwitterOAuth('app consumer key', 'app consumer secret', 'my access token', 'my access token secret'); | |
$status = $connection->post('statuses/update', array('status' => 'text to be tweeted')); |
<dl id="recentComments"></dl> | |
<script type="text/javascript"> | |
function renderComments (json) { | |
var list = document.getElementById("recentComments"); | |
for (var i = 0; i < json.feed.entry.length; ++i) { | |
var entry = json.feed.entry[i]; | |
var dt = document.createElement("DT"); | |
var dd = document.createElement("DD"); | |
var href; |
#!/bin/bash | |
set -e -x | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get update && apt-get upgrade -y | |
tasksel install lamp-server | |
apt-get install git-core | |
echo "Please remember to set the MySQL root password!" |
<?php | |
// Download TwitterOAuth from http://github.com/abraham/twitteroauth. | |
require_once('twitteroauth/twitteroauth.php'); | |
// Get consumer keys from http://dev.twitter.com/apps. | |
$consumer_key = ''; | |
$consumer_secret = ''; | |
$oauth_bridge_code = ''; |
<?php | |
// Download the latest version of http://github.com/abraham/twitteroauth/downloads | |
// Move twitteroauth.php and OAuth.php into this directory. | |
// Register an application at http://dev.twitter.com/apps. | |
// Get a user access token as described in http://dev.twitter.com/pages/oauth_single_token. | |
require_once('twitteroauth.php'); | |
$connection = new TwitterOAuth('app consumer key', 'app consumer secret', 'my access token', 'my access token secret'); | |
$connection->format = 'xml'; | |
$status = $connection->post('statuses/update', array('status' => $message)); |