Skip to content

Instantly share code, notes, and snippets.

@jasoncodes
jasoncodes / README.markdown
Created October 6, 2010 11:16
Run VMware Fusion headless at Mac OS system startup

Run VMware Fusion headless at Mac OS system startup.

I heard you like headless VMs on your Mac so I wrote this script for your launchds.

Assumptions

  • Tested on Mac OS X 10.6.4 with VMware Fusion 2.0.5 and 3.1.1.
  • A interactive user automatically logs into the system at startup. I had some issues trying to get this running without an interactive user logged in. I automatically log in for Airfoil Speakers anyway.
  • Your virtual machines live in /Virtual Machines
@mikhailov
mikhailov / 0. nginx_setup.sh
Last active June 29, 2024 23:43
NGINX+SPDY with Unicorn. True Zero-Downtime unless migrations. Best practices.
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#

Create a Postgis timezone DB

Ubuntu's analog of robcowie / postgis_timezone_db.markdown

Install postgis

sudo apt-get install python-software-properties
sudo apt-add-repository ppa:ubuntugis/ppa
sudo apt-get update

sudo apt-get install postgresql-9.1-postgis

@sinkers
sinkers / check_keyframes.py
Last active November 16, 2019 19:56
Checking keyframe alignment using ffprobe
import re
import subprocess
import logging
import math
import json
import pygal
import sys
logger = logging.getLogger(__name__)
'''
@iansltx
iansltx / _safari-iframe-cookie-workaround.md
Last active April 7, 2024 15:44
Safari iframe cookie workaround
@SQiShER
SQiShER / docker_stats_with_names.sh
Last active May 5, 2020 07:35
Docker stats with Container Names instead of IDs
docker stats $(docker inspect -f '{{.Name}}' $(docker ps -q) | cut -c 2-)
@brigand
brigand / .md
Last active August 26, 2016 20:28
immutable updates methods

Let's explore a few ways to do immutable updates in js. We'll start with this data:

var data = {
  foo: {
    bar: 1,
    baz: 2,
  }
};
@bmihelac
bmihelac / wagtail_struct_block_validation.py
Created January 5, 2017 15:28
Example validating wagtail StructBlock
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorList
from wagtail.wagtailcore import blocks
class MyLinkBlock(blocks.StructBlock):
"""
Example validating StructBlock.
"""
@Geekfish
Geekfish / merge_pdfs.py
Created January 31, 2017 16:07
pyPDF2 merge 2 pdf pages into one
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.pdf import PageObject
reader = PdfFileReader(open("invoice.pdf",'rb'))
invoice_page = reader.getPage(0)
sup_reader = PdfFileReader(open("supplement.pdf",'rb'))
sup_page = sup_reader.getPage(1) # We pick the second page here
translated_page = PageObject.createBlankPage(None, sup_page.mediaBox.getWidth(), sup_page.mediaBox.getHeight())
@lgaetz
lgaetz / sendmail-bluemix
Last active September 13, 2022 14:01
Asterisk voicemail mailcmd script for VM transcription
#!/bin/sh
# sendmail-bluemix
# current verison of this script: https://gist.github.com/lgaetz/2cd9c54fb1714e0d509f5f8215b3f5e6
#
#
# Original source created by N. Bernaerts: https://github.com/NicolasBernaerts/debian-scripts/tree/master/asterisk
# modified per: https://jrklein.com/2015/08/17/asterisk-voicemail-transcription-via-ibm-bluemix-speech-to-text-api/
#
#