Skip to content

Instantly share code, notes, and snippets.

@leon
leon / ssh-copy-rsub
Created March 2, 2012 10:04
ssh-copy-rsub - allows you to easily copy the remote script to your server using the same syntax as ssh-copy-id
#!/bin/sh -e
#
# Usage: ssh-copy-rsub [--bash] [user@]machine
#
# Shell script to install rsub on the remove server so we can open shell scripts locally.
# Author: Leon Radley (http://github.com/leon)
URL="https://raw.github.com/avian/rmate/master/rmate"
if [ "$#" -gt 1 ] || [ "$1" = "-b" ] || [ "$1" = "--bash" ]; then
@allanlei
allanlei / .env
Created January 16, 2012 21:14
Sample local Heroku/Django development environment using foreman
DATABASE_URL=postgres://USERNAME:PASSWORD@127.0.0.1/DATABASE
MEMCACHE_SERVERS=127.0.0.1:11211
DJANGO_SETTINGS_MODULE=settings.development.local
#![feature(lang_items, asm)]
#![crate_type = "staticlib"]
#![no_std]
const GPIO_BASE: u32 = 0x3F000000;
const GPIO_SET: u32 = 0x3F200020;
const GPIO_CLR: u32 = 0x3F20002C;
const GPIO47: u32 = 0x8000;
fn sleep(value: u32){
@Yukilas
Yukilas / run.py
Created October 31, 2012 15:49
[Django, Gevent, SocketIO] Run script to automatically restart Gunicorn when a change is made on a python file
#!/usr/bin/env python
# -*- coding:Utf-8 -*-
import os
import shlex
import subprocess
import sys
import time
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
@ardcore
ardcore / atom-events
Last active October 13, 2021 20:35
atom.io events
application:open-your-keymap
application:open-your-stylesheet
autocomplete:attach
autoflow:reflow-paragraph
bookmarks:clear-bookmarks
bookmarks:jump-to-next-bookmark
bookmarks:jump-to-previous-bookmark
bookmarks:toggle-bookmark
bookmarks:view-all
check:correct-misspelling
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
PID = /tmp/awesome-golang-project.pid
GO_FILES = $(wildcard *.go)
serve:
@make restart
@fswatch -o . | xargs -n1 -I{} make restart || make kill
kill:
@kill `cat $(PID)` || true
@marcoarment
marcoarment / S3.php
Last active June 25, 2023 19:41
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
<?php
/*
A simple PHP class to perform basic operations against Amazon S3 and compatible
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules.
Copyright 2022 Marco Arment. Released under the MIT license:
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
@lisamelton
lisamelton / transcode-video.sh
Last active September 8, 2023 23:51
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 5.13 of April 8, 2015