Skip to content

Instantly share code, notes, and snippets.

View imsmith's full-sized avatar

Ian Smith imsmith

  • Seattle
  • 06:49 (UTC -07:00)
View GitHub Profile
@frsyuki
frsyuki / my_thoughts_on_msgpack.md
Created June 11, 2012 02:36
My thoughts on MessagePack

My thoughts on MessagePack

Hi. My name is Sadayuki "Sada" Furuhashi. I am the author of the MessagePack serialization format as well as its implementation in C/C++/Ruby.

Recently, MessagePack made it to the front page of Hacker News with this blog entry by Olaf, the creator of the Facebook game ZeroPilot. In the comment thread, there were several criticisms for the blog post as well as MessagePack itself, and I thought this was a good opportunity for me to address the questions and share my thoughts.

My high-level response to the comments

To the best of my understanding, roughly speaking, the criticisms fell into the following two categories.

@mbrownnycnyc
mbrownnycnyc / nsclient_update.sh
Created May 24, 2013 15:41
script for use with `nsupdate` to update linux client DNS on a DNS server... in this instance, I am targeting a Windows Server DNS server 2003/2008/2012+. I have manually created the PTR and A records once, and granted the Everyone ACE the "Write" permission in the DACL of the PTR and A records.
#!/bin/sh
#original from http://community.spiceworks.com/topic/262635-linux-does-not-register-on-the-windows-ad-dns
# reply of Phil6196 Oct 1, 2012 at 12:41 AM (EDT)
ADDR=`/sbin/ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | sed -e s/.*://`
HOST=`hostname`
echo "update delete $HOST A" > /var/nsupdate.txt
echo "update add $HOST 86400 A $ADDR" >> /var/nsupdate.txt
echo "update delete $HOST PTR" > /var/nsupdate.txt
echo "update add $HOST 86400 PTR $ADDR" >> /var/nsupdate.txt
nsupdate /var/nsupdate.txt
@shamangeorge
shamangeorge / apache-custom-directory
Last active December 22, 2022 07:00
apache virtual host with custom directory index configuration
<VirtualHost *:80>
ServerName www.example.com
# For local dev machines
ServerAlias staging.www.example.com
ServerAlias dev.www.example.com
DocumentRoot /var/www/www.example.com
<Directory /var/www/www.example.com>
Options +FollowSymlinks +Multiviews +Indexes
@bertvv
bertvv / pandoc.Makefile
Last active November 24, 2022 08:55
Makefile for Markdown -> PDF using pandoc
# Generate PDFs from the Markdown source files
#
# In order to use this makefile, you need some tools:
# - GNU make
# - Pandoc
# - LuaLaTeX
# - DejaVu Sans fonts
# Directory containing source (Markdown) files
source := src
@rhasselbaum
rhasselbaum / GoogleMusicPlayListExport.md
Last active February 15, 2021 15:24
Export Google Music Playlists to M3U

Recently, I decided to migrate my music library from Google Play Music to a self-hosted server running Subsonic. Only problem is I have a bunch of playlists, and Google provides no way to export those into any format that Subsonic can consume (m3u, pls, xspf). I also couldn't find an unofficial tool to do this. The best I could find was a handy app in the Play store called Playlist Backup. It can't export playlists for music stored remotely at Google, but it can create lists of albums and tracks names. Good enough! Now all I needed was a utility that could employ some fuzzy logic to match these lists to my local music files, which follow a typical Artist / Albumn / Track hierarchy.

Turns out, Python 3 makes this really easy! Just copy the script below:

playlist-gen.py:

#!/usr/bin/env python3

# Converts a list of audio tracks 
@reborg
reborg / rich-already-answered-that.md
Last active May 8, 2024 14:20
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@ajeetraina
ajeetraina / docker-compose.yml
Created October 29, 2017 12:21
Docker Compose File for MacVLAN Network Driver ( Single Node)
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
networks:
- myvlan
@mikejoh
mikejoh / docker-dhcpd.md
Last active April 3, 2024 16:37
Short guide on how to set up a Docker container as a DHCP server

Setting up a Docker container as a DHCP server

In this guide I’ve tested a number of different commands and configurations using Docker to run a container with dhcpd (+macvlan driver) to serve my clients in my home network. In the end i’ll migrate from my Windows 2012 R2 Server running DHCP to a much more lightweight Docker container (7.42 MB in total). Wow.

My home environment:

  • Firewall (Juniper)
    • I’m running IP helper for bootp which in this case means that i relay DHCP requests from various VLANs into one where i've placed my Windows 2012 R2 server. This is also where my container will live. See the FW configuration below:
@trojanh
trojanh / Transformer.ex
Last active March 16, 2022 07:35
Create Image thumbnail using ImageMagick in Elixir
defmodule Image.Transformer do
def transform(original_file, operation \\ "convert") do
thumb_path = generate_thumb_file(original_file)
System.cmd(operation, operation_commands(original_file_path, thumb_path))
thumb_path
end
defp generate_thumb_file(original_file) do
@Tras2
Tras2 / cloudflare-ddns-update.sh
Last active May 11, 2024 21:57
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record