Archive

Tag Archives: lion

shot

What’s happening

One day, when I opened up terminal as usual, it showed [Process completed] and just terminated. I could not type any thing, run any scripts and work on my project. Even worse, this made me unable to install programs into my computer because many installations need to run shell scripts. Okay, I searched over the internet and there was no solution for that. I even peaked many parts in the Mac OSX system to see if there were any mis-configuration, of course nothing helps. After all, I though if there is nothing wrong, it must be  something done with my /bin/bash. And after I upgraded my bash, my lovely terminal came back!

[expand title=”Let’s fix it” tag=”h5″ trigclass=”arrowright”]

Change shell’s default execution

The truth is, when you open terminal, it execute /bin/bash. As it is not working now, we need another environment for us to execute stuff. Open “Terminal->Preference”, and change “Shells open with” manually to “/bin/sh”.

Change What Shell Opens

Update /bin/bash

Now we are going to download the latest version of bash and replace the old one. Open up a new terminal and now you are able to execute commands. Copy and paste the following codes into the terminal, they will automatically handle everything for you.

	curl -LO ftp://ftp.cwru.edu/pub/bash/bash-4.2.tar.gz
	tar zxvf bash-4.2.tar.gz
	cd bash-4.2
	./configure && make && sudo make install
	chsh -s /usr/local/bin/bash {user_name}
	sudo bash -c "echo /usr/local/bin/bash >> /private/etc/shells"
	cd /bin
	sudo mv bash bash-old
	sudo ln -s /usr/local/bin/bash bash
	
Once done

Go to “Terminal->Preference” again and change :Shells open with: back to “Default login shell”. Enjoy!

[/expand]

[expand title=”Detailed explanations” tag=”h5″ trigclass=”arrowright”]

What I did?

Okay, I admit that I did something to the system sometimes ago. I was doing some experiments on “sandboxing” and played with “chroot jail” stuff before. That is, I need to create an environment with restricted support to the program I run. So I wrote a sandbox, configured it’s root to a ‘secure’ place (anywhere not the actual root), and copy essential executables to that new root. Well, so far I think I didn’t do anything harm to the system, but I might corrupt the /bin/bash when I copied it to the sandbox root.

Diagnosis

Shell will run the following files before letting user to do anything. Check everyone to see if there are any misconfigurations.

  • ~/.bash_profile (for /bin/bash)
  • ~/.profile (for /bin/sh)
  • /etc/profile (for /bin/sh)
  • /etc/bashrc (for /bin/bash)
  • (google for more)

To play with, add some echoes to see if they works. Btw, I love nano more than vi, so try out “sudo nano /etc/bashrc”.

Playing with Shell
Another thing

The code above updates your bash to version 4.2. To check if there is any new version, go to the ftp.
ftp://ftp.cwru.edu/pub/bash/

Reference

http://techscienceinterest.blogspot.com/2010/05/change-to-new-bash-shell-41-for-mac-os.html


[/expand]

Happy lunar new year to all.

I am flattered. In less than a month since I put the InstaMusic to the Android Market on 27 Dec 2011, today it has already more than 10,000 downloads. To be honest, I never expected this.

If you are uninitialized, InstaMusic is a music player android application with simple and stylish outlook.

There are all kinda music player in the world, in my opinion, a player with style and an pleasant appearance would always become the famous one. Here I would like to thank you for downloading and trying InstaMusic. Especially those fans of minimalism who supported me and AndroidStatic who gave InstaMusic a pleasant review in the post “Instamusic Is A Minimal, Slick Music Player That You Should Download Now“.

Looking back the day that I began my developmement, the reason for me to kick started is that I was really unstatisfied with the music players on the Android Market. Admittedly, I am a perfectionist and I want every part of a music player to meet user’s ways of thinking. So, I hate album artworks to be scratched and unable to tell what album is it. I also hate a song sung by different artists will be will be isolated from the album. And millions of things to list.

Okay, let’s get back to talk about the my next build of InstaMusic. I am sorry for the long waited update. In code level, I really did an upside down on InstaMusic. And as expected, lock screen player is implemented already, but there are just some bug and pressure testing work to do before it can really come out to meet its users.

Caffeine has been a very useful app to instantly disable or enable the screensaver on mac. At least for me, I am using multiple computers in office and all of them except the one I am using will usually get idle. Getting into screensaver, however, is bad sometimes especially I was reading from that screen and type things on another screen, and not to mention the password input after the screen lock. Well anyway, I highly recommend it.

Mac

On mac, we can install it easily with the app store.

Ubuntu

But in ubuntu, it is not available on the software center. But you can still get it through command line. Turn on terminal and input the following one by one.

sudo add-apt-repository ppa:caffeine-developers/ppa
sudo apt-get update
sudo apt-get install caffeine

I know it is troublesome, tedious, or just like hell. Apple has his own way to do a common task. Very often, we need to use the autocompletion in IDE to assist coding so we do not need to memorize the billions of function names. In Eclipse, everything is automatic. A list of function names linked together with descriptions next to it pops up as soon as you type. In Xcode, where is it? Yes, you need to press shortcuts. For the completions, press “control + space”. But, where are the descriptions? It’s called “quick help”, press “control + command + ?” to open it. Look at the figure then you will understand. Good luck for your fatigued fingers.

Recently my blog has been referred by winandmac.com to show how to install the Samsung Kies on Lion. I have been subscribing winandmac.com for a long time and I am so grad to be linked by this international and informative blog. And the followings are the posts. =]

English version: How to: connect Samsung Galaxy Tab 10.1 with Mac OS X Lion
Chinese version: 把Samsung Galaxy Tab 10.1與Mac OS X Lion連接

Recently I bought Samsung Galaxy S2. Samsung offer an application to synchronize files in Mac. However, the latest version cannot be installed in Lion. To tackle this, you can install an older version and then update it to the latest version. I have tested it works for this version: KiesMac_1.0.0.11055_7. Install it and then go to “Preference”->”Update” and update to the latest version. Try it and gives comments. =]

Step 1:
Download my fix file here: Download Link (Link Updated)

Step 2:
Turn OFF Mbox Mail for Mac. (If you don’t have the menu bar icon, go to “System Preference”)

Step 3:
Open the downloaded file and drag “mBoxMail” to “mBoxMail Folder”

Step 4:
Turn ON Mbox Mail for Mac

%d bloggers like this: