Migrating to chruby

Posted: 2016-03-09 | ruby | rvm | rbenv | chruby | ruby-build | ruby-install | bundler

Migration

Up until recently I have been using rbenv as my ruby install manager (along with ruby-build).

I switched to this a long time back from rvm - with rvm I was having a number of issues with library versions of iconv, xml etc that rbenv didn’t seem to have.

Yesterday I heard about chruby - which does not rely on shimmed binaries - it simply changes the environment (PATH etc) to point to the ruby you want. This seems a lot simpler/cleaner conceptually.

Since ruby-build is written alongside...

Read full article

Connecting to heroku postgres with DataGrip (and other jetbrains apps)

Posted: 2016-02-08 | heroku | postgresql | datagrip | jetbrains | intellij

DataGrip (and the other jetbrains apps) were refusing to connect to heroku postgresql databases even though the connection was correct.

Turns out that you must have SSL enabled but can’t validate the certificate.

Add the following properties to the datasource advanced settings:

Name Value
ssltrue
sslfactoryorg.postgresql.ssl.NonValidatingFactory

Or to the url

?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
Read full article

iOS Game Center blank screen/settings hang

Posted: 2016-02-05 | ios | apple | game center

I occasionally see that games using game center for data sync etc stop being able to log in. If I head to the settings app > game center - it can’t open the page for the game center settings.

This was originally a problem in iOS 9.0, thought to be fixed in iOS 9.1 but still being experienced (my last was in iOS 9.2.1).

The trick is to sign out of game center then back in - but how to do so when you can’t open the settings?

The solution at the end of this article on appletoolbox.com worked for...

Read full article

Upgrading homebrew postgres

Posted: 2016-01-11 | postgresql | pg_upgrade | homebrew

Homebrew postgresql updated from 9.4.x to 9.5.x today.

This meant that after update it wouldn’t start because the database needed upgrading.

I started with this article - which in summary would be:

pg_upgrade method

Stop and upgrade

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
brew update && brew upgrade postgresql

Create empty db

initdb /usr/local/var/postgres9.5 -E utf8

Upgrade db

pg_upgrade \
  -d /usr/local/var/postgres \
  -D /usr/local/var/postgres9.5 \...
Read full article

Cisco SB SG200-08 Gigabit Smart Switch

Posted: 2015-10-30 | cisco | networking | switch | snmp

One of my switches died recently - an 8 port unmanaged gigabit switch.

I thought that this time I’d get one that supports link aggregation (the synology NAS behind it could use it) and settled for Cisco’s SG200-08 - since I could get that by the next day.

It’s a managed switch (first time for me) and it works fine.

Only one thing that wasn’t expected - it appears that nearly all of Cisco’s SG200 range support SNMP (some might need a firmware update) but not this one. It even has a different...

Read full article

Replacing denyhosts with fail2ban for debian

Posted: 2015-06-16 | debian | ssh | denyhosts | fail2ban

Preparing for migration from debian wheezy to debian jessie and one of the packages I use is no longer supported.

Denyhosts is something that I used to block incoming ssh attacks (it adds IP addresses to /etc/hosts.deny). But it is not available in Jessie. The security team had the following comments:

  • There are unaddressed security issues (e.g. #692229).
  • The tool is dead upstream (last release 2008).
  • There is a viable alternative, fail2ban, that provides the same or increased feature set.

So - time to look at fail2ban.

Read full article

Switching java version on mac

Posted: 2015-01-29 | java | osx | mac

Can’t remember where I picked this up - but some handy aliases I use for setting java version (given that you have the required version installed):

alias j6='export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)'
alias j7='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)'
alias j8='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'

This handles picking the right version (1.6 from apple, 1.7 and 1.8 from oracle) etc.

Read full article

Wipe a fusion drive

Posted: 2015-01-01 | osx | fusion | diskutil | mac

Background

So - my iMac was misbehaving recently and diskutil stated that the disk needed repair.

This is not usually so big an issue - boot to recovery - start diskutil and repair.

However - this time it stated that it couldn’t repair the disk even from a recovery boot.

Intention

Since this has been upgraded a couple of times - I thought I’d make a nice clean start. Created a complete running backup on a USB disk with SuperDuper, create a bootable USB disk with Diskmaker X (yes - I know you can do it by hand but this makes it a lot simpler) and then wipe the disk completely.

So - backup made - boot to USB disk. Start disk utility - and get the message that it can’t partition the fusion disk (create a new clean partition).

What to do?

Googling led me to the following info. It appears that a fusion drive is based on the concepts of a logical volume system similar to lvm - but managed with diskutil.

Read full article

Replace ssmtp with postfix null client

Posted: 2014-10-21 | mail | gmail | ssmtp | postfix

I’ve been using ssmtp to provide outgoing mail to two machines. This provides a simple way to send mail out using gmail without having to have a running mail server. It had the restriction that you had to log in to gmail to use it.

Recently for one of those machines this stopped working with a login failure. The same configuration worked on different machines as long as the machine’s IP address was different. This suggests that it is in fact being blocked and could be due to sending more than...

Read full article

sSMTP and Gmail - authentication suddenly failing

Posted: 2014-09-30 | mail | gmail | google | smtp | ssmtp

I’ve been running sSMTP as my mailer daemon for a long time using my google apps domain as mail server.

The config for this was pretty simple - /etc/ssmtp/ssmtp.conf:

root=me@my.domain.tld

mailhub=smtp.gmail.com:587

rewriteDomain=domain.tld

hostname=server.domain.tld

FromLineOverride=YES

AuthUser=notifications@domain.tld
AuthPass=users-gmail-password
AuthMethod=LOGIN

UseTLS=YES
UseSTARTTLS=YES

This has been working fine.

Recently I noticed mail was not getting through. I now see in the...

Read full article