Skip to content

Instantly share code, notes, and snippets.

View deanrather's full-sized avatar

Dean Rather deanrather

View GitHub Profile
@deanrather
deanrather / create-package.md
Last active March 15, 2024 04:55
Creating a .deb Package

Creating a .deb Package

This creates a package which runs an install.sh which copies a file somewhere the below is entirely incorrect. Hopefully I'll get around to fixing it tip: this would install to the root dir & the relative path to ./install.sh would be wrong

go to project directory

cd /path/to/project
@deanrather
deanrather / Github Web Hosting.md
Last active March 13, 2024 19:16
Free Hosting on GitHub

Free Hosting on GitHub

This guide will take you from zero webserver knowledge, to having your own free site hosted on GitHub. The only non-free bit is registering a domain name, which can be as cheap as $5/year.

This guide uses CrazyDomains as the Registrar, FreeDNS as the DNS, and GitHub as the Webserver.


1) Domain Registration and Setup

@deanrather
deanrather / Using Git Patch.md
Created July 8, 2014 05:46
How to use Git Patch

How to use Git Patch

In this scenario, a Git Repo has been exported, and the contents of the repo deployed onto an environment.

This deployment does not have any knowledge of Git.

On the deployment:

Initialise a new git repo, so any changes can be tracked.

#!/bin/bash -e
# ubuntu-docker-install.sh
#
# Quick-usage:
#
# wget https://gist.githubusercontent.com/deanrather/9da36d690bd9b57c33fb3ddeb4321cc7/raw/ubuntu-docker-install.sh -O - | sh
#
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# https://github.com/docker/compose/releases
#
@deanrather
deanrather / Bash Comparison Operators.md
Last active March 20, 2023 02:21
Bash Comparison Operators

Bash Comparison Operators

Integer Comparison

Operator   Description                      Example
-eq        Is Equal To                      [ 100 -eq 100 ]
-ne        Is Not Equal To                  [ 100 -ne 200 ]
-gt        Is Greater Than                  [ 200 -gt 100 ]
-ge        Is Greater Than Or Equal To      [ 100 -ge 100 ]
-lt        Is Less Than                     [ 100 -lt 200 ]

-le Is Less Than Or Equal To [ 100 -le 100 ]

@deanrather
deanrather / .workstation.sh
Last active June 25, 2022 06:28
Configure Work Environment
#!/bin/bash
# Workstation Configurator
# To setup this script, run:
#
# wget -O ~/.workstation git.io/workstation && . ~/.workstation setup
#
# This achieves a few things:
# - Installation & Setup of Programs (Interactive)
# - Provides ~/.workstation file which automatically loads function library
@deanrather
deanrather / JSON-Encoding
Created July 28, 2015 09:45
JSON-encoding / decoding objects with circular references
/*
cycle.js
2015-02-25
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
This code should be minified before deployment.
See http://javascript.crockford.com/jsmin.html
@deanrather
deanrather / directory-compare.bat
Created May 16, 2015 12:07
Windows Batch Script to list files contained in one folder but not another
:: directory-compare.bat
:: Lists files existing in one directory, but not the other
:: Usage: \path\to\directory-compare.bat \path\to\one-dir \path\to\other-dir
:: Don't display the commands
@ECHO OFF
REM Due to some obscure reason, batch sees :: as an attempt to access a drive named ":"
REM under some circumstances.
REM So, I'll be using the inelegant "REM" statement for comments hereforth
#!/bin/bash -e
# ubuntu-install-flux.sh
# installs [f.lux](https://justgetflux.com/)
# usage: wget https://gist.githubusercontent.com/deanrather/b547e486d58612c87c6a2e2a0bc876b8/raw/ubuntu-install-flux.sh -O - | sh
sudo apt-get update
apt-cache pkgnames | grep -Fx python-pip || sudo apt-get install -y python-pip
apt-cache pkgnames | grep -Fx python-gconf || sudo apt-get install -y python-gconf
apt-cache pkgnames | grep -Fx python-glade2 || sudo apt-get install -y python-glade2
apt-cache pkgnames | grep -Fx python-appindicator || sudo apt-get install -y python-appindicator
@deanrather
deanrather / Using Awesome.md
Created August 27, 2015 04:01
Using Awesome

Using Awesome

  • Windows are "Tiled" by default, and you organise the tiles instead of click-dragging windows around.
  • Virtual Desktops are called Tags, there's 9 of them, and they're per-Screen.

Moving Between Windows

Win+J/K   		| Prev / Next Window (like Alt+tab)
Win+Ctrl+J/K	| Prev / Next Screen
Win+1-9 | Change to Desktop