tisdag 20 februari 2018

New website about fishing, hiking, off roading and camping

Nice fishing spots, pictures and maps at www.archbird.se

söndag 10 november 2013

Getting Citrix to work in FIrefox on Ubuntu 13.10

I had trouble getting Citrix to work (with Citrix Reciever) in Firefox on Ubuntu 13.10.

I got error message "SSL Error 61: You have not chosen to trust VeriSign Class 3 Public Primary Certification Authority -G5, the issuer of the server’s security certificate."

As the VeriSign Class 3 Public Primary Certification Authority -G5 certificate is already trusted in Firefox the fix for this was a simple as a symlinc to share Firefox's certificates with Citrix:

sudo ln -s /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacerts

lördag 21 april 2012

Fix: Error "Blank line" installing Lexmark printer driver on Ubuntu 12.04

The following error occured when I tried to install Lexmarks 2600 Series driver from Lexmark's  site and their package Printer Driver for Debian Package Manager based distros.

dpkg: error processing lexmark-inkjet-08-driver-1.0-1.i386.deb (--install):
parsing file '/var/lib/dpkg/tmp.ci/control' near line 9 package 'lexmark-inkjet-08-driver':
blank line in value of field 'Description'
Errors were encountered while processing:
lexmark-inkjet-08-driver-1.0-1.i386.deb


I'm using Ubuntu 12.04 but the process should be similar on other versions too. Turns out it's just a parsing error in the deb file, this is how I fixed it:

Downloaded the lexmark-inkjet-08-driver-1.0-1.i386.deb.sh.zip and extracted the lexmark-inkjet-08-driver-1.0-1.i386.deb.sh file in a directory called lexmark

Extract the contents of the sh file into a folder called lexmark_install
./lexmark-inkjet-08-driver-1.0-1.i386.deb.sh --noexec --target lexmark_install


cd lexmark_install

Untar the file called instaarchive_all
tar -xvvf instarchive_all --lzma

Bring out control.tar.gz from the deb package:
ar x lexmark-inkjet-08-driver-1.0-1.i386.deb control.tar.gz

Untar control.tar.gz
tar xf control.tar.gz

Edit the file control (for example with gedit)
gedit control

It will look similar to this:
Package: lexmark-inkjet-08-driver
Version: 1.0-1
Section: non-free
Priority: optional
Architecture: i386
Installed-Size:
Maintainer: build <build@linux>
Description:
Lexmark Z2300/X2600 Drivers Package

This package contains the Lexmark Z2300/X2600 Drivers. This is

a copyrighted package, please refer to the copyright notice
for details about using this product.

The problem is the blank lines in description, I just removed most of it making it look like this:
Package: lexmark-inkjet-08-driver
Version: 1.0-1
Section: non-free
Priority: optional
Architecture: i386
Installed-Size:
Maintainer: build <build@linux>
Description: Lexmark Z2300/X2600 Drivers Package


Then, add the files back to control.tar.gz
tar cfz control.tar.gz ./control ./postinst ./prerm ./preinst

Add control.tar.gz back to the deb file:
ar r lexmark-inkjet-08-driver-1.0-1.i386.deb control.tar.gz

And finally, install the deb
sudo dpkg --install lexmark-inkjet-08-driver-1.0-1.i386.deb

This is it! If it works your done!

http://archbird.se/lexmark_printer_driver.php

söndag 20 november 2011

Repair broken filesystem on Ubuntu

I recently encountered a problem with my laptop running Ubuntu 11.04. Grub got corrupted and apperently the file system too. All I got when booting was a Busybox shell. Luckily I came across this solution.
  1. Boot a Ubuntu Live cd (or in my case a USB stick, created with Unetbootin) 
  2. Run chfsk -v /dev/sdx (where sdx is your broken partition) 
  3. Just answer yes on all the questions that comes up, and reboot! It fixed my problem.

torsdag 23 september 2010

JavaScript: Switch values in form fields

I have two text fields in a form - "foo" and "bar", and I wanted to add a button to easily switch the values, so that "foo" becomes "bar" and vice versa. This is my JavaScript approach on how to do this:

function switchas() {
var oldFoo = document.getElementById('foo');
var oldBar = document.getElementById('bar');
oldFoo = oldFoo.value;
oldBar = oldBar.value;
document.myForm.elements["foo"].value = oldFoo;
document.myForm.elements["bar"].value = oldBar;
// Uncomment following line for autosubmit
// document.myForm.submit();
}

And the HTML looking like this:

<a href="#" onclick="switchas();">Switch</a>
<form action="#" method="post" name="myForm">
<input id="foo" name="foo" value="foo" type="text">
<input id="bar" name="bar" value="bar" type="text">
</form>