Skip to content

Instantly share code, notes, and snippets.

View symm's full-sized avatar
🦄

Gareth Jones symm

🦄
View GitHub Profile
@Spomky
Spomky / apn.php
Last active March 11, 2020 07:30
Generate JWT for Apple Push Notification
<?php
require_once 'vendor/autoload.php';
use Jose\Factory\JWKFactory;
use Jose\Factory\JWSFactory;
$key_file = '/PATH/TO/KEY/FILE';
$secret = null; // If the key is encrypted, the secret must be set in this variable
@ameliaikeda
ameliaikeda / nginx.conf
Created October 27, 2014 12:08
nginx config for dynamic subdomain:subdirectory mapping
user ameliaikeda staff;
worker_processes 2;
error_log /Users/ameliaikeda/dev/error.log info;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@konradko
konradko / golang_on_rpi.md
Last active April 12, 2020 17:36
Install Golang 1.7 on Raspberry Pi
wget https://storage.googleapis.com/golang/go1.7.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.7.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
autoload -U add-zsh-hook
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use
fi
}
add-zsh-hook chpwd load-nvmrc
@joselfonseca
joselfonseca / CartService.php
Created September 8, 2015 15:17
Generate Order Command
<?php
namespace App\Services\Cart;
use App\Services\Cart\Commands\GenerateOrder;
use App\Services\Cart\Commands\GenerateOrderHandler;
class CartService {
private $bus;
@Informatic
Informatic / README.md
Last active October 4, 2020 07:01
Minimal Tor hidden service on OpenWRT
  1. Format your storage
  2. Configure networking (it's easiest with LuCI, or just take a look at OpenWRT howtos)
  3. Configure /storage by adding proper options in /etc/config/fstab, or, again, just clicking around in LuCI
  4. opkg update && opkg install tor
  5. Copy proper configuration, namely /etc/tor/torrc and /etc/config/uhttpd
  6. Reboot (or /etc/init.d/uhttpd restart && /etc/init.d/tor restart)
  7. Check /etc/tor/hidden_service/hostname for your public .onion address
  8. ...
  9. PROFIT!
@petemcw
petemcw / docker_instructions.md
Last active October 22, 2020 21:24
Mac OS X Docker Instructions using Dinghy

Docker Installation

A great way to get Docker running smoothly on OS X is to use the awesome project Dinghy. It is basically:

Docker on OS X with batteries included, aimed at making a more pleasant local development experience. Runs on top of docker-machine.

Some of the benefits are:

  • Faster volume sharing using NFS rather than built-in virtualbox/vmware file shares
  • Filesystem events work on mounted volumes
@0xabad1dea
0xabad1dea / rtlsdr-osx.txt
Created June 13, 2013 21:55
Build RTL-SDR on OSX with no tears
rtl-sdr build notes for OSX
using macports http://www.macports.org/
see http://sdr.osmocom.org/trac/wiki/rtl-sdr
sudo port install cmake
sudo port install libusb
sudo port install pkgconfig
sudo port install sox # for easy audio
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
@bascht
bascht / pinget.rb
Last active November 28, 2020 16:20
Download all a RSS feed and wget all the links for your personal offline reading pleasure. :)
#!/usr/bin/env ruby
# - encoding: utf-8 -
#
# E.g. with: pinget.rb https://feeds.pinboard.in/rss/secret:YOURSECRET/u:YOURUSERNAME/toread/
require 'rss'
require 'open-uri'
require 'uri'
WGET = ['wget',
@gregology
gregology / dashboard
Last active December 8, 2020 14:19
Service script for dashing. Update DASHING_DIR variable, add this file to /etc/init.d/ , chmod to 755, and let update rc.d with $ sudo update-rc.d dashboard defaults This scripts stops the dashing service with "killall thin" which will kill all thin services running on your server.
#!/bin/bash
# Dashing service
# Add this file to /etc/init.d/
# $ sudo cp dashboard /etc/init.d/
# Update variables DASHING_DIR, GEM_HOME, & PATH to suit your installation
# $ sudo nano /etc/init.d/dashboard
# Make executable
# $ sudo chmod 755 /etc/init.d/dashboard
# Update rc.d
# $ sudo update-rc.d dashboard defaults