Skip to content

Instantly share code, notes, and snippets.

View ntfc's full-sized avatar

Nuno Carvalho ntfc

View GitHub Profile
@ntfc
ntfc / watermark-pdf.md
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
ntfc / auto-connect.sh
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
do
ABC=$(curl -L -I www.abola.pt | grep '^Location' | awk '{print $2}' | grep -o 'loginurl=.*$' | cut -d'=' -f2)
@ntfc
ntfc / sync-photos.sh
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

Issue

Chapter

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.ntfc</groupId>
<artifactId>asciidoc-diagrams-issue</artifactId>
<version>1.0-SNAPSHOT</version>
@ntfc
ntfc / steps.md
Last active May 24, 2021 08:10
arch linux installation steps
@ntfc
ntfc / vagrant_ansible.md
Last active September 29, 2017 08:44
Vagrant & Ansible

VirtualBox

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
ntfc / README.md
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
ntfc / UMLogo.tex
Created September 16, 2014 15:05
UM Logo
% UM_ENg Logo
\DeclareRobustCommand{\UMEng}[1][normal]{
% define colors
\ifstrequal{#1}{grey}{%
% greyscaled logos
\definecolor{eng}{rgb}{0.61,0.6,0.6}
\definecolor{um}{rgb}{0.61,0.6,0.6}
\begin{tikzpicture}[%
% bars styling,
@ntfc
ntfc / UMCover.tex
Created September 16, 2014 15:05
UM Cover
%!TEX root = MSc_VM_Dissertation.tex
% define extra colors
\definecolor{lightergrey}{rgb}{0.68,0.67,0.68}
\definecolor{grey}{rgb}{0.61,0.6,0.6}
\newfontfamily\MyTitle[
Ligatures=TeX,
Extension=.ttf,
Path=Fonts/,