Archive

Tag Archives: grad

Recently I have been working a lot on migrating android projects to use gradle building system. Seriously it is much better than the old time. I can easily use libraries on maven repositories and customize my building process. I also no long need to create a desperate project for testing. Awesome!

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]

Thank you for checking out this tutorial. Reading the discussions in this post, seems like there is quite a number of people having troubles to take screenshots with Galaxy S2. To clear any confusions, I summarized some information and added as followings. Hope you could make it too. Fingers crossed.

First, make sure your Galaxy S2 is running Android version 4 or above.

Volume Down + Power Key will work fine.
Press both keys at the same time gently. In about 1 second, screen capture would be done. A notification and an animation would be shown too.

Edited on 12 July.


Press and hold power and volume down button together. This is the way to take screenshot in the new Android system 4.0 Ice Cream Sandwich. After the Samsung Galaxy S2 updated to this new version, it uses this method instead of the way mentioned in my old post.

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連接

Press and hold home and tap the power button. This is the magic key for Samsung Galaxy S2 to take a screenshot. It has been such a good news for users like me who used to use iPhone. Somehow it is just the same as the iPhone setting. Actually some of the recent released mobile phone adapt this feature too, including Samsung Galaxy S2, LG Optimus 2X, LG Optimus 3D, HTC Cha Cha. Enjoy!

Today I formatted my MacBook White and installed the Snow Leopard. One reason is that I screwed up while grading from Lion Develop Preview 3 to 4. Everything about the appearance (in CoreUI framework) messed up as in the screenshot 1. As the final version of Lion is coming in the mid July, and as it only offer upgrade package from Snow Leopard. I decided to reinstall everything and back to the original. My Mac is now 10.6.8, ready to go to lion. =]

Feeling sick with your FAT32 portable harddisk which cannot store files bigger than 4G? Use ExFAT. Currently the most updated stable version of Mac OSX is 10.6.4. And it doesn’t support ExFAT formatting (except some models of Macintosh). The next version, however, support ExFAT. These days, I upgraded to the Mac OSX 10.6.5 Delta 10H555 in order to make my machine supporting ExFAT.

%d bloggers like this: