Skip to content

Instantly share code, notes, and snippets.

@hisea
hisea / sublime
Created July 22, 2013 20:56
ST3 user config
{
"color_scheme": "Packages/Theme - Flatland/Flatland Dark.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_face": "Bitstream Vera Sans Mono",
"font_size": 13,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
# vim: ft=gitconfig
[sendemail]
multiedit = true
suppresscc = self
[color]
ui = true
[filemerge]
executable = vimdiff
[merge]
@hisea
hisea / mina_for_puma.rb
Created April 29, 2014 18:25
Puma deploy task for mina.
# Puma
# ==============================================================================
namespace :puma do
set :puma_pid, "#{app_path}/tmp/pids/puma.pid"
set :start_puma, %{
cd #{app_path}
bundle exec puma --config #{app_path}/config/puma.rb --environment #{rails_env}
}
@hisea
hisea / gist:e30c80c2c8788122f553
Last active August 29, 2015 14:25
Coding Test

Coding Test

Here is few quick Ruby and JavaScript questions for you. You can reply in-line below and/or with Gists.

1.) Can you explain Rack and some of its benefits? Have you ever written and Rack applications any if so for what purpose?

Rack is the middleware sitting between web server and Rails(or any Rack compatible Ruby framework) apps. It provides a set of standerd interfaces to the common HTTP related objects and operations. Some of the benefits of Rack:

  • Standardised interaction between web servers and ruby, making Ruby framework construction or web server's ruby capitibility implentmentation a lot easier.
  • It provides a way(Rack Middlewares) to easily implement comment low level HTTP functionality such as analytics, logging, or authentication. One example would be the gem Warden which provides Rack level authentication support.
var page = require('webpage').create(),
system = require('system'),
t, address;
if (system.args.length === 1) {
console.log('Usage: loadspeed.js <some URL>');
phantom.exit();
}
@hisea
hisea / VPN.md
Last active December 19, 2015 21:26
Ubuntu OpenVPN Setup

Ubuntu Official guide

Link

Ubuntu Server 14.04.1 How To setup OpenVPN server on a seperate machine than the LAN gateway (with access to other machines on server LAN)

Make sure your openvpn LAN is not the usual 192.168.1.1 or 10.0.0.1. If it is, log in to your router and change the third number ie. 192.168.(this number).1

Make sure to forward port 1194 on your router to the OpenVPN server IP

Example Network:

@hisea
hisea / create-multi-host-swarm-digitalocean.sh
Last active August 2, 2016 00:44 — forked from jmshal/create-multi-host-swarm-digitalocean.sh
Setup a Docker Swarm multi-host cluster on DigitalOcean
docker-machine create \
--driver=digitalocean \
--digitalocean-access-token=$DO_TOKEN \
--digitalocean-size=512mb \
--digitalocean-region=tor1 \
--digitalocean-private-networking=true \
--digitalocean-image=ubuntu-16-04-x64 \
docker-swarm-kv-store
docker $(docker-machine config docker-swarm-kv-store) run -d \
@hisea
hisea / install_connector.sh
Last active December 14, 2016 01:12 — forked from hkhamm/install_connector.sh
Install the Spark Cassandra Connector
#!/bin/bash
# Installs the spark-cassandra-connector and support libs
mkdir /usr/local/opt/connector
cd /usr/local/opt/connector
rm *.jar
curl -o ivy-2.4.0.jar \
'https://repo1.maven.org/maven2/org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar'
@hisea
hisea / ethminer_ubuntu_nvidia.md
Created December 25, 2017 06:29 — forked from johnstcn/ethminer_ubuntu_nvidia.md
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04

Headless Ethminer (nVidia) Setup Guide

Cian Johnston, July 2017

A couple of weeks ago, I decided I should put my gaming rig to work crypto mining. I did not expect to make any significant profit on this, it was more of a fun project to set up. However, there were a large number of tutorials and guides already out there, and many were more than a year out of date.

This guide assumes the reader already has a crypto wallet set up, is comfortable with Linux and the command line, and knows how to use Google if they run into problems.

The end result is an Ubuntu 16.04 LTS headless server running CUDA ethminer via systemd.

Hardware

@hisea
hisea / ethminer_ubuntu_nvidia.md
Created December 25, 2017 06:29 — forked from johnstcn/ethminer_ubuntu_nvidia.md
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04

Headless Ethminer (nVidia) Setup Guide

Cian Johnston, July 2017

A couple of weeks ago, I decided I should put my gaming rig to work crypto mining. I did not expect to make any significant profit on this, it was more of a fun project to set up. However, there were a large number of tutorials and guides already out there, and many were more than a year out of date.

This guide assumes the reader already has a crypto wallet set up, is comfortable with Linux and the command line, and knows how to use Google if they run into problems.

The end result is an Ubuntu 16.04 LTS headless server running CUDA ethminer via systemd.

Hardware