Skip to content

Instantly share code, notes, and snippets.

View jasonwbarnett's full-sized avatar

Jason Barnett jasonwbarnett

View GitHub Profile
@kburdett
kburdett / rpi_unifi.md
Last active March 24, 2022 19:51
Install Ubiquiti's UniFi Controller on a Raspberry Pi

Compatibility

I currently run Ubiquiti's UniFi Controller on a Raspberry Pi 3B without issue. I have tried with a Raspberry Pi 1B, but the application crashes on startup. I assume it is due to a lack of RAM. Presumably, it would run on a Raspberry Pi 2B as well (same amount of RAM), but I have not tested it on this model. YMMV.

Instructions

  1. Install Raspbian on a SD card. I tested this with Jessie Lite (headless)

  2. Use raspi-config to expand the filesystem, rename your PI, etc

@limingjie
limingjie / 256 colors.md
Last active April 24, 2024 22:15
256 colors in putty, tmux/screen and vim

#256 colors in putty, tmux/screen and vim There is a detailed answer on stackoverflow. If you are looking for a short one, here it is.

  • putty

    Set Connection -> Data -> Terminal-type string to xterm-256color

  • tmux

Add this line to ~/.tmux.conf

@jasonwbarnett
jasonwbarnett / install_mysql-server_bin.sh
Last active August 29, 2015 14:05
This can be used to install MySQL Server from the bin distribution.
#!/bin/bash
# Author: Jason Barnett <J@sonBarnett.com>
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Jason Barnett
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@jasonwbarnett
jasonwbarnett / ssh_proxy.sh
Created August 7, 2014 16:47
How to SSH proxy through another host
jbarnett@Hackintosh-10 ~ $ cat ~/.ssh/config
Host r176.spigit.com r178.spigit.com
ProxyCommand ssh -T operations002.c.mindjet-gce-stack.internal 'nc %h %p'
jbarnett@Hackintosh-10 ~ $
@jasonwbarnett
jasonwbarnett / mutt_and_gmail_smtp.sh
Last active August 29, 2015 13:57
This is how you can use mutt with a gmail account to send email at the command line.
## Install homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
## Run brew doctor to make sure everything is ok
brew doctor
## Install mutt
brew install mutt
## Setup your .muttrc file with the gmail smtp info:
@niklasvincent
niklasvincent / build-nginx.sh
Last active October 11, 2019 04:44
Build script for statically compiled nginx 1.4.7 with OpenSSL 1.0.1e.
#!/bin/bash
set -e
NGINX_VERSION="1.6.0"
NGINX_TARBALL="nginx-${NGINX_VERSION}.tar.gz"
PCRE_VERSION="8.34"
PCRE_TARBALL="pcre-${PCRE_VERSION}.tar.gz"
OPENSSL_VERSION="1.0.1g"
OPENSSL_TARBALL="openssl-${OPENSSL_VERSION}.tar.gz"
@suryart
suryart / application.html.erb
Last active October 26, 2023 00:16
Rails 4 flash messages using Twitter Bootstrap(bootstrap-sass: https://github.com/thomas-mcdonald/bootstrap-sass). An improved version of https://gist.github.com/roberto/3344628
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@schnell18
schnell18 / create_chrootjail.sh
Created November 3, 2013 05:23
Script to automate the creation of chroot jail w/ minimal executables to run git.
#!/bin/sh
# script to automate the creation of chroot jail
# w/ minimal executables to run git
export CHROOT=/var/chroot
function copy_binary() {
for i in $(ldd $*|grep -v dynamic|cut -d " " -f 3|sed 's/://'|sort|uniq)
do
cp --parents $i $CHROOT
@rjeczalik
rjeczalik / building-static-nginx.txt
Created October 19, 2013 15:37
Notes on building nginx as a static binary.
# Building static nginx for teh lulz
#
# basic dependencies
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev
# download nginx and openssl
wget http://nginx.org/download/nginx-1.5.6.tar.gz
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6
@ahendrix
ahendrix / gist:7030300
Created October 17, 2013 18:56
bash stacktrace
function errexit() {
local err=$?
set +o xtrace
local code="${1:-1}"
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err"
# Print out the stack trace described by $function_stack
if [ ${#FUNCNAME[@]} -gt 2 ]
then
echo "Call tree:"
for ((i=1;i<${#FUNCNAME[@]}-1;i++))