Skip to content

Instantly share code, notes, and snippets.

#screen
$ ctrl + a + d #exit
$ ctrl + a + c # tab
$ ctrl + a + space # switch tab
$ ctrl + a + number # switch to tab window, if in screen
$ screen -x #overview of screen or enter in active screen, if only one

(Inspired by http://yourmacguy.wordpress.com/2012/06/29/osx-automount/)

Preface:

  • I have a lot of vagrant projects
  • Each of them provides an NFS-Server exporting /home/vagrant
  • Since Mac OS 10.8 the handy "NFS Mounts" from Disk Util are gone
  • I'd like a single place, in which I could copy'n'paste a config for a new box and/or comment a box (when I don't need it for some time)
  • I'd like to make this a vagrant plugin
  • Ideally, the mount will be activated/deactivated when starting/suspending a box

Mac で Nginx

インストール

$ brew install nginx

インストールされる場所:

/usr/local/Cellar/nginx/1.2.4/
@sfelde
sfelde / uwsgi-start-stop
Created March 1, 2013 19:29
uwsgi kill stop start
service uwsgi stop; killall -9 uwsgi-core; service uwsgi start
@sfelde
sfelde / image-optimization
Created February 10, 2013 21:02
image optimization
find . -name '*.jpg' | xargs jpegoptim --strip-all
find . -name '*.png' | xargs optipng
@sfelde
sfelde / gitignore
Created February 8, 2013 11:57
django gitignore
*.py[co]
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
@sfelde
sfelde / html5video_converter
Last active December 11, 2015 18:59
convert input video file to html5 video formats mod. from url: http://sandalov.org/blog/1184/
#!/bin/bash
if [[ $1 ]]
then
filename=$(basename "$1")
filename=${filename%.*}
#$(dirname "$1")
directory=result
duration=$(ffmpeg -i "$1" 2>&1 | grep Duration | awk '{print $2}' | tr -d ,)
minutes=${duration%:*}
class BankAccount < ActiveRecord::Base
# Umsätze von start_date bis end_date abrufen
# * passport_type, passphrase, pin und file kommen in dieser Implementation aus der zugrunde liegenden Tabelle.
# * Wenn passport_type = "PinTan" ist, wird die pin verwendet.
# * Wenn passport_type = "RDHNew" ist, wird die Schlüsseldatei aus filename verwendet und mit der passphrase entschlüsselt.
def get_transactions(start_date, end_date)
HBCIUtils.setParam("client.passport.#{passport_type}.filename", filename)
HBCIUtils.setParam("client.passport.#{passport_type}.init", '1')
@sfelde
sfelde / launch_sublime_from_terminal.markdown
Created November 11, 2012 19:36 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@sfelde
sfelde / demo.html
Created August 20, 2012 12:46 — forked from sergejmueller/demo.html
Fullscreen API Demo. Denkbar für eShops. Lauffähig unter Firefox, Chrome und Safari.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="author" content="Sergej Müller" />
<link href="style.css" rel="stylesheet" />
<title>Fullscreen Demo</title>