Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / Polymer-CodePen-starter.markdown
Created December 4, 2014 06:51
Polymer CodePen starter
@TomHoenderdos
TomHoenderdos / gist:92cbe6a9569684cbf6ae
Created August 21, 2014 11:21
LeoFS Administrator script for SmartOS LeoFS dataset
#!/usr/bin/env bash
# -*- tab-width:4;indent-tabs-mode:nil -*-
# ex: ts=4 sw=4 et
#======================================================================
#
# LeoFS
#
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
@mortn
mortn / geoblocker
Last active April 24, 2024 16:55
nginx geoip blocking with network exceptions.
# /etc/nginx/geoblocker
# This will block anything but the defined countries and the networks defined in the $localnet variable
set $geoblock 0;
if ($geoip_country_code !~ (DK|NO|SE)) { set $geoblock 1; }
if ($localnet = 1){ set $geoblock 0; }
if ($geoblock = 1){ return 403; }
#!/bin/sh
# -*- tab-width:4;indent-tabs-mode:nil -*-
# ex: ts=4 sw=4 et
RUNNER_SCRIPT_DIR=$(cd ${0%/*} && pwd)
RUNNER_BASE_DIR=${RUNNER_SCRIPT_DIR%/*}
RUNNER_ETC_DIR=$RUNNER_BASE_DIR/etc
RUNNER_LOG_DIR={{log_path}}
# Note the trailing slash on $PIPE_DIR/
## bitcask data root
bitcask.data_root = /var/db/sniffle
## Configure how Bitcask writes data to disk.
## erlang: Erlang's built-in file API
## nif: Direct calls to the POSIX C API
## The NIF mode provides higher throughput for certain
## workloads, but has the potential to negatively impact
## the Erlang VM, leading to higher worst-case latencies
## and possible throughput collapse.
@arekinath
arekinath / wiggle.patch
Created October 16, 2013 23:52
potential sec-websocket-protocol fix
diff --git a/apps/wiggle/src/wiggle_wsproxy.erl b/apps/wiggle/src/wiggle_wsproxy.erl
index 86da16d..0049aad 100644
--- a/apps/wiggle/src/wiggle_wsproxy.erl
+++ b/apps/wiggle/src/wiggle_wsproxy.erl
@@ -24,13 +24,24 @@ terminate(_Req, _State) ->
ok.
websocket_init(_Any, Req, []) ->
+ Req1 = case cowboy_req:parse_header(<<"sec-websocket-protocol">>, Req) of
+ {undefined, _, ReqR} -> ReqR;
@jim80net
jim80net / vmigrate.sh
Last active November 20, 2023 14:19
Use this script to migrate a SmartOS guest to a target. ./vmigrate.sh UUID TARGETIP - or - ./vmigrate.sh UUID TARGETIP migration-snapshotdate # specify the initial snapshot timestamp to increment the snapshot on the target
#!/bin/bash
# Use this to send and receive files
# Dependencies:
# SSH-Keys setup for root users. I recommend using agent forwarding for this.
# mbuffer installed in /opt/local/bin/mbuffer. Adjust to reality.
#
# This script presumes:
# zsnapper is installed. Comment out the two lines where it is referenced if you don't use it
DATE=$(date +%Y%m%d%H%M)
@sax
sax / smartos.erb
Last active December 16, 2015 15:39
SmartOS Chef bootstrap template
# Wanelo Universal Bootstrap Script (W.U.B.S.)
bash -c '
# Linux Distros:
if [ $(uname -s | grep Linux) ]; then
true && curl -s -L https://www.opscode.com/chef/install.sh | bash
# Illumos Distros:
elif [ $(uname -s | grep SunOS) ]; then
@cdils
cdils / archive-testimonials.php
Created March 13, 2013 13:49
Testimonial Archive Template
<?php
/**
* Template Name: Testimonial Archives
* Description: Used as a page template to show page contents, followed by a loop through a CPT archive
*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop
@aboron
aboron / start.sh
Created February 26, 2013 18:55
Script for starting minecraft (craftbukkit) on smartos (solaris)
#!/bin/bash
cd /opt/local/minecraft
java -d64 -Xms1G -Xmx6G -XX:-UseVMInterruptibleIO -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=4 -XX:+AggressiveOpts -jar craftbukkit.jar nogui