start new:
tmux
start new with session name:
tmux new -s myname
| #!/bin/sh | |
| # Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
| # CREATE block and create them in separate commands _after_ all the INSERTs. | |
| # Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
| # The mysqldump file is traversed only once. | |
| # Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
| # Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
| #!/usr/bin/env ruby | |
| # Usage: gitio URL [CODE] | |
| # | |
| # Turns a github.com URL | |
| # into a git.io URL | |
| # | |
| # Copies the git.io URL to your clipboard. | |
| url = ARGV[0] | |
| code = ARGV[1] |
| ; A REPL-based, annotated Seesaw tutorial | |
| ; Please visit https://github.com/daveray/seesaw for more info | |
| ; | |
| ; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers | |
| ; Seesaw's basic features and philosophy, but only scratches the surface | |
| ; of what's available. It only assumes knowledge of Clojure. No Swing or | |
| ; Java experience is needed. | |
| ; | |
| ; This material was first presented in a talk at @CraftsmanGuild in | |
| ; Ann Arbor, MI. |
| use warnings; | |
| use strict; | |
| use Parallel::ForkManager; | |
| use 5.010; | |
| my $pm=new Parallel::ForkManager(50); | |
| use Fcntl qw(:flock SEEK_END); | |
| $pm->run_on_finish(sub{ | |
| my (undef, undef, undef, undef, undef, $res_ref) = @_; |
| <?php | |
| /** | |
| * Image shortcode callback | |
| * | |
| * Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files | |
| * from existing media library entries. Usage: | |
| * [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100"] | |
| * | |
| * @uses image_make_intermediate_size | |
| */ |
| { | |
| "AL": "Alabama", | |
| "AK": "Alaska", | |
| "AS": "American Samoa", | |
| "AZ": "Arizona", | |
| "AR": "Arkansas", | |
| "CA": "California", | |
| "CO": "Colorado", | |
| "CT": "Connecticut", | |
| "DE": "Delaware", |
| # Load Json into a Python object | |
| import urllib2 | |
| import json | |
| req = urllib2.Request("http://localhost:81/sensors/temperature.json") | |
| opener = urllib2.build_opener() | |
| f = opener.open(req) | |
| json = json.loads(f.read()) | |
| print json | |
| print json['unit'] |
| <?php | |
| /** | |
| * Settings | |
| */ | |
| define('API_KEY', $_GET['apikey']); // CloudFlare API key | |
| define('USERNAME', '[email protected]'); // Email address used to login into CloudFlare | |
| define('IP', getCurrentIP()); // Current IP address | |
| echo 'Setting IP address to "' . IP . '"...<br />'; |
##Auto-deploy with php and github on an Ubuntu Amazon EC2 box
Fork from other gist Build auto-deploy with php and git(hub) on an EC2 AMAZON AMI instance - Covers a basic Ubuntu isntall
When ever it says www-data below, it's the user Apache runs under. So if your apache user is called something else, change it to that.
##Install git
sudo aptitude install git-core