Skip to content

Instantly share code, notes, and snippets.

View eadz's full-sized avatar

Eaden McKee eadz

View GitHub Profile
@gbaman
gbaman / HowToOTGFast.md
Last active May 1, 2024 08:26
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@campaul
campaul / tarnish.rs
Created December 11, 2015 01:52
Simple HTTP proxy in Rust.
/*
Simple HTTP proxy in Rust. Hard coded to proxy rust-lang.org.
*/
extern crate hyper;
use std::io::Read;
use hyper::Client;
use hyper::header::Connection;
@octomagon
octomagon / devise.html.haml
Last active February 8, 2024 07:53
Replace the stock GitLab CE login greeting.
/ The template for the GitLab CE login page is located here:
/ /opt/gitlab/embedded/service/gitlab-rails/app/views/layouts/devise.html.haml
/
/ The CE admin console lets you only add markdown content to the login page.
/ This mod will let you replace it instead. If there is no addition, it will
/ display the standard CE greeting. Updates may clobber this file.
/
/ After updating it: gitlab-ctl reconfigure && gitlab-ctl restart
!!! 5
@liamstask
liamstask / middleman s3 deploy
Created February 19, 2014 17:59
a script for deploying a middleman site to s3. any gzip'd files have their extension removed so that s3 can serve them directly without another server required to perform content negotiation.
#!/usr/bin/env python
import os, shutil, subprocess
SITE = 'build/'
BUCKET = 's3://mybucket.com/'
CMD = ['s3cmd', '-c', os.path.expanduser('~/.s3cfg-myconfig'), 'sync', '--acl-public', '--reduced-redundancy']
CACHE_10_WEEKS = "Cache-Control: max-age=6048000"
@jyap808
jyap808 / public_key_decrypt_gpg_base64.go
Created January 9, 2014 20:32
Decrypting a base64 GPG public key encrypted string using a passphrase protected private key in ASCII armor format
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
)
@jyap808
jyap808 / public_key_encrypt_gpg_base64.go
Last active May 21, 2021 16:39
Public key encrypting a string into GPG format and outputting it in base64 encoding
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
)
@jyap808
jyap808 / decrypt_gpg_armor_private_key.go
Created January 8, 2014 01:25
Decrypting an ASCII armored GPG encrypted string using a private key (no passphrase) in ASCII armor format
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"code.google.com/p/go.crypto/openpgp/armor"
"fmt"
"io/ioutil"
"log"
)
#!/bin/bash
set -e
while inotifywait -e modify -r *.go; do
go build || true
done
@vmihailenco
vmihailenco / proxy.go
Created November 20, 2011 15:22
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@parndt
parndt / gist:882317
Created March 22, 2011 23:24
Gemfile without refinerycms doing all the magic authentication
# This is how to use Refinery CMS without our authentication
# What is happening here is I'm manually listing all of the other engines
# You will need to comply with all of the methods that anything else in Refinery is accessing
# That were being provided by refinerycms-authentication
gem 'refinerycms-dashboard', '~> 2.0.4'
gem 'refinerycms-images', '~> 2.0.4'
gem 'refinerycms-pages', '~> 2.0.4'
gem 'refinerycms-resources', '~> 2.0.4'