Skip to content

Instantly share code, notes, and snippets.

🕹

Max Glenister omgmog

🕹
Block or report user

Report or block omgmog

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@omgmog
omgmog / partition.sh
Created Feb 17, 2014
Isolated partition part of my arch installer script
View partition.sh
umount /dev/sda*
parted /dev/sda mklabel gpt
cgpt create -z /dev/sda
cgpt create /dev/sda
cgpt add -i 1 -t kernel -b 8192 -s 32768 -l U-Boot -S 1 -T 5 -P 10 /dev/sda
cgpt add -i 2 -t data -b 40960 -s 32768 -l Kernel /dev/sda
cgpt add -i 12 -t data -b 73728 -s 32768 -l Script /dev/sda
PARTSIZE=`cgpt show /dev/sda | grep 'Sec GPT table' | egrep -o '[0-9]+' | head -n 1`
cgpt add -i 3 -t data -b 106496 -s `expr ${PARTSIZE} - 106496` -l Root /dev/sda
partprobe /dev/sda
@omgmog
omgmog / lcd.js
Created Jun 15, 2014
Output basic weather to LCD on Arduino using Johnny-five
View lcd.js
/*
wiring diagram: https://github.com/rwaldron/johnny-five/raw/master/docs/breadboard/lcd.png
usage:
npm install feedparser johnny-five request
node lcd.js
*/
var five = require("johnny-five"),
View check_dead.sh
#!/bin/bash
# usage:
# cd Resources
# sh check_dead.sh
for file in *.md; do
echo "====== Reading file: ${file} ======"
while read line; do
url=$(echo "$line" | sed s/.*\(// | sed s/\)// | sed s/^##.*//)
@omgmog
omgmog / patch.diff
Created Oct 31, 2014
diff to test partx
View patch.diff
diff --git a/install.sh b/install.sh
index 63c6661..40865e3 100644
--- a/install.sh
+++ b/install.sh
@@ -30,14 +30,14 @@ UBOOTFILE="nv_uboot-spring.kpart.gz"
if [ $DEVICE = $EMMC ]; then
# for eMMC we need to get some things before we can partition
echo -e "\n[archlinuxfr]\nSigLevel = Never\nServer = http://repo.archlinux.fr/arm\n" >> /etc/pacman.conf
- pacman -Syyu packer devtools-alarm base-devel git libyaml parted dosfstools cgpt parted
+ pacman -Syyu packer devtools-alarm base-devel git libyaml dosfstools cgpt
@omgmog
omgmog / generate-signed-kernel.sh
Last active Aug 29, 2015
For generating a signed kernel to use Arch on a Chromebook
View generate-signed-kernel.sh
#!/bin/sh
set -e
DEV="/dev/mmcblk0"
DEV_MNT="/tmp/emmc"
P1="${DEV}p1"
P3="${DEV}p3"
PP="$(pwd)/"
KEYS_OUT="${PP}devkeys"
@omgmog
omgmog / recovery.conf
Created Dec 7, 2014
SPRING recovery.conf
View recovery.conf
recovery_tool_version=0.9.2
recovery_tool_linux_version=0.9.2
recovery_tool_update=
name=HP Chromebook 11
version=6158.70.0
desc=HP Chromebook 11
channel=stable-channel
hwidmatch=^SPRING .*
hwid=SPRING AAAB-32H
@omgmog
omgmog / color-difference.scss
Last active Aug 29, 2015
Display h/s/l difference between colors in a list of colors
View color-difference.scss
@mixin determine_color_difference($first, $second) {
$hue: hue($first) - hue($second);
$sat: saturation($first) - saturation($second);
$lightness: lightness($first) - lightness($second);
@debug '------------------';
@debug 'First: #{$first}';
@debug 'Second: #{$second}';
@debug 'Hue difference: #{$hue}';
@debug 'Saturation difference: #{$sat}';
View no-break-space.md

# nbsp space

normal space

# actual nbsp space

@omgmog
omgmog / meancpuspeed
Created Feb 27, 2015
Output the mean speed in Mhz of all cpu cores
View meancpuspeed
#!/bin/sh
cat /proc/cpuinfo | grep MHz | awk '{ total += $4; count++} END { print total/count }'
@omgmog
omgmog / .bashrc
Created Mar 2, 2015
Better bash open
View .bashrc
#!/bin/bash
# This just wraps the bash `open` command to allow it to open directories using `nautilus`, just as `open` on Mac OS uses Finder.app.
open(){
if [[ -d "${1}" ]]; then
nautilus $1
elif [[ -f "${1}" ]]; then
\open $1
else
You can’t perform that action at this time.