Mac OSX tips

/etc/paths

this file contains the search paths

goto home dir

instead of cd ~ you can just type cd

move mouse with code
CGPoint pt;
pt.x = x;
pt.y = y;
CGEventRef mouseDownEv = CGEventCreateMouseEvent (NULL,kCGEventMouseMoved,pt,kCGMouseButtonLeft);
CGEventPost(kCGHIDEventTap, mouseDownEv);
CFRelease(mouseDownEv);
spoof your MAC address
sudo ifconfig en1 ether aa:bb:cc:dd:ee:ff

to check the result type:

ifconfig en1 | grep ether

for Lion you might need to change ether into Wi-Fi.
When you reboot your computer the original address is restored.

escape character in tenet on osx
Escape character is '^]'

which means Ctrl+]

hosts file
sudo nano -w /etc/hosts
sudo dscacheutil -cachedump -entries Host
dscacheutil -flushcache
stty

http://stackoverflow.com/questions/3918032/bash-serial-i-o-and-arduino can you run stty -a < /dev/tty.usbserial-A800eIUj while you have the serial port working on the Arduino IDE? That would give you the settings to use.

stty -f /dev/tty.PL2303-00001004 19200

otool

otool -L libopenFrameworks.dylib
install_name_tool

automatisch opstarten

nog uitzoeken: launchd en lingon

launch application by keyboard shortcut

swap alt+windows key on external keyboard

searching in files recursively

grep -ir "texttofind" *

using the find command on the command line

find . | grep -i ".cpp"

use grep to search output of a program

git diff | grep 'piano'

compile a simple glut program written in c on mac

g++ -Wall -O3 -g -framework OpenGL -framework GLUT bezmesh.c -o bezmesh

Don't forget to include OpenGL and GLUT like this:

#ifdef __APPLE__
#include <OpenGL/OpenGL.h>
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif

Enable colors in the terminal's ls command

or type ls -G or put the following in your ~/.profile file for a permanent solution.

export CLICOLOR=1

Show hidden files/folders

defaults write com.apple.finder AppleShowAllFiles TRUE

(and reload Finder)

Change screenshots folder

defaults write com.apple.screencapture location /Users/rick/Desktop/screenshots

SizeUp

SizeUp allows you to quickly position a window to fill exactly half the screen (splitscreen), a quarter of the screen (quadrant), full screen, or centered via the menu bar or configurable system-wide shortcuts (hotkeys). Similar to “tiled windows” functionality available on other operating systems.

Visor

Install Visor to have a system-wide terminal on a hot-key.

Rotate an image

sips input.jpg -r 90 --out output.jpg

convert an image

sips -s format jpeg 4.gif --out 4.jpg

chmod recursive write access

chmod -R 777 data

~/.profile

alias dir="ls -lGa"
alias tocaf="afconvert -f caff -d LEI16"
alias cdd="cd ~/Desktop"

ffmpeg for converting movie to iPad

see ffmpeg

combine pdf's on mac osx (with pdftk)

sudo port install pdftk
pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf

homebrew (brew)

An alternative for macports

Wireshark

Wireshark is a tool to analyze network traffic

hexdump

installed by default.

hexdump filename

sneltoetsen in nano console editor

zie nano

gmail berichten sturen via command line in osx

See this page: link I managed to send an email but it's not working completely yet.

terminal / iTerm2

  • Cmd+[ ] move between panels
  • Cmd+D new panel
  • Cmd+W close panel
  • ^A naar begin regel

Pleasant3D.app

Handige app om GCODES mee te bekijken in 3D

Synergy2

synergys --config synergy.conf

synergy.conf:

section: screens
        rick.local:
        User-PC:
end
section: links
rick.local:
        right = User-PC
User-PC:
        left = rick.local
end