Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# File: packer-provisioners/wait-for-package-manager.sh
set -x
# http://unix.stackexchange.com/questions/315502/how-to-disable-apt-daily-service-on-ubuntu-cloud-vm-image
sudo systemctl stop apt-daily.service
sudo systemctl kill --kill-who=all apt-daily.service
# wait until 'apt-get updated' has been killed
@thequux
thequux / Makefile
Created October 28, 2014 14:01
Make-based scanning frontend
# Usage: make name=<document name> t<arget>
# Start with the init target, then use "scan" to run the scan. Finally, run "pdf" to get a compressed PDF file.
# Parameters that can be set in a Makefile.defs include:
# papersize: Provides defaults for papersize_width and papersize_height; defaults to a4
# papersize_{width,height}: Width and height of page in px
# resolution: resolution of scan in dpi
# rotate: Rotation angle (0,90,180,270). Applied during compression.
@jjongsma
jjongsma / packer-config
Last active December 18, 2023 15:15
Process YAML and write Packer JSON to STDOUT
#!/usr/bin/python
#
# Usage: packer-config my-template.yaml | packer build -
#
# Constructs a Packer JSON configuration file from the specified YAML
# template file and writes it to STDOUT.
#
# The YAML template format adds some flexibility and readability by
# adding comments and an !include directive, allowing for the
# following template syntax:
@lonetwin
lonetwin / pythonrc.py
Last active February 11, 2020 19:55
lonetwin's pimped-up pythonrc - Now at https://github.com/lonetwin/pythonrc
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Steven Fernandez
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
;; init.el
;; Vincent Foley - vfoley@gmail.com
(require 'cl)
(defmacro when-package-installed (package-name &rest body)
`(if (package-installed-p ,package-name)
(progn ,@body)
(warn "package %s is not installed" ,package-name)))
@code-affinity
code-affinity / ofx-to-ledger.py
Created January 24, 2012 16:32
Python script for importing OFX files into a ledger-cli file
from __future__ import print_function
from ofxparse import OfxParser
import os
import re
import sys
if len(sys.argv) != 1:
print ('This utility does not take command-line arguments')
exit()