Tag Archives: Linux

Repartition a new USB drive

I want to use my new USB drive exclusively with Linux, so I decided to wipe the factory default partitions and create a new ext4 filesystem on the drive. The drive uses 4096 byte physical sectors and we have to make sure that the new partition is correctly aligned. For some background information on partition alignment, see this link.

Check that we are wiping the correct drive

sudo parted /dev/sdb unit s print free

Note the details in case you want to restore the original partitioning scheme. Information on the factory default can also be found here.

Continue reading Repartition a new USB drive

Atril (evince, document viewer) default directory for Save As

For the XFCE desktop environment Atril is the default PDF viewer and I also use it to open any PDF files from Firefox. It is a great lightweight document viewer which does what I need most of the time. One exception is when after opening a PDF file from Firefox I decide to keep the file and select File Save As. Atril insists on saving the file in $HOME/Documents, which is practically never the directory I want to use…

Continue reading Atril (evince, document viewer) default directory for Save As

Disable annoying xfce automatic maximise window feature

In xfce when you move a window around and it gets close to the top edge of the screen it suddenly jumps to maximised size – this is never what I want and so I find this feature really annoying.

The setting where this feature can be turned off is hidden in a somewhat counter intuitive location:

Yes, the setting is called ‘Accessibility – Automatically tile …’!

Recovery of scanned PDF corrupted by email transfer

Occasionally when my scanner is emailing me a PDF it gets corrupted along the way. Most of the time the individual scanned images in the PDF are either perfectly valid or at least can viewed, even though the PDF viewer refuses to open the corrupt PDF file.

The bash script below will extract the images and then combine them again into a valid new PDF file.

Continue reading Recovery of scanned PDF corrupted by email transfer

Certwatch SSL certificate expiry warning

If you have just received an e-mail similar to the one below, read on.

From: root@your.domain.org To: sysadmin@your.domain.org Subject: The certificate for server.your.domain.org will expire in 13 days Date: yesterday (BST) ################# SSL Certificate Warning ################ Certificate for hostname ‘sws.hlan.laczik.org’, in file (or by nickname): /etc/pki/tls/certs/localhost.crt The certificate needs to be renewed; this can be done using the ‘genkey’ program. Browsers will not be able to correctly connect to this web site using SSL until the certificate is renewed. ########################################################## Generated by certwatch(1)
Continue reading Certwatch SSL certificate expiry warning

Touchscreen calibration

I found that I use my laptop’s touch screen more frequently – it is particularly useful for image editing. However, when I work in my (home) office I also use a multi-screen set-up with three monitors. The problem is that the touch region of the laptop screen automatically gets scaled to the overall size of my screen, which spans multiple monitors.

Continue reading Touchscreen calibration

Send message to user logged in to an X11 session at a remote host

There are occasions when you want to contact a user working at a remote computer, but his/her phone is switched off. If the remote user is running an X11 session, and you have ssh access to the remote computer, and you have root privileges on the remote computer, here is a solution.

Continue reading Send message to user logged in to an X11 session at a remote host

Turn your desktop computer into a wireless access point

My desktop computer has a wired connection to the internet and so the built-in wifi card is normally not used. I decided to enable and use it as a wireless access point.

Unfortunately NetworkManager will only create an ad-hoc wifi network, and Android devices will only connect to infrastructure access points. Don’t ask why… A rooted Android phone or tablet can be configured to connect to an ad-hoc network, and if a separate program can configure a Linux box to act as an access point, NetworkManager should be able to do the same. As far as I can see, there are no good technical reasons for either of these deficiencies.

The solution is hostapd:

Continue reading Turn your desktop computer into a wireless access point