Friday, 30 January 2015

Integrate a Bootswatch theme into a Rails 4 app by hand

Adding yet another Gem into my application just to incorporate a Bootstrap theme (from Bootswatch)  seemed like overkill. Doing it manually was not hard…

Following the instructions for the bootstrap-sass Gem, we start with an app/assets/stylesheets/application.css.scss that looks like:

  @import "bootstrap-sprockets";
  @import "bootstrap";

Say we want to use the Yeti theme, download the _bootswatch.scss and _variables.scss files from the Bootswatch site. Place the files in a vendor/assets/stylesheets/bootswatch/yeti/ directory in your Rails project. 

Finally add the new @import statements in your app/assets/stylesheets/application.css.scss file, leaving it looking like:

  @import "bootswatch/yeti/_variables";
  @import "bootstrap-sprockets";
  @import "bootstrap";
  @import "bootswatch/yeti/_bootswatch";

The order of the imports is important. I have a comment block above those imports that reads:

  // order is important here
  // 1. theme variable overrides
  // 2. theme variables
  // 3. any core bootstrap variable overrides
  // 4. bootstrap-sockets and bootstrap
  // 5. theme styles
  // 6. application styles

Thursday, 22 January 2015

Linuxmint Dropbox icon ugly background

Linuxmint 17.1 "Rebecca"
NVidia proprietary driver (331.113)

After installing the NVidia drivers, the Dropbox icon in the system tray has (in my case) a solid black background rather than the colour of the panel.

Found the fix at http://crunchbang.org/forums/viewtopic.php?pid=414074#p414074

cd ~/.dropbox-dist/dropbox-lnx.x86_64-3.0.5
cp -p libGL.so.1 libGL.so.1.orig
ln -sf /usr/lib/nvidia-331/libGL.so.1

After that stop and start Dropbox and the icon background colour is normal

Tuesday, 14 August 2012

Mac OSX NoSleep

Little bit of Free Software to give you some control over what happens when you close your MaxBook's lid.

http://code.google.com/p/macosx-nosleep-extension/

Tuesday, 3 April 2012

Thuderbird SMTP error '5.5.4 Invalid Address' connecting to Exchange server

Using Thunderbird to connect to the Exchange server, I was getting the error:  5.5.4 Invalid Address. Turns out it's something to do with Exchange not liking the EHLO parameter generated by Thunderbird. You can override this value with the following entry in your prefs.js file (change 'smtp1' to whichever is the smtp server you need to fix):

user_pref("mail.smtpserver.smtp1.hello_argument", "your_hostname")

Monday, 27 February 2012

Cygwin cron no password

When you set Cygwin's cron up to run per-user with no password (using cyglsa), then whenever you change your Windows password, you need to:
  1. run Cygwin as the Windows Administrator (right click -> Run as administrator)
  2. run: password -R

Bitlocker in bootcamp Windows 7 on a MacBook Air (late 2010)

The MacBook Air (well at least the 11", late 2010 model) does not have a "TPM" chip, and you'll get an error if you try an enable Bitlocker on the drive. There is a work-around to disable the TPM requirement, though you will need to have a USB key handy every time you boot.


To disable the TPM requirement:
  1. Start the Group Policy Editor
  2. Go to Computer Configuration, Administrative Templates, Windows Components, BitLocker Drive Encryption, and Operating System Drives
  3. Edit the Require additional authentification at startup option
  4. Select the Enable option
  5. Run gpupdate.exe /force
Now you can enable Bitlocker.

UNFORTUNATELY, you then hit a snag with rEFIt not allowing you to boot off the USB key after Windows is installed, and the Bitlocker process requiring you to boot from the USB key to decrypt the drive. So, this process is pointless until rEFIt fixes that bug.

Sunday, 13 November 2011

Boot Camp Windows 7 (64-bit) on a Macbook Air (late 2010)

Installing Windows 7 (64-bit) on a Macbook Air (late 2010 model) via Boot Camp running Snow Leopard (10.6), I ran into porblems with the trackpad driver blue screening. Taking care with the installation process, I was able to avoid the problems.

Updating Boot Camp before Windows after the initial installation is complete is the key:
  1. Setup the partition using Boot Camp. I also use rEFIt to (a) allow installation from a USB drive, and (b) allow me to run Windows 8 in the last partition. You are only allowed 4 primary partitions, but there is a method to install Windows 7 without the extra 100MB partition it wants to create.
  2. Boot from the USB drive without any network connectivity and install Windows 7 as you normally would. If you have a network cable attached, after the installation is complete, you'll be in a race with the Windows 7 updater to install the Boot Camp update first. If you're using wifi, it's easy, just don't put your password in until Boot Camp is all up-to-date.
  3. Install the original Boot Camp WindowsSupport program, and reboot as requested.
  4. Check Windows 7 automatic updating is set to "manual", and enable your network connection.
  5. Run the Apple Software Update program and install the Boot Camp 3.2 update, and reboot as requested.
  6. Run the Apple Software Update program and install the Boot Camp 3.3 update, and reboot as requested.
  7. Install the Windows 7 SP1.
  8. Install the Windows 7 updates from Microsoft.
The same process worked for me in the Windows 8 Developer Preview installation.