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

Chrome - prevent custom print dialog on OSX

Posted: 2014-07-27 | chrome | mac | osx

I dislike Chrome’s custom print dialog - I always end up clicking the use system print dialog button.

This kills Chrome’s custom print dialog

defaults write com.google.Chrome DisablePrintPreview -boolean true

I’m guessing (haven’t tried) that you can reset with one of

defaults write com.google.Chrome DisablePrintPreview -boolean false

or

defaults delete com.google.Chrome DisablePrintPreview
Read full article

Adobe - unable to open raw files

Posted: 2014-06-23 | adobe | lightroom | photoshop | bridge

Some chat with @AdobeCare - see this update to the post. Still not solved though


This is an issue I’ve been having since my previous iMac and Lightroom4/Photoshop CS5.

Photoshop simply can’t open raw files.

Machines

I’ve had this on my old iMac with Lightroom 4 and Photoshop CS5.

I currently have this on my current iMac with Lightroom 4 and Lightroom 5 with Photoshop CS6, Photoshop CC and now Photoshop CC 2014.

I also have it on my macbook pro with Lightroom 5, Photoshop CC and Photoshop...

Read full article

Puppet 3.6.1 - deprecation: environments

Posted: 2014-05-26 | puppet | debian

This weekend I updated puppet (master and agent) from 3.6.0 to 3.6.1 (this is on debian using the apt.puppetlabs.com repository).

This filled my logs with the following error:

puppet-master[26558]: no 'environments' in {:current_environment=>*root*, :root_environment=>*root*} at top of [[0, nil, nil]]

So - something in a point release broke.

Some digging leads to directory environments. Here we can learn that directory environments:

  • override config file environments
  • can be enabled in some...
Read full article

Postgresql sort 'WHERE id IN' by original id list order

Posted: 2014-05-02 | postgresql | rails

I’ve been testing elasticsearch in a rails project recently - and stumbled on an issue with sorting.

You see - elasticsearch returns the search results either sorted by score or by the sort order you ask for. Then you need to convert the search results to records - so a simple

ModelType.where(id: ids)

However - on postgresql - this returns the records in database order (seems to be insert order).

You could try sorting post fetch:

index = ModelType.where(id: ids).to_a.group_by(&:id)
ids.map
Read full article

Site specific chrome launcher's on OSX

Posted: 2014-04-02 | chrome | osx

I was looking for a chrome based site specific browser (SSB) for mac. This is similar to http://fluidapp.com/ but chrome based.

I ended up using the shell script makeapp.sh - I used the version from this gist - which I’ve also linked locally: makeapp.sh

You simply run the script - give it a name (no spaces), a URL and an icon and it will create an app in /Applications.

It seems to create a profile per app too - so I can e.g. have two different yammer app’s that login to different accounts....

Read full article