April's Fool 2012 by BitBucket
01 Apr 2012
A funny April's fool joke by BitBucket
</center>
This tutorial will use MacPorts, so please first of all make sure you have XCode installed as it will be needed for MacPorts (and many other things too if you are a developer and you probably are if you are reading this)
You can see how to install MacPorts here
Let's install MongoDB. It's one easy command with MacPorts
$ sudo port install mongodb
***If you had MacPorts installed before, consider updating it
$ sudo vim /etc/mongodb.conf
*** you can use nano instead of vim if you prefer
sudo nano /etc/mongodb.conf
Paste the following into the
mongodb.conf
and save the file.
```bash # This is an example config file for MongoDB. # Place it at /etc/mongodb.conf # Based on a sample provided at # http://www.mongodb.org/display/DOCS/File+Based+Configuration dbpath = /var/lib/mongodb bind_ip = 127.0.0.1 noauth = true ```After you are finished installing MongoDB via MacPorts, you should see the following notice:
```bash ########################################################### # A startup item has been generated that will aid in # starting mongodb with launchd. It is disabled # by default. Execute the following command to start it, # and to cause it to launch at startup: # # sudo port load mongodb ########################################################### ```so running
```bash $ sudo port load mongodb ```should get you setup with automatic start of mongo.
To start it manually you should create the following file:
/Library/LaunchDaemons/org.mongo.mongod.plist
and populate it with the following:
```xml <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">to launch MongoDB on demand you will need run:
```bash $ sudo launchctl load /Library/LaunchDaemons/org.mongo.mongod.plist ```once you've done the above and MongoDB is either autostarted or you created the start script and started it manually, you should be able to run
mongo
to get to the MongoDB shell:
You will see the following prompt:
1. Installation base ($prefix) : /Users/Admin/pear 2. Temporary directory for processing : /tmp/pear/install 3. Temporary directory for downloads : /tmp/pear/install 4. Binaries directory : /Users/Admin/pear/bin 5. PHP code directory ($php_dir) : /Users/Admin/pear/share/pear 6. Documentation directory : /Users/Admin/pear/docs 7. Data directory : /Users/Admin/pear/data 8. User-modifiable configuration files directory : /Users/Admin/pear/cfg 9. Public Web Files directory : /Users/Admin/pear/www 10. Tests directory : /Users/Admin/pear/tests 11. Name of configuration file : /Users/Admin/.pearrc 1-11, 'all' or Enter to continue:
Type 1 and then type /usr/local/pear
You will get the previous prompt but with different path values
1. Installation base ($prefix) : /usr/local/pear 2. Temporary directory for processing : /tmp/pear/install 3. Temporary directory for downloads : /tmp/pear/install 4. Binaries directory : /usr/local/pear/bin 5. PHP code directory ($php_dir) : /usr/local/pear/share/pear 6. Documentation directory : /usr/local/pear/docs 7. Data directory : /usr/local/pear/data 8. User-modifiable configuration files directory : /usr/local/pear/cfg 9. Public Web Files directory : /usr/local/pear/www 10. Tests directory : /usr/local/pear/tests 11. Name of configuration file : /Users/Admin/.pearrc 1-11, 'all' or Enter to continue:
Type 1 and then type /etc/pearrc
Now type
Now you need to run:
```bash $ sudo /usr/local/pear/bin/pecl install mongo ```Configure the system PHP to load MongoDB extension.
Add this line to your php.ini:
extension=mongo.so
Restart Apache:
```bash $ sudo apachectl graceful ```You should be all set to go... Enjoy!
TextWrangler already installs the command line utility "edit" so the hardest pard is done, if you did not install it for some reason, then just go to "TextWrangler --> Install Command Line Tools..." and you should be all set with this part.
To make Git play nice (or should I rather say TextWrangler play nice with Git), we need to properly set it up as the default editor for Git. And luckily it's as easy as
git config --global core.editor "edit --wait --resume "$@""
So you bought the Kindle Fire and you want to start running and debugging your apps on it but when you connected it, you realized that it is not recognized automatically like other Android devices on OS X.
No worries, it takes 2 minutes to set it up.
You need to:
Open up the terminal and edit the "adb_usb.ini" (you can use nano instead of vim): vim ~/.android/adb_usb.ini
add the following 2 lines to the file each on a separate line:
now you need to restart the ADB server and you should be all set.
The whole sequence of commands looks like this:
Now you should also see the device while running your app from Eclipse
For the official directions in case you need them and for directions for other OS besides OS X, you can check out this PDF
Important tip:
The networking will not work until you "disconnect" the device from USB - just click on "Disconnect" don't worry it will only cancel the "file transfer mode". You will still be able to deploy and now actually run apps that require networking.
In the terminal run:
defaults write org.eclipse.eclipse AppleAntiAliasingThreshold 20
edit $ECLIPSE_HOME » Eclipse.app » Contents » MacOS » eclipse.ini and remove the following line:
-Dorg.eclipse.swt.internal.carbon.smallFonts
Very nice graphics for the Android DevCamp
Going to be at the Cambridge office this w-end hacking away. If you are in the Greater Boston area and want to attent you can register here: http://devcampbostongtug.eventbrite.com/
For all the locations around the world you can go here.
An interesting marketing stunt performed by Microsoft's marketing at CES - betting people $100 that they won't be as fast on their phone compared to Windows Phone to perform some task like posting information to social networks, checking weather, finding a place to eat etc...
To top that, everyone who got smoked got a brand new Windows Phone. Microsoft you are moving in the right direction!
A compilation of mobile UI resources:
Enjoy! :)