Skip to content

Instantly share code, notes, and snippets.

View aaguilera's full-sized avatar

Angel Aguilera aaguilera

View GitHub Profile
Found here: https://www.documentsnap.com/reduce-pdf-file-size-ghostscript/
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
@aaguilera
aaguilera / fuckForticlient.sh
Last active June 20, 2023 08:00 — forked from nonamed01/fuckForticlient.sh
fuckForticlient, a command-line client to connect to SAML fortivpn servers by using openfortivpn and the --cookie-in-stdin parameter
#!/bin/bash
# Uncomment the following line to debug the script:
#set -x
#####################################################################################
# fuckForticlient.sh
#
# Script to authenticate against Fortinet SAML servers using Firefox and
# openfortivpn. This replaces Forticlient for GNU/Linux completely.
# Because openfortivpn does not support SAML login (yet), this script uses Firefox
# to authenticate, grabs SVPNCOOKIE and then calls openfortivpn to setup
@aaguilera
aaguilera / markdown2pdf.sh
Created October 7, 2022 13:09
Convert Markdown to PDF via Pandoc
pandoc document.md -o document.pdf \
-V geometry:"top=2cm, bottom=1.5cm, left=2.5cm, right=1.5cm" \ # output PDF margins
--highlight-style=tango # syntax highlight theme
@aaguilera
aaguilera / spreadsheet2csv.txt
Last active February 1, 2022 22:30
Transforma un full de càlcul (XLS) a CSV amb Libreoffice amb sortida en UTF-8
#
# Adaptat d'una versió per a MacOS: https://gist.github.com/jhanschoo/bcd6d08d1e0f4b5d52735287f39ca924
#
# És de suposar que funcionaria amb tots els fulls de càlcul que suporti LibreOffice, no només amb XLS
libreoffice --headless --convert-to "csv:Text - txt - csv (StarCalc):44,34,76,1,1/1:" fitxer.xls
@aaguilera
aaguilera / retext.css
Created September 13, 2021 10:25 — forked from elclanrs/retext.css
Markdown theme for ReText
body {
color: #333;
font: normal 16px/1.3 Arial, sans-serif;
max-width: 6.5in;
margin: 0 auto;
}
a:link, a:visited {
color: #1B70D1;
text-decoration: none;
@aaguilera
aaguilera / linguistic_sort_sample.sql
Created June 30, 2020 06:26
Linguistic sort with Oracle
--
-- Sort using catalan rules
--
SELECT *
FROM software
ORDER BY NLSSORT(nom, 'NLS_SORT=catalan');
BEGIN MESSAGE.
w09MrUtY2L8Kcr8 fLFwQWTbufoW7DN hsJyyrqaGwITOHd 7GwlW4g8MgUWAzd
eJzEHwWRvvEc93f OP5aGFqZVY3TCKq 6Xr2MZHgg4efucb vl17KCkvKbCeFIz
F0hskKpwVBuI4tC FYfkBfLe8uYYQ0M DcsyJqmGSN7lmNN 526coiMRNQgSEEc
XTq5m4rJWF81g1u L12CkaW0J9DqGkD zM9Hc29HFxl.
END MESSAGE.
@aaguilera
aaguilera / keybase.md
Created April 3, 2018 08:53
Keybase verification

Keybase proof

I hereby claim:

  • I am aaguilera on github.
  • I am aaguilera (https://keybase.io/aaguilera) on keybase.
  • I have a public key ASD2_Tjsabplz-7fqxYm6ab04jpaq45Or9LNEvF9G0p0pQo

To claim this, I am signing this object:

@aaguilera
aaguilera / field.plsql
Last active August 29, 2015 14:21
Convert string into a suitable CSV field as expected by MS Excel
--
-- Convert string into a suitable CSV field as expected by
-- Microsoft Excel.
-- See http://stackoverflow.com/a/21749399/1314986.
--
FUNCTION field(str IN VARCHAR2) RETURN VARCHAR2 IS
C_NEWLINE CONSTANT CHAR(1) := '
'; -- newline is intentional
v_aux VARCHAR2(32000);
@aaguilera
aaguilera / dell_customizations.md
Last active April 8, 2017 13:24
Dell XPS 13 customizations for Ubuntu

Via command-line

Disable bluetooth:

/usr/sbin/rfkill block bluetooth

Set screen brightness:

/bin/echo 50 > /sys/class/backlight/intel_backlight/brightness