Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Run Netatalk in a SmartOS zone

This guide is based on this blog post: http://blog.smartcore.net.au/blazingly-fast-afp-on-a-smartos-zone/.

Import image and create virtual machine

Find the latest image, in this case 4166f6d6-ea5f-11e4-addd-8351b159d9b6 (15.1.0), or 24648664-e50c-11e4-be23-0349d0a5f3cf (14.4.1) if you need Long Term Support (LTS).

# imgadm avail | grep base-64
@jordonbiondo
jordonbiondo / jorbi-magit.el
Last active October 10, 2019 18:04
Magit, delete-trailing-whitespace on hunk under point.
(defun jorbi-magit/-line-region-of-section-at-point ()
"If point is in a hunk return a list of info about the hunk.
The info is like (expanded-file-name starting-line number-of-lines-show)"
(let* ((section (magit-current-section))
(context-type (magit-section-context-type section)))
(when (and (member 'hunk context-type))
(let* ((info
(mapcar 'string-to-number
(split-string
@slumos
slumos / osx-flush-dns.sh
Last active January 27, 2018 16:34
flush dns cache for different versions of OSX.
#! /bin/sh
# super-simplified version of flushDNSCache from Tunnelblick
osx_version=$(/usr/bin/sw_vers | awk '/ProductVersion:/ {print $2}')
echo "OSX: ${osx_version}"
case "${osx_version}" in
10.9.*|10.11.*)
sudo /usr/bin/dscacheutil -flushcache
sudo /usr/bin/pkill -HUP mDNSResponder
@hantuzun
hantuzun / osx.sh
Last active August 29, 2015 14:08 — forked from matthewmueller/osx-for-hackers.sh
My OSX Setup for Yosemite
#!/bin/sh
# My OSX Setup for Yosemite
#
# Source: https://gist.github.com/emrehan/53d8a9668ae616b03b55
# Ask for the administrator password upfront
sudo -v
###############################################################################
@bradp
bradp / setup.sh
Last active July 24, 2024 15:55
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
@dprevite
dprevite / osx-for-hackers.sh
Last active November 28, 2016 05:43 — forked from brandonb927/osx-for-hackers.sh
My fork of osx-for-hackers.sh
#!/bin/sh
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Set the colours you can use
black='\033[0;30m'
@hausen
hausen / gist:9501041
Last active August 29, 2015 13:57
"Fixing" xkcd 1340 (or making the most redonkulous clock ever)

"Fixing" xkcd 1340 (or making the most redonkulous clock ever)

Update: feeling adventurous? Clone or fork the xkcd clock! If you just want to see it in action or get a glimpse of how it works, keep reading.

Problem

The date in [xkcd's comic number 1340][1] [does not change][2].

@joshenders
joshenders / HPN40L BMC Setup.md
Last active September 2, 2023 08:00
How to setup an N40L Remote Access Card (BMC/IPMI) under Debian Wheezy

Update BMC Firmware

As of this writing (2014-02-18), the latest firmware is 1.3. It can be updated from the webif. Use Safari, the credentials are admin/password. If you're trying to find it on your network, the OUI of the BMC NIC is a0:b3:cc.

Install Utilities

apt-get install openipmi ipmitool
@willurd
willurd / web-servers.md
Last active August 1, 2024 04:29
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000