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
#!/bin/bash | |
gunicorn="/usr/local/bin/gunicorn" | |
prog="dev.maroo.info" | |
PROJECT_HOME="/home/maroo/sites/$prog" | |
pid="/var/lock/$prog" | |
RETVAL=0 | |
start() { |
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
#!/bin/sh | |
# init git repository with "git init" command | |
# minecraft server is running on screen named "mc" | |
# ^M means newline character. type c-V-M in your editor | |
# put this file in your minecraft server's directory | |
# edit crontab with "crontab -e" and add this line: | |
# 0 12 * * * /path/to/minecraft/backup.sh > /dev/null 2>&1 | |
CWD=$(readlink -f `dirname $0`) | |
screen -S mc -X stuff "say [Backup] Server goes readonly in 10 seconds^M" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/bin/bash | |
date=`date "+%Y-%m-%dT%H_%M_%S"` | |
HOME=/YOUR/LOCALHOME | |
SERVER=ID@HOST | |
DIR=backup | |
rsync -azP \ | |
--bwlimit=500 \ | |
--delete \ | |
--delete-excluded \ |
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
<?php | |
class DBStorageStream | |
{ | |
const DDL = <<<EOF | |
CREATE TABLE IF NOT EXISTS `table_dbfs` ( | |
`path` VARCHAR(255) NOT NULL PRIMARY KEY, | |
`data` LONGTEXT, | |
`is_dir` CHAR(1) NOT NULL DEFAULT 'N', | |
`created_at` DATETIME, |
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
const jar = {} | |
function canonical(path) { | |
// remove trailing slash | |
if (path[path.length - 1] === '/') { | |
path = path.substring(0, path.length - 1) | |
} | |
return path | |
} |
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
def xxrange(start, stop, step=1): | |
cur = start | |
while cur < stop: | |
yield cur | |
cur += step | |
locs = reversed([(lat, lng) for lat in xxrange(18.0, 64.0, 0.1) \ | |
for lng in xxrange(-124.0, -66.0, 0.1) if lat is not lng]) | |
for i, loc in enumerate(locs): |
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/osascript | |
on run argv | |
set nr to item 1 of argv | |
set msg to item 2 of argv | |
tell application "System Events" | |
tell application "Messages" to activate | |
end tell | |
tell application "Messages" |
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
from threading import Thread | |
try: | |
import gevent | |
except ImportError: | |
pass | |
def async(fn): | |
def decorator(*args, **kwargs): | |
# if use_greenlet: | |
gevent.spawn(fn, *args, **kwargs) |
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
PING ec2-52-79-42-106.ap-northeast-2.compute.amazonaws.com (52.79.42.106): 56 data bytes | |
64 bytes from 52.79.42.106: icmp_seq=0 ttl=47 time=15.730 ms | |
64 bytes from 52.79.42.106: icmp_seq=1 ttl=47 time=10.836 ms | |
64 bytes from 52.79.42.106: icmp_seq=2 ttl=47 time=10.514 ms | |
64 bytes from 52.79.42.106: icmp_seq=3 ttl=47 time=12.312 ms | |
^C | |
--- ec2-52-79-42-106.ap-northeast-2.compute.amazonaws.com ping statistics --- | |
4 packets transmitted, 4 packets received, 0.0% packet loss | |
round-trip min/avg/max/stddev = 10.514/12.348/15.730/2.067 ms | |
comfuture:~ comfuture$ traceroute ec2-52-79-42-106.ap-northeast-2.compute.amazonaws.com |
NewerOlder