OSX Restarting GDrive App

If you use Google Drive and the OSX app, and like me you often travel and change network connection (VPNs count as well), you may have noticed that it won’t connect anymore.

While I don’t know why exactly, it may be due to some security things in the app itself, I noticed that by restarting the app it connects successfully.

Having to do it more than once a day, here is a simple script that with a double-click will restart it.

https://github.com/davidegiannella/misc/blob/master/restart-gdrive

Install MySQL on OSX

If you need a local instance of a mysql database for experiments and don’t really care about security as it’s not any production system here’s a quick way to install a mysql database on your OSX (tested with 10.9+)

  1. Download the latest OSX native package installation from the
    download page. It should be a dmg
    file. http://dev.mysql.com/downloads/mysql/
  2. Install it as any other OSX application. It will create under
    /usr/local/mysql-x.y.z with a symlink to /usr/local/mysql the
    entire directory structure that will be needed by mysql. From now
    on I will refer as /usr/local/mysql directory.
  3. sudo rm -r /usr/local/mysql/data
  4. sudo mkdir /usr/local/mysql/data
  5. sudo chown -R <youruser> /usr/local/mysql/data
  6. /usr/local/mysql/scripts/mysql_install_db

If everything worked out fine you should be able to start it with

$ mysqld_safe &

to stop it

$ mysqladmin -u root shutdown

I’ve created a couple of aliases and exports in my ~/.profile to ease the tasks

#MySQL
 export PATH=$PATH:/usr/local/mysql/bin
 alias mysql-start="mysqld_safe &"
 alias mysql-stop="mysqladmin -u root shutdown"

WiFi disconnect while sleeping on Mavericks

Was just provided of a new laptop with Mac OS X Mavericks on it. Other than I think it’s a very bad product and made me seriously think about moving back to windows, I tried at all costs to solve the main issue I had: if the laptop goes to sleep the WiFi disconnects.

I can understand that for the majority of users this can be awesome but I simply hate it. I can have long-running process that want to have it running for the whole night.

Searched around the web here and there and tried many things. Reached the point where I think it’s not possible to disable this feature, therefore I went in disabling the Sleep completely. This made the trick in my situation.

Issue the following command on terminal:

$ sudo pmset -a sleep 0

Here’s my complete pmset settings:

$ pmset -g
Active Profiles:
Battery Power        -1*
AC Power        -1
Currently in use:
 standbydelay         10800
 standby              1
 halfdim              1
 hibernatefile        /var/vm/sleepimage
 darkwakes            0
 gpuswitch            2
 disksleep            0
 sleep                0
 autopoweroffdelay    14400
 hibernatemode        3
 autopoweroff         1
 ttyskeepawake        1
 displaysleep         2
 acwake               0
 lidwake              1

References:

Changing $PATH in Mac OS X

Two Paths Through the Tangled Japanese Forest

by Stuck in Customs via flickr

I’ve started few days ago using Mac OS X. While I still prefer Linux I appreciate the fact that I have the bash power within and I don’t have to go for cygwin anymore. However cygwin is a great tool!

The first thing I had to do was changing the PATH environment variable in my shell for having the newly installed XAMPP binaries. Here is how: edit your ~/.profile file (create it if not exists) and add/change the line export PATH=$PATH:/path/to/your/bins.

Easy! 🙂

weekly links 2010-42 & 43

Adding Google Maps to your Java Application

RE: Moving from Spring to Java EE 6: The Age of Frameworks is Over

Java deprecation on MacOSX

How To Choose A Java EE Application Server? (Mail Of The Week)

Steve Jobs Comments on Apple’s Java Discontinuation

JDK / Java 7 on Mac OS X Lion – An Interesting Business Opportunity

Generate, rename and delete getters/setters instantly in Eclipse

Already known but nice to have it detailed 🙂

What Ubuntu should mainly do for 11.04

Mozilla Confirms Firefox Zero-Day and Recommends NoScript

Ubuntu changes its desktop from GNOME to Unity

Java Mac Trojan

the interest of crackers in Apple products is raising.

Mozilla patches Firefox zero-day bug in 48 hours

Introducing JSOP

Yes, a bit old post (Aug 2010) but still interesting

Ajax user authentication and registration techniques with jQuery

Learn how to use Asynchronous JavaScript + XML (Ajax) with jQuery to authenticate and sign-in a user without refreshing the browser. Then, take it a step farther by suggesting user names to a new user who’s attempting to register with an existing user name.