Thursday, February 26, 2009

~/.bashrc won't load in OSX terminal

While I was in my /etc/bashrc tonight setting up macports I thought of something that has always bugged me but I never really cared enough to figure out.

Why doesn't by personal bash config file (~/.bashrc) not load when I launch a terminal?

I still don't know the answer to that question, but I at least figured out a really simple hack tonight.

inside of /etc/bashrc you simply need to add the line(I added it at the end)
~/.bashrc

This will load all your personal aliased and settings right bash loads and performs the system-wide aliases and config options. If this solves all your problems, then you can go about your day and I was glad to help ^.^ But this could actually be improved upon if people care to follow along.

Depending on the contents of your ~/.bashrc file, you may need to use this line instead
. ~/.bashrc

that is, <dot><space>~/.bashrc. this executes all the commands within ~/.bashrc within the current shell process. This does not make a difference for most commands. The only only I know of is cd (change directory) which. Scripts which call the system command cd must be executed with <dot><space> in order for that change to be reflected in the shell executing the script after execution ends.

So there you go, now you can make all terminals you launch cd into your code root directory when you launch the terminal. I don't but I don't judge you ^.^

Labels: , ,

Ports!

It's been a couple months since I last formatted my computer, and I hadn't reinstalled macports until tonight. I was procrastinating because I remembered it being a pain to set up the first time. Turns out I was just a noob back then ^.^

went to the macports site and got the latest version to install. then just clicked through the install w/o any changes. It was kindof an accident. I do it a lot because I fail to see the 'customize' button in OSX installer before I click through to the next page(It's all alone in the bottom left of the window; who looks at the bottom left of windows?!). Luckily I knew that macports wants to install everything in /opt/local/bin.

All that was left was to change PATH variable to let my execute macports' apps from any directory. Another key step was to add macports' man pages to my MANPATH variable. I think that this was the part that I found confusing when I first installed macports, because I wasn't aware that MANPATH existed. None-the-less I was confused when I couldn't read man pages for the apps I ported.

yadda yadda yadda.... open my bashrc file to add these paths:
sudo vim /etc/bashrc

If you don't use vim for text-editing, I highly recommend it. To learn more you can just execute the command in the terminal:
vimtutor

The tutorial is a text file and you learn how to edit in vim it as you read it. Pretty clever, but not what we came to do.. back to bashrc.

Add the following lines to your bashrc file:
PATH="/opt/local/bin/:/opt/local/sbin/:$PATH"
MANPATH="/opt/local/man/:$MANPATH"

Save and exit your text editor(:wq in vim), and tada! All bash terminals you launch from now on will let you launch your macports apps.

To load the changes into your current terminal session type (note the space between the period and slash)
. /etc/bashrc

Thats all there is to it ^.^

Labels: , ,

Saturday, February 21, 2009

iphone update

I was just trying out updating this blog via email on my iphone. I read this guide. I don't know if you need to set up IMAP or not, but I already had on all my machines so I couldn't say for certain. The rest of it, I found, wasn't quite accurate(not to blame the author, the post is somewhat old). The mobile device setup is just at the bottum of the blogger dashboard.

All in all it was still nice to point out to me that I can update blogger(with pictures) from my iPhone.

Happy iPhone blogging everyone ^.^

Labels: ,

iCal API for OSX

I really like the way iCal looks as a desktop calendar app. the gui is pleasant and navigating is simple enough. The only part that I have never liked is creating/editing (repeating) events. I find the process of navigating to a date, clicking/dragging(which I find often can't get the precise time interval), then editing the event; which is fairly fast except for making the event repeat(because it requires clicking dragging and drop-down menus).

Seriously, nothing grinds my gears more than switching repeatedly between typing and clicking, and drop-down menus that can't be selected by tabbing. But there is hope.

I recently found the fairly thorough API that apple generously gave developers for interacting with iCal. I'm really psyched to start using it as I learn more about Xcode and Objective C. Although i'm curious if the framework could still be used in RubyCocoa; which I would like to use more often than I do.

Labels: , ,

Friday, February 20, 2009

First Post

Just set up this blog for posting about my latest crazes with programming, macs, and linux as well as comment on the news in the wold of technology. A few posts on GTD and its practices might slip in every once and a while ^.^

I set it up with my good friend emily who is going to be the next smash in the fashion word(and fashion nets). You can check her blog out at Dirty Laundry