Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ihashacks
ihashacks / mac_sysinfo.sh
Created October 3, 2016 18:28
quick and dirty Mac sysinfo script
#!/bin/bash
MAC_TYPE=$(curl -s "http://support-sp.apple.com/sp/product?cc=$(system_profiler SPHardwareDataType | awk ' /Serial/ { print $4 } ' | cut -c 9-)" | sed 's|.*<configCode>\(.*\)</configCode>.*|\1|')
MAC_PROCESSOR=$(sysctl -n machdep.cpu.brand_string)
MAC_MEMORY="$(( $(sysctl -n hw.memsize) / 1024 ** 3 )) GB"
MAC_SERIAL=$(system_profiler SPHardwareDataType | awk ' /Serial/ { print $4 } ')
echo "System: ${MAC_TYPE}"
echo "CPU: ${MAC_PROCESSOR}"
echo "Memory: ${MAC_MEMORY}"
#/bin/env bash
# Builds the docker image and pushs to
# repository (local by default)
# Usage:
# build_and_push <directory of Dockerfile> <resultant docker image name>
DOCKERFILE_DIRECTORY=$1
DOCKER_IMAGE_NAME=$2
# docker image for running CC test suite
FROM ubuntu
RUN apt-get update
RUN apt-get -y install wget
RUN apt-get -y install git
# install Ruby 1.9.3-p484
RUN apt-get -y install build-essential zlib1g-dev libreadline-dev libssl-dev libcurl4-openssl-dev
@ihashacks
ihashacks / keybase.md
Created April 7, 2014 04:33
keybase.md

Keybase proof

I hereby claim:

  • I am ihashacks on github.
  • I am ihashacks (https://keybase.io/ihashacks) on keybase.
  • I have a public key whose fingerprint is 93A3 E6A0 E191 A709 5077 5406 36D6 E99F DA81 99E8

To claim this, I am signing this object:

@ihashacks
ihashacks / linode-mirror-switch
Last active August 29, 2015 13:56
switches a Linode guest to use Linode's repository mirrors
#!/bin/bash
################################################################################
# License
################################################################################
#
# Copyright (c) 2014 Brandon Pierce <brandon@ihashacks.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ihashacks
ihashacks / dellproduct.xml
Last active April 13, 2017 15:13
Dell Search Plugins for Firefox. These are hard-coded for the United States site. Released under GPL3.
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>Dell Product</ShortName>
<Description>Dell Product Search</Description>
<InputEncoding>utf-8</InputEncoding>
<Image width="16" height="16"> data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ
bWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdp
bj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6
eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEz
NDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJo
dHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlw
@ihashacks
ihashacks / tor
Created July 30, 2013 06:10
tor init script patch for those of us mounting /var/log in RAM disk
--- tor.init 2013-07-29 23:06:25.329990252 -0700
+++ tor.init-patched 2013-07-28 22:26:13.919215615 -0700
@@ -24,6 +24,7 @@
DAEMON=/usr/sbin/tor
NAME=tor
DESC="tor daemon"
+TORLOGDIR=/var/log/tor
TORPIDDIR=/var/run/tor
TORPID=$TORPIDDIR/tor.pid
DEFAULTSFILE=/etc/default/$NAME
@ihashacks
ihashacks / bp-lock
Created June 11, 2013 04:48
bluetooth fun
#!/bin/bash
rhythmbox-client --no-start --pause
(xscreensaver -nosplash &); sleep 1; xscreensaver-command -l
python $HOME/.local/bin/empathy_set_status.py away
@ihashacks
ihashacks / bind2hosts
Created June 6, 2013 03:49
misc IP and DNS stuffs
grep -v ^\; /var/named/chroot/var/named/db.example \|
awk ' { if($3 =="A") print $4 "\t" $1 ".example.com" } ' \|
sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GIT/O d- s: a- C++(+++) LS+++$ P-(---) L++++ E-> W++ N o-- K- w-- O M-- V-
PS+++(++) PE Y+ PGP+ t 5? X R? tv@ b+ DI++ D+ G>++ e h---- r+++ y+
------END GEEK CODE BLOCK------