chrisspeck.com

Chris' random ramblings

Setting up a Brother HL-2140 printer on Ubuntu 11.04 64bit

This took a bit of detective work and piecing of various posts together, but basically:

sudo apt-get install ia32-libs
sudo mkdir /usr/share/cups/model/
mkdir ~/scratch
mkdir ~/scratch/brother
cd ~/scratch/brother
wget http://www.brother.com/pub/bsc/linux/dlf/brhl2140lpr-2.0.2-1.i386.deb
wget http://www.brother.com/pub/bsc/linux/dlf/cupswrapperHL2140-2.0.2-1.i386.deb
dpkg -x brhl2140lpr-2.0.2-1.i386.deb common
dpkg --control brhl2140lpr-2.0.2-1.i386.deb
vim DEBIAN/control #(remove the "Dependency: libc ..." line)
cp -a DEBIAN/ common/
dpkg -b common brhl2140lpr-2.0.2-1.i386.deb
sudo dpkg --force-all -i brhl2140lpr-2.0.2-1.i386.deb
rm -rf common/ DEBIAN/
dpkg -x cupswrapperHL2140-2.0.2-1.i386.deb common
dpkg --control cupswrapperHL2140-2.0.2-1.i386.deb
vim DEBIAN/control #(remove the "Dependency: libc ..." line)
cp -a DEBIAN/ common/
dpkg -b common/ cupswrapperHL2140-2.0.2-1.i386.deb
sudo dpkg --force-all -i cupswrapperHL2140-2.0.2-1.i386.deb
posted by specky in IT and have Comment (1)

Using GNU screen in a start-up script

As per this serverfault answer, use the following syntax:

screen -d -m -S [WhateverSessionName] [WhateverCommandsYouWant PlusAnyArgs]
posted by specky in IT and have No Comments

Setting password for Webmin after install on Ubuntu

1. Run this:

sudo /usr/share/webmin/changepass.pl /etc/webmin root [password]

2. Login to webmin at https://localhost:10000. Expand the group Webmin, then Webmin Users.

3. Create a group call “WebminRootUsers” or the like. Click through and allow that group access to as many Webmin modules as you like.

4. Create new webmin users, and add them to the newly created group.

5. Test that the new user accounts work.

6. sudo vim or sudo gedit /etc/webmin/miniserv.users, the line with root should look like “root:x:0″ (which is the default).

posted by specky in IT and have No Comments

Steps to create a Content Provider in Android

1. Define strings for provider mime type, item mime type & for authority

    <string name="[OBJECT]_CONTENT_TYPE">vnd.android.cursor.item/vnd.[initials].[object]</string>
    <string name="[OBJECT]_CONTENT_TYPE_DIR">vnd.android.cursor.dir/vnd.[initials].[object]</string>
    <string name="[OBJECT]_CONTENT_COMMENT_DIR_URI">"content://com.[initials].[object]Provider/[object]"</string>
    <string name="[OBJECT]_CONTENT_COMMENT_AUTHORITY">"com.[initials].[object]Provider"</string>

2. Create metadata class

3. Create authority and sql helper private class

4. Define authority in androidmanifest.xml

<provider android:name="[Object]Provider" android:label="@string/app_name"                      android:authorities="@string/[OBJECT]_CONTENT_COMMENT_AUTHORITY"></provider>

5. profit

That is all.

posted by specky in Programming and have Comment (1)

Troubleshooting Gallery2 HTTP Status 500 Internal Server Errors

If you are receiving a “HTTP Status 500 Internal Server Error” when trying to Edit or view a Gallery2 setup, you would ought to check whether your choice of graphics toolkit is the cause of the error.

In a gallery I was setting this morning, the “Gd” graphics toolkit was causing the site to crash because of a time-out which arose when Gallery2 attempted to use Gd to generate a thumbnail.

The fix is to fight your way to the Admin/Plugins page, configure and activate the ImageMagick plugin, and deactivate (& delete) the Gd plugin.

Incidentally, the only way to trouble-shoot Gallery2 when it is in this condition is to:

  1. Check your host’s error log for any errors generated by the PHP scripts and/or Apache; and
  2. Activate Gallery2′s immediate debug mode.

Immediate debug mode should at least generate output, the last line of which should indicate where/why Gallery2 has died.

Finally, if you are running on a Linux Host / LAMP stack and you want to use a local php.ini, you must put the following line in the  .htaccess file:

SetEnv PHPRC /path/to/httpdocs/
posted by specky in IT,Programming and have No Comments