Mac: GPU Panic

I’ve recently had a few issues where the Mac has crashed with a “GPU Panic”.

Turns out it might be something to do with Google’s Chrome browser which uses some GPU acceleration for HTML5 updates. 

More here:

http://betanews.com/2012/06/29/google-comes-clean-yes-your-kernel-panic-is-chromes-fault/ 

and here:

http://forums.macrumors.com/showthread.php?t=1597599

For the moment I’m going to uninstall Chrome and see what happens.

Also experienced an annoying logout problem which also happens to be related to the GPU and GPU switching. If you’re using multiple GPUs then you can use gfxCardStatus to fix the Mac to 1 GPU.

http://forums.macrumors.com/showthread.php?p=13322234#post13322234

Rails: Phusion Passenger

Passenger is an application server for Ruby (Rack) and Python (WSGI) apps.

Some notes on installing it:

https://www.phusionpassenger.com/download

Ignore the docs that suggest:

$ sudo gem install passenger

$ sudo passenger-install-apache2-module

Instead use:

gem install passenger

passenger-install-apache2-module

Then paste the LoadModule code it spits out at the end into your Apache conf file.

Test whether Passenger has installed by running:

curl -sI localhost | grep ^Server

and check for the “Phusion_Passenger” signature. E.g. 

Server: Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 with Suhosin-Patch Phusion_Passenger/4.0.5 mod_ssl/2.2.22 OpenSSL/0.9.8x

If you need to uninstall Passenger using sudo then:

$ sudo gem uninstall passenger

And a discussion on whether to use rvmsudo or not here:

https://groups.google.com/forum/#!topic/rubyversionmanager/9dnmAsTiHR4

In short, https://www.phusionpassenger.com/download

suggests using sudo but the rvm page suggests not:

https://rvm.io/integration/passenger

Note:

If you get a warning doing the passenger install apache2 module like this:

rvmsudo rvm get stable && rvm reload && rvmsudo rvm repair all

Warning: can not check /etc/sudoers for secure_path, falling back to call via /usr/bin/env, this breaks rules from /etc/sudoers. Run:

    export rvmsudo_secure_path=1

Then run:

    export rvmsudo_secure_path=1

and:

rvmsudo rvm get stable && rvm reload && rvmsudo rvm repair all

(remember to run rvm requirements afterwards)

On the Mac the Apache conf and restart commands go like this:

[~]$ sudo vim /etc/apache2/httpd.conf

[~]$ sudo apachectl restart

See also:

https://developer.apple.com/library/mac/#featuredarticles/PhusionRails/_index.html

and this very useful guide:

http://jasoncodes.com/posts/mac-os-rails-server

Rails: Phusion Passenger

Passenger is an application server for Ruby (Rack) and Python (WSGI) apps.

Some notes on installing it:

https://www.phusionpassenger.com/download

Ignore the docs that suggest:

$ sudo gem install passenger

$ sudo passenger-install-apache2-module

Instead use:

gem install passenger

should be sufficient and rvm.io suggests just running:

passenger-install-apache2-module

See also:

http://stackoverflow.com/questions/17245105/passenger-module-fails-to-install

and

http://stackoverflow.com/questions/17248660/installing-passenger-use-sudo-rvmsudo-or-nothing

Then, paste the LoadModule code it spits out at the end into your Apache conf file.

Test whether Passenger has installed by running:

curl -sI localhost | grep ^Server

and check for the “Phusion_Passenger” signature. E.g. 

Server: Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 with Suhosin-Patch Phusion_Passenger/4.0.5 mod_ssl/2.2.22 OpenSSL/0.9.8x

If you need to uninstall Passenger using sudo then:

$ sudo gem uninstall passenger

And a discussion on whether to use rvmsudo or not here:

https://groups.google.com/forum/#!topic/rubyversionmanager/9dnmAsTiHR4

In short, https://www.phusionpassenger.com/download

suggests using sudo but the rvm page suggests not:

https://rvm.io/integration/passenger

Note:

If you get a warning doing the passenger install apache2 module like this:

rvmsudo rvm get stable && rvm reload && rvmsudo rvm repair all

Warning: can not check /etc/sudoers for secure_path, falling back to call via /usr/bin/env, this breaks rules from /etc/sudoers. Run:

    export rvmsudo_secure_path=1

Then run:

    export rvmsudo_secure_path=1

and:

rvmsudo rvm get stable && rvm reload && rvmsudo rvm repair all

(remember to run rvm requirements afterwards)

On the Mac the Apache conf and restart commands go like this:

[~]$ sudo vim /etc/apache2/httpd.conf

[~]$ sudo apachectl restart

See also:

https://developer.apple.com/library/mac/#featuredarticles/PhusionRails/_index.html

Linode Rails Server: Debian or Ubuntu

Debian is the oldest of the Linux distributions and has a venerable history. 

But what attracts me to Ubuntu are the LTS distributions (or Long Term Support). You get a massive 5 years of support for that distribution. So, Ubuntu 12.04 LTS will be backed till 2017! Debian will support the previous release for 1 year.

Also, Ubuntu has the backing of a commercial organisation.

See also:

http://askubuntu.com/questions/15314/debian-stable-vs-ubuntu-lts-for-server

and

http://serverfault.com/questions/389199/is-it-debian-really-more-stable-for-servers-than-ubuntu-lts

and a specific guide to setting up a Rails server on Ubuntu 12.04 here:

http://blog.lunarlogicpolska.com/2013/setup-fresh-ubuntu-server-for-ruby-on-rails/

For the process of provisioning your server, see:

https://library.linode.com/getting-started

and, for Phusion Passenger, this is a useful read:

https://developer.apple.com/library/mac/#featuredarticles/PhusionRails/_index.html

If you’re on a Mac then use PassengerPane for local Rails deployments (helps avoid cluttered /etc/hosts): 

http://www.fngtps.com/passenger-preference-pane

Hint – just use:

$ gem install passenger

$ passenger-install-apache2-module

Linode Rails Server: Debian or Ubuntu

Debian is the oldest of the Linux distributions and has a venerable history. 

But what attracts me to Ubuntu are the LTS distributions (or Long Term Support). You get a massive 5 years of support for that distribution. So, Ubuntu 12.04 LTS will be backed till 2017! Debian will support the previous release for 1 year.

Also, Ubuntu has the backing of a commercial organisation.

See also:

http://askubuntu.com/questions/15314/debian-stable-vs-ubuntu-lts-for-server

and

http://serverfault.com/questions/389199/is-it-debian-really-more-stable-for-servers-than-ubuntu-lts

and a specific guide to setting up a Rails server on Ubuntu 12.04 here:

http://blog.lunarlogicpolska.com/2013/setup-fresh-ubuntu-server-for-ruby-on-rails/

For the process of provisioning your server, see:

https://library.linode.com/getting-started

and a useful read on Phusion Passenger is:

https://developer.apple.com/library/mac/#featuredarticles/PhusionRails/_index.html

although it’s Apache-specific (e.g. it doesn’t mention Nginx).

If you’re on a Mac then use PassengerPane for local Rails deployments (helps avoid cluttered /etc/hosts): 

http://www.fngtps.com/passenger-preference-pane

Hint – just use:

$ gem install passenger

$ passenger-install-apache2-module

AutoHotKey alternative for Mac: KeyRemap4MacBook

Complex but powerful.

Don’t use it unless you’re prepared to fiddle with XML and read the docs. 

However, if you’re prepared to put in an hour you’ll reap the benefits – very useful.

Download it from:

https://pqrs.org/macosx/keyremap4macbook/index.html.en

These are handy:

Examples:

https://pqrs.org/macosx/keyremap4macbook/xml.html.en#examples

The Google Group:

https://groups.google.com/forum/#!forum/keyremap4macbook

A sample of how to do a key sequence:

https://raw.github.com/tekezo/Files/master/KeyRemap4MacBook/private.control_d_to_kill_line/private.xml

List of KeyCodes:

https://github.com/tekezo/KeyRemap4MacBook/blob/version_8.3.0/src/bridge/generator/keycode/data/KeyCode.data

List of ModifierFlags:

https://github.com/tekezo/KeyRemap4MacBook/blob/version_8.3.0/src/bridge/generator/keycode/data/ModifierFlag.data

Less handy (unless you want to plough through issues):

https://github.com/tekezo/KeyRemap4MacBook/issues