Skip to content

Instantly share code, notes, and snippets.

View nchapman's full-sized avatar

Nick Chapman nchapman

View GitHub Profile
*filter
# Dropping incoming connections that don't have explicit rules below
:INPUT DROP [68:4456]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1628:151823]
# Allow localhost
-A INPUT -i lo -j ACCEPT
@nchapman
nchapman / hack.sh
Created April 27, 2013 05:01 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@nchapman
nchapman / organizations_controller.rb
Created April 30, 2013 18:19
Less than beautiful generated controllers in Rails 4.
class OrganizationsController < ApplicationController
before_action :set_organization, only: [:show, :edit, :update, :destroy]
# GET /organizations
# GET /organizations.json
def index
@organizations = Organization.all
end
# GET /organizations/1
{
"sandboxes": [
{
"Name": "msgtype_counter",
"Outputs": [
{
"Filename": "data/msgtype_counter.MessageTypeCounts.cbuf",
"Name": "Message Type Counts"
},
{
define(
[
"underscore",
"jquery",
"crc32"
],
function(_, $, crc32) {
"use strict";
/**
# development use only
Daemon 0
LogFacility -
ListenHTTPS
Address 0.0.0.0
Port 3443
Cert "tmp/certificates/ssl.pem"
xHTTP 1
AddHeader "X_FORWARDED_PROTO: https"
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Firefox Accounts</title>
<meta name="description" content="">
➜ fxa-content-server git:(master) grunt build
Running "clean:dist" (clean) task
Cleaning .tmp...OK
Running "useminPrepare:html" (useminPrepare) task
Going through app/index.html to update the config
Looking for build script HTML comment blocks
Found a block:
<!-- build:css(.tmp) styles/main.css -->
@nchapman
nchapman / es.sh
Last active January 4, 2016 18:39
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.10.deb
sudo dpkg -i elasticsearch-0.90.10.deb
Warning: Running "jscs:src" (jscs) task
Line must be at most 160 characters at app/tests/spec/lib/fxa-client.js :
409 | var publicKey = {
410 | algorithm: 'RS',
411 | n: '4759385967235610503571494339196749614544606692567785790953934768202714280652973091341316862993582789079872007974809511698859885077002492642203267408776123',
--------^
412 | e: '65537'
413 | };
>> 1 code style errors found!