Keeping Linux Users In A MySQL Database With libpam-mysql On Ubuntu

I want to have a set of users on my Ubuntu 10.4 Lucid Lynx box managed by MySQL, rather than LDAP for a change which means delving in to the sexy world that is libpam-mysql!

As ever, the first thing that we need are packages! Remember when installing mysql-server to set a strong root MySQL password. As we’re managing user accounts in MySQL we need to really make sure everything is locked down tight!

Read more →

Disk Quotas On Ubuntu

I’ve recently needed to add disk usage quotas to a server in order to limit how much data users can store so as not to affect the quality of service for other users.

Linux has a method called quota which can help you do this.

Ubuntu provides some packaged tools which let you manage quotas

apt-get install quota

To enable quotas on a partition the first step is to edit the /etc/fstab entry for the partition and append usrquota to it so the kernel knows to manage that partition using quotas.

Read more →

Unique Article Wizard needs strip slashes!

I’m playing about with the Unique Article Wizard plugin for WordPress (for a friend, not for this site!!!) and there’s an obvious problem where all of the articles need their slashes to be stripped. It looks like a serious case of magic quote paranoia!

A look at the plugin code makes article_mods.php the obvious candidate for tweaking:

Change lines 370 – 384 from

<br /> $uawarticle_id = wp_update_post(array (<br /> 'ID' => $pageposts[0]->post_id,<br /> 'post_author' => $uawuser_id,<br /> 'post_title' => stripslashes($title),<br /> 'post_content' => stripslashes($article . "\n\n\n\n" . $_REQUEST['resource_box']."\n\ncategories: ".$_REQUEST['keywords']) ,<br /> 'post_excerpt' => stripslashes(stripslashes($description)),<br /> 'post_type' => 'post',<br /> 'post_status' => $uawstatus,<br /> 'post_modified_date' => date("Y-m-d H:i:s"),<br /> 'post_modified_date_gmt' => gmdate("Y-m-d H:i:s"),<br /> 'post_category' => array (<br /> $uawcategory_id<br /> ),<br />

Read more →

Canon EOS Utility On A Mac Without A CD

Canon have a fantastic little app, which works on both Windows and Mac, called EOS Utility, which among other things allows you to do time lapse photography!

I lost my CD ages ago, because you know … everyone knows that all responsible companies let you download support tools from their website ..

Unfortunately no one informed Canon of this amazing new way of thinking, and they only let you download an update for the EOS Utility application, which throws a massive hissy fit if you try to install it on a machine that doesn’t already have it installed!

Read more →

Slow SSH and SCP connections on Ubuntu

My home Ubuntu Jaunty installation often takes a good 40-60 seconds to connect to using SSH, none of the other servers I maintain have this same problem, they’re pretty much instantaneous, and today, on a Friday evening at 1am this irked me enough to fix it!

The first step is of course to make the SSH connection with debug output on.

<br /> Chill:~ idimmu$ ssh -v cordy<br /> OpenSSH_5.2p1, OpenSSL 0.9.7l 28 Sep 2006<br /> debug1: Reading configuration data /Users/idimmu/.ssh/config<br /> debug1: Reading configuration data /etc/ssh_config<br /> debug1: Connecting to cordy [192.168.0.10] port 22.<br /> debug1: Connection established.<br /> debug1: identity file /Users/idimmu/.ssh/identity type -1<br /> debug1: identity file /Users/idimmu/.ssh/id_rsa type -1<br /> debug1: identity file /Users/idimmu/.ssh/id_dsa type 2<br /> debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5ubuntu1<br /> debug1: match: OpenSSH_5.1p1 Debian-5ubuntu1 pat OpenSSH*<br /> debug1: Enabling compatibility mode for protocol 2.0<br /> debug1: Local version string SSH-2.0-OpenSSH_5.2<br /> debug1: SSH2_MSG_KEXINIT sent<br /> debug1: SSH2_MSG_KEXINIT received<br /> debug1: kex: server->client aes128-ctr hmac-md5 none<br /> debug1: kex: client->server aes128-ctr hmac-md5 none<br /> debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<br /> debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP<br /> debug1: SSH2_MSG_KEX_DH_GEX_INIT sent<br /> debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY<br /> debug1: Host 'cordy' is known and matches the RSA host key.<br /> debug1: Found key in /Users/idimmu/.ssh/known_hosts:7<br /> debug1: ssh_rsa_verify: signature correct<br /> debug1: SSH2_MSG_NEWKEYS sent<br /> debug1: expecting SSH2_MSG_NEWKEYS<br /> debug1: SSH2_MSG_NEWKEYS received<br /> debug1: SSH2_MSG_SERVICE_REQUEST sent<br /> debug1: SSH2_MSG_SERVICE_ACCEPT received

Read more →

Proper use of grails:exec

Whilst trying to run mvn grails:exec with more complicated requests it kept erroring:

<br /> Chill:superted idimmu$ mvn grails:exec -Dcommand="jack-be-nimble net.idimmu User Profile"<br /> [INFO] Scanning for projects...<br /> [INFO] Searching repository for plugin with prefix: 'grails'.<br /> [INFO] ------------------------------------------------------------------------<br /> [INFO] Building Unnamed - net.idimmu:gymlife:war:1.0-SNAPSHOT<br /> [INFO] task-segment: [grails:exec] (aggregator-style)<br /> [INFO] ------------------------------------------------------------------------<br /> [INFO] [grails:exec]<br /> [INFO] Using Grails 1.2.0<br /> Running pre-compiled script<br /> [INFO] ------------------------------------------------------------------------<br /> [ERROR] BUILD ERROR<br /> [INFO] ------------------------------------------------------------------------<br /> [INFO] Unable to start Grails
Embedded error: java.lang.reflect.InvocationTargetException
[INFO] ————————————————————————
[INFO] For more information, run Maven with the -e switch
[INFO] ————————————————————————
[INFO] Total time: 14 seconds
[INFO] Finished at: Thu Jan 07 22:49:41 GMT 2010
[INFO] Final Memory: 32M/81M
[INFO] ————————————————————————

Read more →

Latest release information is not available for plugin ‘nimble’, specify concrete release to install

Whilst trying to install the Nimble plugin for Grails using Maven I ran in to a spot of bother!

<br /> Chill:superted idimmu$ mvn grails:install-plugin -DpluginName=nimble<br /> [INFO] Scanning for projects...<br /> [INFO] Searching repository for plugin with prefix: 'grails'.<br /> [INFO] ------------------------------------------------------------------------<br /> [INFO] Building Unnamed - idimmu.net:superted:war:1.0-SNAPSHOT<br /> [INFO] task-segment: [grails:install-plugin] (aggregator-style)<br /> [INFO] ------------------------------------------------------------------------<br /> [INFO] [grails:install-plugin]<br /> [INFO] Using Grails 1.2.0<br /> Running pre-compiled script<br /> Environment set to development<br /> Reading remote plugin list ...<br /> Reading remote plugin list ...<br /> Latest release information is not available for plugin 'nimble', specify concrete release to install<br />

Read more →

Integrating Grails and Maven

I’ve started investigating Grails for some projects and have been making some good headway and I like to use Maven for everything as it’s amazing, and generating projects is easy.

<br /> Chill:stsworkspace idimmu$ mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.grails -DarchetypeArtifactId=grails-maven-archetype -DarchetypeVersion=1.2.0 -DgroupId=idimmu.net -DartifactId=superted<br /> [INFO] Scanning for projects...<br /> [INFO] ------------------------------------------------------------------------<br /> [INFO] Building Maven Default Project<br /> [INFO] task-segment: [org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate] (aggregator-style)<br /> [INFO] ------------------------------------------------------------------------<br /> [INFO] Preparing archetype:generate<br /> [INFO] No goals needed for project - skipping<br /> [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.<br /> [INFO] Setting property: velocimacro.messages.on => 'false'.<br /> [INFO] Setting property: resource.loader => 'classpath'.<br /> [INFO] Setting property: resource.manager.logwhenfound => 'false'.<br /> [INFO] [archetype:generate]<br /> [INFO] Generating project in Interactive mode<br /> [WARNING] No archetype repository found. Falling back to central repository (https://repo1.maven.org/maven2).<br /> [WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.<br /> Define value for version: 1.0-SNAPSHOT: :<br /> Confirm properties configuration:<br /> groupId: idimmu.net<br /> artifactId: superted<br /> version: 1.0-SNAPSHOT<br /> package: idimmu.net<br /> Y: :<br /> [INFO] ----------------------------------------------------------------------------<br /> [INFO] Using following parameters for creating OldArchetype: grails-maven-archetype:1.2.0<br /> [INFO] ----------------------------------------------------------------------------<br /> [INFO] Parameter: groupId, Value: idimmu.net<br /> [INFO] Parameter: packageName, Value: idimmu.net<br /> [INFO] Parameter: package, Value: idimmu.net<br /> [INFO] Parameter: artifactId, Value: superted<br /> [INFO] Parameter: basedir, Value: /Users/idimmu/Documents/stsworkspace<br /> [INFO] Parameter: version, Value: 1.0-SNAPSHOT<br /> [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 147,column 20] : ${java.version} is not a valid reference.<br /> [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 149,column 23] : ${java.home} is not a valid reference.<br /> [INFO] ********************* End of debug info from resources from generated POM ***********************<br /> [INFO] OldArchetype created in dir: /Users/idimmu/Documents/stsworkspace/superted<br /> [INFO] ------------------------------------------------------------------------<br /> [INFO] BUILD SUCCESSFUL<br /> [INFO] ------------------------------------------------------------------------<br /> [INFO] Total time: 15 seconds<br /> [INFO] Finished at: Thu Jan 07 21:45:39 GMT 2010<br /> [INFO] Final Memory: 12M/79M<br /> [INFO] ------------------------------------------------------------------------<br />

Read more →