Skip to content

Instantly share code, notes, and snippets.

@ihashacks
ihashacks / notifyosd.zsh
Last active November 7, 2021 18:01
pseudo undistract-me implementation in zsh Original undistract-me: http://mumak.net/undistract-me/
# commands to ignore
cmdignore=(htop tmux top vim)
# end and compare timer, notify-send if needed
function notifyosd-precmd() {
retval=$?
if [[ ${cmdignore[(r)$cmd_basename]} == $cmd_basename ]]; then
return
else
if [ ! -z "$cmd" ]; then
@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 / 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}"
@ihashacks
ihashacks / add_monitor.ldif
Created December 15, 2012 19:59
add and configure monitor module in cn=config based slapd
dn: cn=module{0},cn=config
changetype: modify
add: olcModuleLoad
olcModuleload: back_monitor.la
@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------
@ihashacks
ihashacks / airdroid.desktop
Created November 19, 2012 05:39
.desktop entry for AirDroid
[Desktop Entry]
Type=Application
Name=AirDroid
Comment=AirDroid
Exec=/usr/bin/chromium-browser --app=http://web.airdroid.com/
Icon=/home/brandon/.icons/airdroid-256.png
Categories=Network;
#!/bin/bash
#
# Created 20110816 by Brandon Pierce
#
# Adds new feed to Lifera using Zenity. Intended to be called as a
# Unity Launcher quick list. Pretty useless otherwise
#
LIFEREA="/usr/bin/liferea -a"
ZENITY="/usr/bin/zenity"