Skip to content

Instantly share code, notes, and snippets.

View projectivemotion's full-sized avatar
👽
let's work

Amado Martinez projectivemotion

👽
let's work
View GitHub Profile
#learnmysql_init will pull mysql and phpmyadmin/phpmyadmin images from the registry
function learnmysql_intit {
#Change supersecretpassword to work in not trusted network.
docker run --name mysql -e MYSQL_ROOT_PASSWORD="supersecretpassword" -d mysql
docker run --name phpmyadmin -d --link mysql:db -p 8080:80 phpmyadmin/phpmyadmin
}
function learnmysql_stop {
docker stop mysql phpmyadmin
}
@ironman9967
ironman9967 / addon.cc
Last active August 31, 2016 13:50
node-addon
#include <node.h>
using namespace v8;
struct point {
int x;
int y;
};
void pointerFunction(point* p) {
@etiennetremel
etiennetremel / update-wordpress.sh
Last active December 24, 2016 06:26
Update WordPress folder with the latest version, backup files and SQL Usage: sh update-wordpress "wordpress-directory-to-update"
#!/bin/bash
# Update WordPress folder with the latest version, backup files and SQL
# Usage: sh update-wordpress "wordpress-directory-to-update"
# Define variables
BLOG_DIR=/home
BACK_DIR=/home/wp-backups
DATE=`date +%Y%m%d`
INSTANCE=${1}
@philsturgeon
philsturgeon / gearman-workers.sh
Created January 16, 2012 01:53 — forked from fabriziomachado/gearman-workers.sh
/etc/init.d/gearman-workers
#!/bin/bash
#
# /etc/init.d/gearman-workers
### BEGIN INIT INFO
# Provides: gearman-workers
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@reinink
reinink / gist:1467201
Created December 12, 2011 13:41
Example of how to parse HTML document with phpQuery
<?php
// Include the phpQuery library
// Download at http://code.google.com/p/phpquery/
include 'phpQuery.php';
// Load Mike Fisher's player page on thescore.com
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.thescore.com/nhl/player_profiles/859-mike-fisher');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@chrisroos
chrisroos / gpg-import-and-export-instructions.md
Created September 9, 2011 10:49
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@putermancer
putermancer / devscreen.sh
Created September 22, 2010 16:04
development screen session shortcut
#!/bin/bash
# Simple way to create a main development screen in the
# right base directory, or re-attach to the one that is
# already setup.
# I create a symlink or alias 's' so I am always one keystroke
# away from my dev screen.
if screen -ls | grep main > /dev/null