Archive

Archive for the ‘mac’ Category

Git on Mac

October 12th, 2011 No comments

Two things that I have found really useful when working with Git on a mac:

First autocomplete in terminal. When I started using Git I used the client program Github for mac, but because I found it too buggy i switched to only using the terminal. This also gives you a better understanding of what's going on. But the problem was I could not autocomplete git commands. Luckily this was really simple to add this feature.

Download this script and save it as git-completion.bash

https://github.com/git/git/raw/master/contrib/completion/git-completion.bash

Add the file to your .bash_profile

source ~/git-completion.bash

 

Then make some shortcut alias in .gitconfig

1
[Alias]

1
st = status

1
co = checkout

1
br = branch

1
ci = commit

1
rb = rebase

Remember to restart you terminal (or open a new window).

Another very useful thing is to show you working branch in the prompt. Here you just have to change your PS1 in .bash_profile. There are many ways to do this and some really nice ones are shown here:

http://asemanfar.com/Current-Git-Branch-in-Bash-Prompt

I don't see a reason to put the hostname (computername) in the prompt, so after some modification I ended up with this:

export PS1="\[\033[1;33m\]\u\[\033[01;34m\] \w \[\033[31m\]\`git branch 2> /dev/null | grep -e ^* | sed -E  s/^\\\\\\\\\*\ \(.+\)$/\(\\\\\\\\\1\)\ /\`\[\033[37m\]$\[\033[00m\] "
Categories: Bash, Git, mac Tags: ,

New phone

February 8th, 2009 No comments

Depending on the Android market and the upcoming phones supporting Andriod, I think I have found my next mobile phone. The Iphone 4G is a beauty. This is not an apple release and therefore i’m not sure how trustworthy the design image and the facts are. What I do know is that the titanium and glass design would make a perfect match with my MB Pro. Judge for you self.

http://i.gizmodo.com/5145151/iphone-4g-concept-is-a-macbook-in-a-phone

And yes, square is the new round…

 

Categories: apple, mac, tech Tags: ,

Precipitate

October 2nd, 2008 No comments

 I have much joy of the small program called precipitate which allows you to search for and launch different information you have stored in the google cloud from within spotlight. It currently supports the following services:

  • Google Bookmars
  • Google Docs

Get the program here

Categories: google, leopard, mac Tags: , , ,

Trash in Mac OSX

October 1st, 2008 1 comment

 Why is it not possible to delete a single item from the trash in Mac OSX? I use my trash as a safety bin, where I always can find stuff I should not have deleted. But when the trash exceeds a certain amount of GB, I would like to clean it up and delete some of the big files…

Categories: leopard, mac, moan Tags: , , , ,

Airport Express

March 27th, 2008 No comments

 I just received my new Airport Express and I must say I’m very satisfied. I already have a wireless network so it works as a client on the network. It is really easy to install and after a few minutes I had Trentemøller blasting my speakers,  streaming wireless from my MBP. I quickly discovered a need for using the AirTunes with other programs than iTunes. Airfoil ("Air" is the new buzzword) did the job. A small program which allow every other program to use AirTunes. I wanted to stream music from the net, so I opened the dropdown in Airfoil and selected "other programs". Now I just chose Safari and it worked like a charm.

A disadvantage with the Airport Express is the lack of support for external hard disks. The USB plug is only for printers. I guess I just have to save money for a Time Capsule.

Categories: hardware, mac, tech, Uncategorized Tags:

Hard drive crash

March 26th, 2008 No comments

 I have a 320 GB external hard drive where I store all my music and my pictures on. For my birthday I got a new external hard drive which takes power from the USB cable, meaning it’s more portable. I decided to copy all my music and pictures to the new small portable hard drive and then use the other for Time Machine. I have been looking forward to try Time Machine, so I was really excited. 

I plugged both of the external hard drives in my mac and started copying from the 320 GB to the one with 160 GB. After around copying 10 GB of my music I get an error saying "There is something wrong with this file. Can’t copy". I closed the alert box, but I could not close the window with the progress bar. It showed a progress bar but it was stuck with this one file. After some time I restarted the finder (you can’t close or stop the finder). When the finder returned, the large hard drive made a click sound and everything on the disk was gone…..

Now both my mac and my PC will not have anything to do with the hard drive. I have tried repair it, erase everything and partition the disk with disk utility in mac, but I keep getting a I/O disk error.

Can I return the hard drive to were I bought it?

I think I will partition the small hard drive into 2 volumes and use one volume for Time Machine and the other for music/picture storage.

 

Categories: hardware, mac, tech Tags:

GD Library with PHP on Leopard

March 8th, 2008 2 comments

After having spent a few hours trying to get an image uploading script to work in php on my mac, I found out that the GD Library is not pre-installed with PHP. Why is that? I thought that the GD lib was a standard module and I know it is installed in the XAMPP package for windows. I have not installed the lib yet, but I found this page which explains a how-to, but by looking at the comments it seems that it is not as simple as it should be. People are really having dififculties getting it to work. I will try to install it when I have some more time and post my result here.

Multiple screens in Leopard

January 20th, 2008 No comments

I found several funny features in Leopard when using multiple screens. This is how my setup looks like

Now when using spaces you get 8 screens to choose from. This is how the screen looks when tabbing F8.

Spaces

It is possible to drag a window to all 8 screens. I am usually not allowed to drag a window from the mac screen up on the samsung screen if the window can’t fit in the samsung screen (samsung screen only has resolution of 1152 x 870). But there is not problem dragging windows in spaces.

By holding down shift while dragging a window, the window will be placed at same position just in the new space.

The other funny thing is when taking a screenshot it will take two pictures – one of each screen. Maybe this is standard for all os’s but it is a nice feature.

Categories: leopard, mac, tech Tags:

Apple Time Capsule

January 16th, 2008 1 comment

I was pretty exited about the Apple keynote yesterday. One thing that I especially was trilled about was the Time capsule device. I have been running leopard now since it arrived in the stores and I have never enabled Time Machine, even though I really want to. I have a noname NAS box with a 320 GB hard drive and it has given me nothing but trouble. The first thing I tried when I got it was to set up a ftp server. This was supposed to be very simple (but not for a computer engineer…).

After a few hours I got it working and the problem was more of a NAT-wireless-access-point-firewall issue.The box also supports samba. This I was were exited to try and it actually worked. I was able to connect to the harddrive and use it as an external harddrive – on my windows pc…… For somehow it does not work in leopard. By reading a bunch of threads I found out that I was not the only one with the problem. I can see the disk as a shared disk and I can se the folders, but no files in the folders. Some people wrote that it had worked in Tiger, which makes it even more wired. Now I’m thinking that the Leopard team turned that feature off, because they knew about the release of Time Capsule???

Anyway, as Jobs said “wires sucks” – not specific, but that was what he meant, I think Time Capsule is pretty cool. One thing I do not understand, is why they have not build in the functionality to plug it into a Hi-Fi stereo, like the Airport Express Base Station with AirTunes. I like to keep all my music on an external hard drive (and my Ipod), but that means every time I want to listen to music over my stereo, I have to connect (with a cable) to my external hard drive, which is very inconvenient. Jobs announced that the price for a 500 GB Time Capsule would be $300. How can that be 2.299 DKK?? The exchange rate is about 5, meaning it should cost around 1.500 DKK… I think 2.299 is to expensive, so I might just buy an Airport Express Base Station..

Categories: mac, tech Tags: , , , ,