Skip to content

Instantly share code, notes, and snippets.

View ntfc's full-sized avatar

Nuno Carvalho ntfc

View GitHub Profile
ntfc /
Last active May 2, 2017 21:52
Add watermark and sign PDFs

How to add a simple watermark to PDF

  1. Use Inkscape to create a single page PDF with a semi-transparent text. This will be stamped on the final PDF document
  2. Use pdftk as follows:
pdftk in.pdf multistamp stamp.pdf output out.pdf

Add your signature to PDF

ntfc /
Created February 14, 2017 18:06
Auto re-connect to Nova Arcada's Free Wi-fi
#!/usr/bin/env bash
# TODO: wait for no Internet connection to run this script
set -x
while true
ABC=$(curl -L -I | grep '^Location' | awk '{print $2}' | grep -o 'loginurl=.*$' | cut -d'=' -f2)
ntfc /
Created November 19, 2016 22:58
Used to synchronize photos between a syncthing share folder and an actual Photos folder
#!/usr/bin/env bash
# Synchronize two photo folders using rsync.
# * Handles moves by:
# 1. See if a file to be synched is already on target (with the same name)
# 2. If file is already on target, compare checksums.
# 2a- If checksums match, it was a file move, so delete file from target
# 2b- If checksums don't match, we are possibly talking about different files
# * Deletions are not synchronized to keep all files on target

Issue with asciidoctor-maven-plugin

Table of Contents



<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""
ntfc /
Last active May 24, 2021 08:10
arch linux installation steps
ntfc /
Last active September 29, 2017 08:44
Vagrant & Ansible


Install these packages to mount host volumes on the VMs

  • virtualbox
  • virtualbox-host-modules
  • virtualbox-guest-modules
  • virtualbox-guest-iso
  • virtualbox-guest-utils

Load modules:

ntfc /
Last active August 29, 2015 14:18
Vagrant + VirtualBox guest additions

If when issuing vagrant up you come across with a VirtualBox Guest Additions problem (version mismatch, or vagrant-vbguest auto-installation fails) try the following:

  • Install vagrant-vbguest
  • vagrant ssh to the machine, and install Guest Additions manualy
  • vagrant ssh to the machine, run yum install kernel-devel, and reboot (or install Guest Additions manually)
  • If all the previous fails, vagrant ssh to the machine, yum update and then try to install Guest Additions again
ntfc / UMLogo.tex
Created September 16, 2014 15:05
UM Logo
% UM_ENg Logo
% define colors
% greyscaled logos
% bars styling,
ntfc / UMCover.tex
Created September 16, 2014 15:05
UM Cover
%!TEX root = MSc_VM_Dissertation.tex
% define extra colors