Skip to content

Instantly share code, notes, and snippets.

View stanwu's full-sized avatar

Stan Ht. Wu stanwu

View GitHub Profile
alias updatedb="updatedb --localpaths='/cygdrive/c'"
alias df="df -h"
alias du="du -h"
alias locate="locate -i"
@stanwu
stanwu / index.php
Created February 7, 2014 09:28
test past gist from sublime
<li><a href="http://www.rackspace.com" target='new'>Rackspace</a>
<li><a href="http://www.softlayer.com" target='new'>Softlayer</a>
<li><a href="http://www.linode.com" target='new'><span>Linode</span></a></li>
<li><a href='http://stanwu.us/rd/?url=123systems' target='new'><span>123Systems</span></a></li>
<li><a href='http://stanwu.us/rd/?url=securedragon' target='new'><span>SecureDragon</span></a></li>
@stanwu
stanwu / ssl-tar.sh
Created May 18, 2014 10:35
ssl-tar.sh
#!/bin/bash
if [ -z "$1" ]; then
echo "usage: $0 [folder]"
exit 1
fi
if [ -d "$1" ]; then
if [ -f "$1.tgz.ssl" ]; then
echo "$1.tgz.ssl already exist!"
#!/bin/bash
if [ -z "$1" ]; then
echo "usage: $0 [folder]"
exit 1
fi
if [ -f "$1" ]; then
openssl enc -d -aes256 -in "$1" | tar xvzf -
else
@stanwu
stanwu / ssl-test.sh
Created May 18, 2014 10:43
ssl-test.sh
#!/bin/bash
if [ -z "$1" ]; then
echo "usage: $0 [folder]"
exit 1
fi
if [ -f "$1" ]; then
openssl enc -d -aes256 -in "$1" | tar tvzf -
[ $? == 0 ] && echo "$1 test OK!"
@stanwu
stanwu / ssl-test-split.sh
Created May 18, 2014 13:06
ssl-test-split.sh
#!/bin/sh
if [ -z "$1" ]; then
echo "usage: $0 [folder]"
exit 1
fi
if [ -f "$1.tgz.ssl-aa" ]; then
cat $1.tgz.ssl-* | openssl enc -d -aes256 | tar tvzf -
echo "Ret=$?"
@stanwu
stanwu / ssl-tar-1g.sh
Created May 18, 2014 13:06
ssl-tar-1g.sh
#!/bin/sh
if [ -z "$1" ]; then
echo "usage: $0 [folder]"
exit 1
fi
if [ -d "$1" ]; then
if [ -f "$1.tgz.ssl-aa" ]; then
echo "$1.tgz.ssl-xx already exist!"

Syntax Highlighting

In your fenced block, add an optional language identifier and we'll run it through syntax highlighting (Support Languages).

ruby:

require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html

test

backup.sh:

#!/bin/bash
myDate=`date +%Y-%m-%d`myFile="$myDate-kasercorp.com.tgz"
cd /backup/tar cvzf $myFile /var/www /var/lib/mysql
#
# written by Stan Wu 2015/03/24
#
os=`uname`
if [ "$os" == "Darwin" ]; then
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ruby
gcc -v
if [ $? -gt 0 ]; then