Skip to content

Instantly share code, notes, and snippets.

Zafira B
111306
160638
161450
161600
000000 + 8 flashes, then 3 flashes of engine check light
030300
032500
111306
@pbhj
pbhj / filter.sh
Created June 27, 2017 22:10
bookmarkive filter script
#!/bin/sh
# take input from stdin and sort, remove duplicates and filter
set -e
cat /dev/stdin | sort | uniq | \
# strip hash endings (will kill twitter)
sed -e "s/#.*//" | \
# remove session id strings
@pbhj
pbhj / bookmarked-page-archiver.sh
Created June 27, 2017 22:07
bookmarkive shell script
#!/bin/bash
# this is a heavily modified version of "http://www.gwern.net/Archiving URLs"
# it should take the last ~1.1 months worth of bookmarks and make a local archive,
# using wget, of the pages that were bookmarked (or whose bookmark was altered).
# break on errors, see "help set" for info
set -e
# # copy places.sqlite locally
# cp --force $(find ~/.mozilla/ -name "places.sqlite") ./
@pbhj
pbhj / Groot-compromised-hosts
Last active October 16, 2016 22:08
A hosts file based on "Compromised stores that contain Javascript malware (scanned at 14th October 2016). See http://gwillem.gitlab.io/2016/10/14/github-censored-research-data/".
# see https://gitlab.com/gwillem/public-snippets/snippets/28813
# list of hosts in "null routed /etc/hosts" file format
# these hosts were considered to be running compromised software as of October 2016
0.0.0.0 00-lawyer.com
0.0.0.0 1001-amulette.de
0.0.0.0 1001tablecloths.co.uk
0.0.0.0 1001tafelkleden.com
0.0.0.0 1010buybuy.com
0.0.0.0 1136500562.rsc.cdn77.org
@pbhj
pbhj / etc-init.d-plexmediaserver
Created January 19, 2015 22:13
/etc/init.d/plexmediaserver
k1210:~$ cat /etc/init.d/plexmediaserver
#!/bin/sh -e
# upstart-job
#
# Symlink target for initscripts that have been converted to Upstart.
set -e
UPSTART_JOB_CONF="/etc/default/upstart-job"
INITSCRIPT="$(basename "$0")"
@pbhj
pbhj / start_pms
Created January 19, 2015 18:38
start_pms from plexmediaserver 0.9.11.7.803-87d0708 install
#!/bin/sh
#change these parameters in /etc/default/plexmediaserver
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000
export PLEX_MEDIA_SERVER_TMPDIR=/tmp
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${HOME}/Library/Application Support"
test -f /etc/default/plexmediaserver && . /etc/default/plexmediaserver
s = float(raw_input("Enter a score between 0.0 and 1.0: "))
# give grades for scores in range
# elif skips to end of else:
if s > 0.0 and s < 1.0:
if s >= 0.9:
print "A"
elif s >= 0.8:
print "B"
elif s >= 0.7:
# python program to calculate pay
# pr4e exercise 3.1; pbhj
# assign variables to user values entered
# no checking yet
hrs = raw_input("Enter Hours: ")
h = float(hrs)
rate = raw_input("Enter Rate: ")
r = float(rate)
@pbhj
pbhj / jquery.marquee-20120900a.js
Created September 16, 2012 21:47 — forked from remy/gist:2484402
jquery.marquee.js
/**
* author Remy Sharp
* url http://remysharp.com/tag/marquee
* pbhj 20120900: altered $marquee.attr('loop') to $marquee.prop('loop') as suggested in a comment on original github gist
*/
(function ($) {
$.fn.marquee = function (klass) {
var newMarquee = [],
last = this.length;