Skip to content

Instantly share code, notes, and snippets.

@kuedan
kuedan / Install_AirPrint_Printer.sh
Created September 1, 2022 20:23 — forked from apizz/Install_AirPrint_Printer.sh
Programmatically adds an AirPrint printer, ideally with an icon
#!/bin/bash
# Use the built-in ipp2ppd tool to create a PPD file for AirPrint
# Add icon to PPD (if we can get one) and install the printer
# Required printer info
readonly PRINTER_IP='XXX.XXX.XXX.XXX'
readonly PRINTER_NAME='PRINTER_NAME'
readonly PRINTER_DISPLAY_NAME='PRINTER NAME'
readonly PRINTER_LOCATION='PRINTER LOCATION'
@kuedan
kuedan / load-openwrt-usb.sh
Created May 21, 2019 15:08 — forked from hongkongkiwi/load-openwrt-usb.sh
Loads a JFFS OpenWRT tar file to a USB drive from Mac. This is particularly useful for Ubiquiti EdgeRouter Lite devices with external USB drives.
#!/usr/bin/env bash
# BUILD INSTRUCTIONS:
# https://wiki.openwrt.org/toh/ubiquiti/edgerouter.lite?s[]=octeon
USAGE="Loads a OpenWRT tar file onto a USB\n$0 <openwrt.tar> [/dev/diskX]"
KERNEL_SIZE="148.9MB"
KERNEL_NAME="KERNEL"
KERNEL_FORMAT="MS-DOS FAT32"
DATA_NAME="DATA"
@kuedan
kuedan / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Created August 11, 2017 20:02 — forked from ccstone/BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEDIT/TEXTWRANGLER REGULAR EXPRESSION GUIDE MODIFIED 2016/02/29 17:26
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@kuedan
kuedan / browser_history.md
Created March 10, 2017 20:43 — forked from dropmeaword/browser_history.md
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'