Skip to content

Instantly share code, notes, and snippets.

@brandonb927
brandonb927 / osx-for-hackers.sh
Last active June 8, 2024 22:26
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@frankamp
frankamp / gist:5971164
Created July 10, 2013 23:27
arduino teensy3 + MPU-6050 accelerometer
/* LED Blink, Teensyduino Tutorial #1
http://www.pjrc.com/teensy/tutorial.html
This example code is in the public domain.
*/
#include <Wire.h>
// Teensy 2.0 has the LED on pin 11
// Teensy++ 2.0 has the LED on pin 6
// Teensy 3.0 has the LED on pin 13
const int ledPin = 13;
@shirou
shirou / README
Last active October 8, 2018 14:53
ansible docker direct connection plugin
前提
-----------
- docker 0.9.1
- lxcを入れること
- linux 3.11で確認。 3.8以上じゃないとだめっぽい。
- ubuntu image (docker pull ubuntuで取ってきたもので試してみた)
- imageにはpython2を入れておくこと
- /usr/bin/tee がimageにあること
@curzona
curzona / shell_session.py
Created April 21, 2014 03:45
Multiple command shell session with paramiko
import paramiko
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect('HOST', port=22, username='USERNAME', password='PASSWORD')
channel = client.get_transport().open_session()
channel.invoke_shell()
while channel.recv_ready():
@snrbrnjna
snrbrnjna / .htaccess
Last active May 10, 2022 01:56
Jekyll Auth Plugin - to manage http basic auth for jekyll generated pages and directories
#### Jekyll Layout: /_layouts/.htaccess
# Apache Configuration File
{% if ((page.auth_dir.users != empty) or (page.auth_dir.groups != empty)) %}
AuthName "Privater Bereich"
AuthType Basic
# => mehrere Require Blocks werden geodert: http://d43.me/blog/1157
AuthzUserAuthoritative Off
AuthUserFile {{ page.auth_remote_user_file }}
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@TomCan
TomCan / restart-samba.sh
Created July 23, 2015 14:53
Restart Mac OS X smb service from terminal/cli
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.smbd.plist
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist EnabledServices -array disk
@jonschlinkert
jonschlinkert / open-iterm-from-finder.md
Last active May 24, 2022 01:33
Add an icon to your finder toolbar to open iTerm in the current folder.

Open iTerm from finder

The code and instructions in this gist are from http://peterdowns.com/posts/open-iterm-finder-service.html. I've had to do this a few times and wanted to distill it the basics.

  1. Open Automator
  2. Create an Application
  3. Choose Actions > Utilities > Run Applescript
  4. Paste the contents of open_in_iterm.app into the window.
  5. Save the script somewhere convenient
  6. Find the script, then drag the script onto the Finder window while holding the command key (or in Yosemite, the command + option keys)
@odyssey4me
odyssey4me / 00-full-command-transcript.sh
Last active November 18, 2020 02:51
Ansible remote chroot experimentation
#!/bin/bash
# do this on localhost (deployment host)
# ensure that there's a local ssh private key
ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
# now make sure that the public key is in the second host's authorized_keys
# then do a test ssh connection to make sure it works, and to add the host
# to known hosts
@davidjb
davidjb / recovery.sh
Created December 21, 2016 08:21
Create macOS Sierra Recovery Partition Without Reinstalling
TARGET="/Volumes/Macintosh HD" # Specify where to configure Recovery partition
MACOS_INSTALLER="/Applications/Install\ macOS\ Sierra.app" # Path to your macOS installer
# Remaining paths ahead are dependant on OS version
# This *should* support 10.9 and above but is only tested on 10.12
curl http://support.apple.com/downloads/DL1464/en_US/RecoveryHDUpdate.dmg -L -o ~/Downloads/RecoveryHDUpdate.dmg
hdiutil mount ~/Downloads/RecoveryHDUpdate.dmg
pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg /tmp/recoveryupdate