Thursday, September 24, 2020

signing pdfs on Linux with Xournal

 I have used Adobe Acrobat to sign pdfs on Windows, now I needed a solution for Linux or Android. Adobe Fill and Sign is available for mobiles, and its workflow lets you sign on the touchscreen with a finger or stylus. Since I had a scanned signature available, I preferred the Linux solution using Xournal. I had cleaned up the image, deleting the background in Gimp and leaving only transparency and the signature saved as a png. 

  1. File -> Annotate PDF,
  2. Choose the Image tool, click and drag inside the document to make it give the file open dialog
  3. After positioning the image, Export to PDF.

There seems to be some bugginess in the Export to PDF dialog in my version of Xournal (0.4.8), so that if I try to edit the filename in the dialog box, it fails to save. But I can just export and then edit the filename later. Howtogeek lists solutions for Mac, Windows and Linux, using Preview, Adobe Reader and Xournal respectively, and also for iOS, Chromebook and Android.

Wednesday, September 23, 2020

removing old kernel headers

An update to my previous post about clearing up disk space by clearing old kernel images - on this machine running Linux Mint 18.3, it appears purge-old-kernels was not removing the kernel headers. Following the post at https://www.pontikis.net/blog/remove-old-kernels-debian-ubuntu for the manual process, 

dpkg --list | grep linux-image

- old kernel images were being purged by purge-old-kernels

dpkg --list | grep linux-headers

- were not being purged.

So, did with

sudo apt-get --purge remove linux-headers-4.15.0-7* linux-headers-4.15.0-6* linux-headers-4.15.0-5* linux-headers-4.15.0-4* linux-headers-4.15.0-3* linux-headers-4.15.0-2*

and so on, since current kernel and previous one were linux-headers-4.15.0-118 and 117. This cleared up 3 GB or so.

Thursday, September 10, 2020

xfce startup on vnc - Ubuntu 18.04

I followed the digitalocean instructions on setting up xfce properly over vnc for the virtual machine I was running on GCP. Initially, the ~/.vnc/xstartup  file was either blank or absent, so only a bare-bones X was coming up. After adding this in the xstartup file,

#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &

xfce came up nicely. My earlier manual startup trials were missing the xrdb line, hence xfce was not starting cleanly.

Wednesday, September 09, 2020

updating a static version of a website

Emergency resuscitation for a website which had been hacked, by setting up temporary hosting on github pages - the method I used was:

1. using webhttrack - follow only 2 levels down, -*.pdf, -*.zip, 0 external levels 

2. find and replace in files using regexxer

(a) temporary-domain.com with actualdomain.name
(b) replacing js injected code when found using inspect
(c) replacing http with https (This was done later, after https was made to work.)

For html, css and js files.
*html In regexxer, Find files, open a file, Find, then choose the All Files button at the bottom.

3. Copy paste into local github repo, ignoring / overwriting existing files.

4. git add .
git commit -m "git message"
git push

github pages in directories prefixed by _ - no jekyll

Stackoverflow had an answer when I wondered by some files hosted on github pages were returning 404 errors - the solution was to place a file called .nojekyll in the root directory to enable hosting of files within directories starting with underscore, like _css etc. 

Tuesday, September 08, 2020

ad links in youtube embed code

Poking around our website and inspecting it (using Ctrl+Shift+I on Chrome, or right-click and inspect), found  that ad_status.js and googleads.g.doubleclick.net are being called. This seems to be from the youtube embed code -


Probably there is no real workaround except drastic ones like not using youtube embed code and using a link instead etc.

Edit: 19 Nov 2020 - Today, I get an email from youtube with their updated terms of service, which includes the following line which may prick quite a few people:
YouTube's right to monetize: YouTube has the right to monetize all content on the platform and ads may appear on videos from channels not in the YouTube Partner Program.