## Use growisofs instead of BraseroNovember 18, 2012

Posted by maxmil in : Uncategorized , add a comment

Brasero frequently fails to burn iso images for me. Often with an error message along the lines of
power calibration area error

If like me you use gnome and don’t want to have to bring in all the KDE libraries to use k3b in these cases the command line utility growisofs seems to work just fine

This is how you would use it to write (and close) a DVD

growisofs -dvd-compat -Z /dev/dvd /path/to/file.iso

## Mount USB with executable permissions in DebianOctober 18, 2012

Posted by maxmil in : Uncategorized , add a comment

By default gnome automounts external Fat USB drives without the exec option.

With the gconf editor there is an option to change this. However in Debian the dconf editor does’nt have this option.

Another option is to add the device to fstab with the options you desire.

First get the UUID of the device using
ls /dev/disk/by-uuid

Then add something like this to fstab
UUID=XXXXXXXXX /mnt/usb vfat user,exec,uid=1000,gid=1000 0 0

Now unmount and remount
 umount /dev/sdXX mount /mnt/usb 

## Using maven help pluginJune 28, 2012

Posted by maxmil in : Uncategorized , add a comment

I very often end up looking at the API docs for a maven plugin to consult its optional and required parameters for a given goal.

I’ve now discovered the maven help plugin which does just that but from within the shell.

For example to get documentation for the prepare goal of the release plugin

mvn help:describe -Dplugin=release -Dgoal=prepare -Dfull

## installing oc8i extension in debianApril 13, 2012

Posted by maxmil in : Uncategorized , add a comment

At the time of writing there are only the instantclient-basic and instantclient-sqlplus packages available in the debian repos.

Building the extension from source (using pecl) requires the instantclient-sdk package.

Since i could not find this for debian i used the rpm’s on oracles download site.

First convert them to deb’s using alien.

Then dpkg -i

Then pecl install oci8

Finally add the extension to the php.ini used by apache and reload apache.

## Flex memory leaks and watching property chainsSeptember 7, 2011

Posted by maxmil in : Uncategorized , add a comment

As a general rule it’s a good idea to always unset any change watchers created via BindingUtils.bindProperty or Changewatcher.watch.

However in display objects this often requires a whole lot of boilerplate code listening for when your component is removed from the stage and even more if you consider that it might be re added at a later date.

Fortunately if you create a change watcher within your display object the scope of that change watcher is limited to the scope of the display object and so it doesn’t prevent the garbage collector from removing the object and watcher when the object is removed from the stage and you can avoid the boilerplate.

However whilst profiling my app today i have discovered that if your change watcher is listening to a property chain rather than a single property then this is not the case.

In this case multiple ChangeWatchers are created that reference each other and this, for some reason unknown to me, prevents the GC from collecting the ChangeWatchers and hence your display object.

Unfortunately in this case the boilerplate seems necessary

Love to hear if anyone could explain what is happening here…

## Exclude hidden (dot) files from findJune 8, 2011

Posted by maxmil in : Uncategorized , add a comment

find . -type f ! -iname ".*"

## Setting up apache forward proxy with basic authenticationJune 7, 2011

Posted by maxmil in : Uncategorized , add a comment

To set up an apache forward proxy with username password authentication you need to add something like this to a catch all virtual host. If apache is only listening on port 80 this would be your default virtual host.

 ProxyRequests on <Proxy *> Order deny,allow Allow from all AuthType Basic AuthName "Password Required" AuthUserFile /etc/apache2/proxy.passwd Require valid-user </Proxy> 

You must obviously have mod_proxy activated in your apache.
 LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so 

 htpasswd -c /etc/apache2/proxy.passwd alice 

## at, Cron for WindowsNovember 24, 2010

Posted by maxmil in : Uncategorized , add a comment

Just had to configure a scheduled task on a Windows server and have discovered a cron equivalent: at

At the command line typing “at” shows the programmed tasks.

at 02:00 /every:M,T,W,Th,F,S,Su c:\path\to\script.bat

## Setting up SSL certificates for Chrome on DebianNovember 12, 2010

Posted by maxmil in : Uncategorized , add a comment

Just a reminder of how to set up NSS shared DB that chrome uses on Linux for authenticating certificates.

First make sure that libnss3-tools are installed:
sudo aptitude install libnss3-tools

wget -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"   wget -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"

Import them into the database

certutil -d sql:$HOME/.pki/nssdb -A -t "TC,," \ -n "CAcert.org" -i cacert-root.crt certutil -d sql:$HOME/.pki/nssdb -A -t "TC,," \ -n "CAcert.org Class 3" -i cacert-class3.crt

What is this?

-d = where the database resides
-t = trust flags. In this case T identifies these certificates as certificate issuers any certificate issued by these authorites will be trusted. The C identifies the certificate as a root CA certificate. There are three different situations in which you can define trust flags: SSL, email and object signing. Here we just define the first one SSL.
-n = nickname
-i = certificate file

\$rm cacert-root.crt cacert-class3.crt