Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
target=$1
filename=`basename $1`
image="${TMPDIR}${filename}.png"
rsrc="${TMPDIR}icn.rsrc"
# Create a thumbnail from the file preview
qlmanage -t -s 512 -o ${TMPDIR} $target
#!/bin/bash
oldgw=10.211.55.1
vpngw=10.100.0.1
function xxtest () {
ifconfig|grep $1&&return 1
return 0
}
function xxcon () {
poff
-----------------------------------------------------
-- Name: Edit Last Modified Note and Preview in Marked
-- Author: Patrick Welker <http://rocketink.net>
-- Version: 1.1 (October 24, 2014)
-- Credits: Uses ViewInMarked by Robin Trew to align editor and Marked windows: <http://git.io/sLxcgg>
-- For: bloggers, writers and Marked users (<http://markedapp.com>)
-----------------------------------------------------
-- Know problems:
-- * Sometimes, when the editor is closed it first tries top open the default "open" dialog.
-- * The script handles nvALT differently from all editors. It doesn't resize nvALT's window since most users
@robmathers
robmathers / readinglisturls.py
Last active November 16, 2023 21:18
Prints out URLs of items in Safari’s Reading List
#!/usr/bin/env python
import plistlib
from shutil import copy
import subprocess
import os
from tempfile import gettempdir
import sys
import atexit
BOOKMARKS_PLIST = '~/Library/Safari/Bookmarks.plist'
@ttscoff
ttscoff / customthumbs.sh
Created July 4, 2013 03:48
Create custom thumbnail icons from a file's Quick Look preview on OS X
#!/bin/bash
target=$1
filename=`basename $1`
image="${TMPDIR}${filename}.png"
rsrc="${TMPDIR}icn.rsrc"
# Create a thumbnail from the file preview
qlmanage -t -s 512 -o ${TMPDIR} $target
# Automaticlly install pptpd on Amazon EC2 Amazon Linux
#
# Ripped from http://blog.diahosting.com/linux-tutorial/pptpd/
# pptpd source rpm packing by it's authors
#
# WARNING:
# first ms-dns setting to 172.16.0.23, 172.16.0.23 was showing on my
# /etc/resolv.conf, I'm not sure this is the same on all Amazon AWS zones.
#
# You need to adjust your "Security Groups" which you are using too.
@Zettt
Zettt / OpenMeta2OSXTags.sh
Last active May 5, 2021 15:58
Script that reads OpenMeta tags and writes them to OS X Mavericks tags. http://mosx.tumblr.com/post/54049528297/convert-openmeta-to-os-x-mavericks-tags-with-this This requires a OpenMeta binary to be installed. Change its path, if you prefer it to be somewhere else. For the files to be processed properly don't include a trailing slash in `$files…
# =============================================================
# = OpenMeta to OS X Tags =
# =============================================================
# Script to convert OpenMeta tags to OS X Mavericks tags.
#
# Created by Zettt (Andreas Zeitler) on 2013-06-28
# Source www.macosxscreencasts.com, mosx.tumblr.com
#
# OpenMeta to OS X Tags by Andreas Zeitler is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike
@nickstenning
nickstenning / appversions
Created June 26, 2013 11:52
Print a list of installed applications and their versions on Mac OS X
#!/usr/bin/env python
from __future__ import print_function, absolute_import
import csv
import re
import sys
from subprocess import Popen, PIPE
LSREGISTER = ('/System/Library/Frameworks/CoreServices.framework/Versions/A'
@ttscoff
ttscoff / grab links.bookmarklet
Last active April 3, 2024 19:44
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.
@nickstenning
nickstenning / build.sh
Last active December 18, 2015 07:29
Puppet standalone build
#!/bin/sh
set -eu
status () {
echo "---> ${@}" >&2
}
abort () {
echo "$@" >&2