Skip to content

Instantly share code, notes, and snippets.

@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
@Vestride
Vestride / encoding-video.md
Last active May 17, 2024 06:55
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
@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 }}
@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():
@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にあること
@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;
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 29, 2024 14:52
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