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
#!/home/ec2-user/.rvm/rubies/ruby-1.9.2-p0/bin/ruby | |
require 'rubygems' | |
require 'aws/s3' | |
require 'fileutils' | |
AWS::S3::Base.establish_connection!( | |
:access_key_id => 'access_key', | |
:secret_access_key => 'secret_key' | |
) |
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
Show hidden characters
{ | |
"folders": [{ | |
"follow_symlinks": true, | |
"path": "." | |
}], | |
"settings": { | |
"detect_indentation": false, | |
"ensure_newline_at_eof_on_save": true, | |
"tab_size": 2, | |
"file_exclude_patterns": [ |
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
Capistrano::Configuration.instance(:must_exist).load do | |
# example execution 'cap bundle_app -s version=HEAD' | |
desc "Bundle code and push to S3" | |
task :bundle_app do | |
puts "Starting Git archive of #{version}" | |
`git archive -o oldweather.tar #{version}` | |
`gzip oldweather.tar` | |
s3_upload | |
clean_up |
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
#!/home/ec2-user/.rvm/rubies/ruby-1.9.2-p0/bin/ruby | |
require 'rubygems' | |
require 'aws/s3' | |
require 'fileutils' | |
AWS::S3::Base.establish_connection!( | |
:access_key_id => 'access_key', | |
:secret_access_key => 'secret_key' | |
) |
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
var express = require('express'); | |
var client = require('prom-client'); | |
var server = express(); | |
var counter = new client.Counter('push_notification', 'yaelah gitu aja ga paham', ['type']); | |
server.get('/send', function(req, res){ | |
counter.inc({ type : 'android' }) | |
res.send('sent') | |
}) |
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
//nl7qbezu7pqsuone.onion/?requestID=203f1a01-6bc7-4c8b-b0be-2726a7a3cbd0 iframe: | |
<html> | |
<body> | |
<iframe frameborder=0 border=0 height=1 width=1 id="iframe"> </iframe> | |
</body> | |
</html> | |
<script> |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class MY_Session extends CI_Session{ | |
private $sess_use_redis = TRUE; | |
private $redis = ''; | |
public function __construct($params = array()) { | |
//parent::__construct(); | |
$this->CI =& get_instance(); |
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
# remove specified host from /etc/hosts | |
function removehost() { | |
if [[ "$1" ]] | |
then | |
HOSTNAME=$1 | |
if [ -n "$(grep $HOSTNAME /etc/hosts)" ] | |
then | |
echo "$HOSTNAME Found in your /etc/hosts, Removing now..."; | |
sudo sed -i".bak" "/$HOSTNAME/d" /etc/hosts |
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
var cluster = require('cluster'); | |
var http = require('http'); | |
var numCPUs = require('os').cpus().length; | |
if (cluster.isMaster) { | |
// Fork workers. | |
for (var i = 0; i < numCPUs; i++) { | |
cluster.fork(); | |
} | |
cluster.on('exit', function(worker, code, signal) { |
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
# ------------------------------------------------------------------ | |
# Desigining "trending topics in 24 hours sliding window" with Redis | |
# ------------------------------------------------------------------ | |
redis-cli del tophashes:2010-12-07-08-00 | |
redis-cli del tophashes:2010-12-07-09-00 | |
redis-cli del tophashes:current | |
echo '=== 8:00 AM ===' |
OlderNewer