start new:
tmux
start new with session name:
tmux new -s myname
function pwdx { | |
lsof -a -p $1 -d cwd -n | tail -1 | awk '{print $NF}' | |
} |
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
Syntax: x264 [options] -o outfile infile [widthxheight] | |
Infile can be raw YUV 4:2:0 (in which case resolution is required), | |
or YUV4MPEG 4:2:0 (*.y4m), | |
or Avisynth if compiled with support (no). | |
or libav* formats if compiled with lavf support (no) or ffms support (no). | |
Outfile type is selected by filename: | |
.264 -> Raw bytestream | |
.mkv -> Matroska | |
.flv -> Flash Video |
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF | |
appify v3.0.0 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2269385/a714e0e69ba99936f914ade0083709dcca6f8438/hack.sh | sh | |
# |
pb-kill-line () { | |
zle kill-line | |
echo -n $CUTBUFFER | pbcopy | |
} | |
pb-kill-whole-line () { | |
zle kill-whole-line | |
echo -n $CUTBUFFER | pbcopy | |
} |
-- AppleScript -- | |
-- This example is meant as a simple starting point to show how to get the information in the simplest available way. | |
-- Keep in mind that when asking for a `return` after another, only the first one will be output. | |
-- This method is as good as its JXA counterpart. | |
-- Webkit variants include "Safari", "Webkit", "Orion". | |
-- Specific editions are valid, including "Safari Technology Preview". | |
-- "Safari" Example: | |
tell application "Safari" to return name of front document |
This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Other options for PDFSETTINGS:
sw_vers
— Print Mac OS X operating system version informationsystem_profiler
— Reports system hardware and software configuration.system_profiler SPHardwareDataType
— Hardware overview.hostinfo
— Host information.nvram -p
— Print all of the firmware variables.getconf DARWIN_USER_CACHE_DIR
— Retrieve standard configuration variables/usr/libexec/path_helper
— Helper for constructing PATH environment variable