Skip to content

Instantly share code, notes, and snippets.

@so0k
so0k / boot2docker-setup.sh
Last active October 8, 2015 04:39
shell script to setup a shared folder with host system & pull some useful tools
#create data directory to contain any data we want persisted
sudo mkdir /var/lib/boot2docker/data && sudo chown docker:staff /var/lib/boot2docker/data
#pull busybox and set it up as a data volume container
docker run -v /var/lib/boot2docker/data:/data --name data-share busybox true
#pull svendowideit/samba and run it with the data-share container
#docker run --rm -v $(which docker):/docker -v /var/run/docker.sock:/docker.sock svendowideit/samba data-share
#make sure the samba share runs next time boot2docker starts
@so0k
so0k / S3-Angular-client.js
Last active October 27, 2015 04:16
S3 upload sample
function getS3Config() {
return Restangular.one(URLS.GET_S3_CONFIG).get();
}
//function with s3Config & angular $upload module injected
$upload.upload({
url: protocol + '://' + s3config.bucket + '/',
method: method.POST,
data: {
'key': funcs[i],
@so0k
so0k / gist:7493968
Created November 16, 2013 00:07
brush.sp
/* B-Rush
*
* DESCRIPTION
* A great plugin where there are 5 Terrorists vs 3 CTs. The Ts must only plant at the "B" bomb site.
* Server admins can configure if players are allowed to buy/use FlashBangs, Smoke Grenades, HE Grenades,
* or AWPS. The number of AWPS allowed is configurable as well.
*
* If the CTs kill all of the Ts, the game continues to the next round, no modifications.
*
* If the Ts kill all of the CTs (or they somehow successfully bomb the B site), then the CTs become Ts
@so0k
so0k / sshcommand.sh
Created January 3, 2016 13:59
sshcommand.sh
#!/bin/bash
set -e
shopt -s nocasematch #For case insensitive string matching, for the first parameter
SELF=`which $0`
case "$1" in
create) # sshcommand create <user> <command>
if [[ $# -ne 3 ]]; then
@so0k
so0k / README.md
Last active April 27, 2016 22:10

Docker Tallinn Demo script

Ensure swarm cluster is started before start of demo script

Docker CLI

Using Beta Docker for Windows

@so0k
so0k / start.sh
Last active May 21, 2016 17:23
meteor up
#!/bin/bash
APPNAME=<%= appName %>
APP_PATH=/opt/$APPNAME
BUNDLE_PATH=$APP_PATH/current
ENV_FILE=$APP_PATH/config/env.list
PORT=<%= port %>
USE_LOCAL_MONGO=<%= useLocalMongo? "1" : "0" %>
# remove previous version of the app, if exists
@so0k
so0k / gist:7493985
Created November 16, 2013 00:09
brush.phrases.txt
"Phrases"
{
"Menu1"
{
"en" "Select A Teammate"
}
"Menu2"
{
"en" "Select Another Teammate!!"
}
@so0k
so0k / gist:8191031
Created December 31, 2013 01:34
brush.sp (CSGO only - temporary)
/* B-Rush
*
* DESCRIPTION
* A great plugin where there are 5 Terrorists vs 3 CTs. The Ts must only plant at the "B" bomb site.
* Server admins can configure if players are allowed to buy/use FlashBangs, Smoke Grenades, HE Grenades,
* or AWPS. The number of AWPS allowed is configurable as well.
*
* If the CTs kill all of the Ts, the game continues to the next round, no modifications.
*
* If the Ts kill all of the CTs (or they somehow successfully bomb the B site), then the CTs become Ts
@so0k
so0k / gist:8201314
Last active May 31, 2016 15:43
brush with queue
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#include <adminmenu>
#define _DEBUG 0 // Set to 1 for debug spew
@so0k
so0k / aws-docs-original.md
Last active June 28, 2016 08:19
AWS Docs clarification

Orig AWS Documentation:

url

You can enable query logging for your PostgreSQL DB instance by setting two parameters in the DB parameter group associated with your DB instance: log_statement and log_min_duration_statement. The log_statement parameter controls which SQL statements are logged. We recommend setting this parameter to all to log all statements; the default value is none. Alternatively, you can set this value to ddl to log all data definition language (DDL) statements (CREATE, ALTER, DROP, etc.) or to mod to log all DDL and data modification language (DML) statements (INSERT, UPDATE, DELETE, etc.).

The log_min_duration_statement parameter sets the limit in milliseconds of a statement to be logged. All SQL statements that run longer than the parameter setting are logged. This parameter is disabled and set to minus 1 (-1) by default. Enabling this parameter can help you find unoptimized queries.