This file contains hidden or 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
#!/usr/bin/env bash | |
# yum | |
sudo yum -y update | |
sudo rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm | |
sudo rm -f /etc/localtime | |
sudo ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Starts up a MongoDB replica set | |
# | |
# There is a lot of documentation about replica sets: | |
# | |
# http://docs.mongodb.org/manual/reference/replica-configuration/ | |
# http://docs.mongodb.org/manual/administration/replica-sets/ | |
# | |
# To read data from a SECONDARY, when in the client, use: |
This file contains hidden or 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
Binary number system | |
https://www.youtube.com/watch?v=ry1hpm1GXVI | |
Why binary? | |
https://www.youtube.com/watch?v=1sWCBgGALXE | |
8-bits = 1 byte | |
8-bits (aka 1 bytes) is amount needed for 1 of the 255 asci charactors | |
2^7 | 2^6|2^5 |2^4 |2^3|2^2|2^1|2^0 | |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 (max number = 255) |
This file contains hidden or 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
#!/bin/sh | |
# https://www.digitalocean.com/community/tutorials/lemp-stack-monitoring-with-monit-on-ubuntu-14-04 | |
sudo yum install -y pam-devel openssl-devel | |
cd /usr/local/src | |
wget http://mmonit.com/monit/dist/monit-5.11.tar.gz | |
sudo wget http://mmonit.com/monit/dist/monit-5.11.tar.gz | |
sudo tar -zxvf monit-5.11.tar.gz | |
cd monit-5.11 |
This file contains hidden or 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
#!/bin/sh | |
# @notes | |
# | |
# If you have a moderately sized database ( 2gb dumps) | |
# make sure to update your mysql conf to allow larger packets | |
# for dump. Below are some suggested my.cnf settings | |
# | |
# If you have a fairly large db, mysqldump is not | |
# recommended. Instead try something like |
This file contains hidden or 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
var series = [ | |
function( callback ){ | |
callback( 'bob', 12); | |
return 1; | |
}, | |
function ( callback, person, age ) { | |
console.log( person,age); | |
callback( 'moew' ); | |
return 12; |
This file contains hidden or 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
SELECT email, | |
COUNT(email) AS NumOccurrences | |
FROM users | |
GROUP BY email | |
HAVING ( COUNT(email) > 1 ) |
This file contains hidden or 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
<div class="col-half"> | |
<div class="input-block"> | |
<label>Subject*</label> | |
[text* c_subject] | |
</div> | |
<div class="input-block"> | |
<label>Company</label> | |
[text c_company] | |
</div> | |
<div class="input-block"> |
This file contains hidden or 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
# Below are some good links for reference | |
# https://gist.github.com/c4milo/940909 | |
# https://www.exratione.com/2013/02/nodejs-and-forever-as-a-service-simple-upstart-and-init-scripts-for-ubuntu/ | |
# http://upstart.ubuntu.com/cookbook/ | |
# http://serverfault.com/questions/321375/passing-arguments-to-upstart-job | |
author "Andres Hermosilla <[email protected]>" | |
description "Update Example Config" | |
# Set variables | |
env upstart_name=template |
This file contains hidden or 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
DELETE pm | |
FROM wp_postmeta pm | |
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id | |
WHERE wp.ID IS NULL |