Skip to content

Instantly share code, notes, and snippets.

@tatey
tatey / factorial
Created July 21, 2009 12:13
Factorial in assembly (M6800)
; Course: 1007ICT - Griffith University
; Assignment: 2
; Author: Tate Johnson
; Created: 2008-05-30
; Processor: Motorola 6800
; QUESTION 6
; Calculate factorial of a
; number ranging from 1 - 8,
; depending on desired value
@deergod1
deergod1 / pfSense config.md
Last active April 5, 2023 10:39
pfSense Easy Configuration Guide for HP t620 Plus

pfSense Simple Home Configuration - 2.4.3 / 2.4.4

Starting from Scratch

This is my personal guide for installing pfSense. Hope you find it useful. I made these notes to capture the details of my "install from scratch" to ensure I didn't miss important details. Also, I'm trying build my network with discrete "disposable" components that make the system mutable and less rigid. It does not cover installing any packages like Squid or Suricata as that's way beyond the scope of a basic, functional install.

I migrated from an environment that was at various times running Tomato Toastman 1.28 or Asuswrt-Merlin on Netgear and ASUS routers across four "access points" (one always acting as the firewall/gateway, the rest as APs). It was OK pre-gigabit, but had roaming problems, and I was using large Wifi routers with most of the features disabled. Also, I found that I could easily swamp the network and tank VOIP and Wifi Calling without even trying. The only fix was to throttle everything by using Bandwidth Limit

@Yaffle
Yaffle / gist:1284012
Last active April 2, 2018 08:03
javascript base64 encode/decode
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<script type="text/javascript">
var nativeAtob = window.atob;
var nativeBtoa = window.btoa;
// http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#atob
(function (global) {
"use strict";
@dnagir
dnagir / faster_helper.rb
Created June 28, 2012 23:55
Fast specs with Rails
ENV["RAILS_ENV"] ||= 'test'
cur_dir = File.expand_path(File.dirname(__FILE__) + '/..')
$LOAD_PATH << "#{cur_dir}"
if defined? Rails
# Most likely going with the full env
puts "Running faster_helper with full Rails env..."
# Eagerly load the Rails so that stubbed dependencies still work
# http://stackoverflow.com/questions/11133712/using-rails-model-that-is-already-declared
//
// ViewController.m
// LIFX
//
// Created by Gary Riches on 18/01/2016.
// Copyright © 2016 Gary Riches. All rights reserved.
//
#import "ViewController.h"
#import "GCDAsyncUdpSocket.h"
@jasoncodes
jasoncodes / gist:1938675
Created February 29, 2012 06:59
Default `psql` to current Rails application
function __database_yml {
if [[ -f config/database.yml ]]; then
ruby -ryaml -rerb -e "puts YAML::load(ERB.new(IO.read('config/database.yml')).result)['${RAILS_ENV:-development}']['$1']"
fi
}
function psql
{
if [[ "$(__database_yml adapter)" == 'postgresql' ]]; then
PGDATABASE="$(__database_yml database)" "$(/usr/bin/which psql)" "$@"
@anathematic
anathematic / Ruby on Rails server config.md
Last active September 26, 2015 22:58
Quick notes for Ruby 2 + postgres on Ubuntu 13.4

Security / user config

Ruby + basic permissions

sudo /usr/sbin/groupadd rvm
sudo /usr/sbin/usermod -a -G wheel,rvm USERNAME 
sudo apt-get install build-essential git-core curl python-software-properties libsasl2-dev mailutils
sudo su -

\curl -L https://get.rvm.io | bash -s stable --ruby

@tatey
tatey / transmitter_importer.rb
Created April 30, 2011 09:58
Import terrestrial transmitter data into an SQLite database for use in Antenna Mate (http://antennamate.com).
#!/usr/bin/env ruby
# Import terrestrial transmitter data into an SQLite database for use in
# Antenna Mate (http://antennamate.com).
#
# Supported Regions:
# Australia - http://www.acma.gov.au/scripts/nc.dll?WEB/STANDARD/1001/pc=PC_9150
# United States - http://www.fcc.gov/mb/video/tvq.html
#
# Usage:
@smarthall
smarthall / lifx.c
Created August 12, 2015 12:11
LIFX Packet Sending Example
#include "lifx.h"
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
@Maxim-Filimonov
Maxim-Filimonov / workaround.md
Last active August 29, 2015 14:10
DNSimple outage workaround
  1. Find an ip address of site you want to access ( including subdomain as each subdomain can point to different ip) using cached DNS records -> https://www.whatsmydns.net

Example https://www.whatsmydns.net/#A/docs.semaphoreapp.com 2. Put the following in your /etc/hosts IP_ADDRESS WEBSITE_WITH_SUBDOMAIN

Example: 50.31.209.254 docs.semaphoreapp.com 3. Access website using normal address in browser. Does not require restart unless you are on windows.