0

Taking screen shots with Mac OSX

Posted by jason on Feb 25, 2010 in Mac

I seem to always forget these short cuts even though i use them frequently. With windows, it is simply “print screen” button to capture the desktop and alt-”print screen” to capture the active window.  This puts the image in the clip board.

The apple commands for capturing the screen aren’t as intuitive as the Windows version.

To capture the desktop, Command-Shift-3

To capture a portion of the screen, Command-Shift-4.

To capture a specific windows, Command-Shift-4 followed by space bar.

The Mac version will create PNG files on the desktop with these commands.  If you hold down the control key while pressing these combinations, it will put the image in the clipboard.

 
0

Simulating a slow network on a Mac

Posted by jason on Feb 12, 2010 in Mac, Ruby

I ran across these very handy commands to simulate a connection of only 4kbps.  This is helpful when developing mobile applications in particular because some cell connections are horrible.

sudo ipfw pipe 1 config bw 4KByte/s
sudo ipfw add 100 pipe 1 tcp from any to me 3000

There are several interesting parts to these commands.

The 4KByte/s which can be whatever speed you want.  This is the bandwidth, measured in [K|M]{bit/s|Byte/s}.

The other interesting part is 3000.  This is the port that will be slowed.  Port 3000 is the default port on which Ruby on Rails listens.  If you are doing Java, you would probably want to use 8080.

The 100 is the rule number.  Useful when it comes time to delete this rule.

To clear out this pipe, simply type the following when finished:

sudo ipfw delete 100

To clear all custom rules, you could type:

sudo ipfw flush

 
0

Change your Terminal prompt on Mac

Posted by jason on Dec 31, 2009 in Mac

I hate the default prompt for the Terminal in Mac.  It usually takes up most of my terminal screen real estate.  It shows me my computer name, my current directory, and who the logged in user is.  I never need to know my computer name.  I rarely need to know who the username is.  If I did “whoami” will tell me.  I do like to see my current directory though.

create/edit the .profile file.  Add the following:

export PS1="\W$"

Source it by typing

. .profile

This will create a prompt with the current directory followed by the $.  Yay.

 
0

Uninstall MySQL on Mac

Posted by jason on Dec 30, 2009 in Mac, MySQL

Somehow, I either forgot my password, or I did something to mess up my MySQL instance.  it is a development machine, so I don’t really care about the databases on it.  I just wanted to remove it completely from my machine.  I actually had two copies of mysql installed.  One from Mac Ports and the other was the package directly from MySQL for the Mac.
I used the following commands to completely remove mysql from my system.

sudo port uninstall mysql5-server
sudo port uninstall mysql5
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*

edit /etc/hostconfig and remove the line MYSQLCOM=-YES-

rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*

Thanks to Rob Allen.

 
0

Even Mac’s blue screen of death is pretty

Posted by jason on Dec 22, 2009 in Mac

Well, my hopes of my Mac never crashing were dashed.  I go the equivalent of the Windows blue screen of death.  Since this time, it has also locked up several times.  But even the Mac’s screen of death is pretty…

Mac Crash

You can’t tell from this picture, but it just looks like a dialog box that pops up on top of your desktop.  You can’t move your mouse.  You can’t type anything at your keyboard.  Your computer is just as dead as the Windows Blue Screen of Death.

 
0

Installing scripts in blender on MacOSX

Posted by admin on Aug 22, 2009 in Mac

Needed to edit a script for Blender to figure out why I can’t get it to export textures in the x3d format.  All the help on the web say to look for it in .blender/scripts but I couldn’t find such a folder on my machine.  It wasn’t in my home directory and it wasn’t in the blender folder.  This folder is actually located inside the blender.app package.  So, to edit these files or copy them you can’t use finder.  Open up a terminal and cp to where you installed Blender.  I installed it in “Applications” in a “blender” folder.  So,

cd /Application/blender/blender.app/Contents/MacOS/.blender/scripts

This is where you will find all the scripts for blender.

Copyright © 2010 programming with passion All rights reserved. Theme by Laptop Geek.