Skip to content

Instantly share code, notes, and snippets.

@ihashacks
ihashacks / mac_sysinfo.sh
Created Oct 3, 2016
quick and dirty Mac sysinfo script
View mac_sysinfo.sh
#!/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}"
View build_and_push.sh
#/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
View Dockerfile
# 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
View 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 Aug 29, 2015
switches a Linode guest to use Linode's repository mirrors
View linode-mirror-switch
#!/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 Apr 13, 2017
Dell Search Plugins for Firefox. These are hard-coded for the United States site. Released under GPL3.
View dellproduct.xml
<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 Jul 30, 2013
tor init script patch for those of us mounting /var/log in RAM disk
View tor
--- 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
View bp-lock
#!/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 Jun 6, 2013
misc IP and DNS stuffs
View bind2hosts
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
View geekcode.txt
-----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------