This file contains 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/node | |
var exec = require('child_process').exec; | |
var connect_status = 'ifconfig | grep tun0 > /dev/null 2>&1 && echo "Connected" || echo "Not connected"'; | |
var show_no_veep = 'zenity --error --text "You are not connected to VPN"' | |
function checkVeep(){ | |
exec(connect_status, function(error, stdout, stderr){ | |
if(stdout.match(/Not/)){ | |
exec(show_no_veep, function(){ | |
setTimeout(checkVeep, 25000); |
This file contains 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
zenity --error --text "This is the contents of the alert" --display :0 | |
response=`zenity --entry --text "Please enter your value" --display :0 |
This file contains 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
(function(msg) { | |
return { | |
"hot":function() { | |
console.log(msg); | |
} | |
}; | |
})('doggy').hot(); | |
This file contains 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
while test $# -gt 0 | |
do | |
case "$1" in | |
--opt1) echo "option 1" | |
;; | |
--opt2) echo "option 2" | |
;; | |
--*) echo "bad option $1" | |
;; | |
*) echo "argument $1" |
This file contains 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
if [ "$ENV" == "" ] | |
then | |
echo "ENV must be set" | |
exit | |
else | |
echo "ENV is $ENV" | |
fi |
This file contains 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
# Clone project | |
git clone https://github.com/mhuckaby/retro-post.git rp-eh-1 | |
# Track remote branch | |
git checkout --track origin/ehcache | |
# Branch the remote branch locally | |
git branch ehcache-1 | |
# Push new local branch to remote |
This file contains 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
# This script compiles nginx + echo module on Ubuntu | |
# Tested on Ubuntu 10.04 LTS (Lucid Lynx), 32 bit | |
# Resources: | |
# - http://extralogical.net/articles/howto-compile-nginx-passenger.html | |
# - http://wiki.nginx.org/InstallOptions | |
# - http://wiki.nginx.org/CommandLine | |
# - http://superuser.com/questions/336275/find-out-if-user-name-exists - check if the user exists | |
# Tips: |
This file contains 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
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
This file contains 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
public class Gist { | |
public static void main(String[] args) throws Exception { | |
final String tmpPath = System.getProperty("java.io.tmpdir"); | |
System.out.println(tmpPath); | |
final java.io.File dir = new java.io.File(tmpPath); |
This file contains 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
ps -ef | grep org.apache.catalina.startup.Bootstrap | grep -v "grep" | awk '{print $2}' |
OlderNewer