Skip to content

Instantly share code, notes, and snippets.

View andsala's full-sized avatar
👨‍💻
Coding

Andrea Salamone andsala

👨‍💻
Coding
View GitHub Profile

Keybase proof

I hereby claim:

  • I am andsala on github.
  • I am andsala (https://keybase.io/andsala) on keybase.
  • I have a public key ASC-jRjAS7yHgan5T3xA7gPV1hX7Fg8xYA0ZhxX4y04xago

To claim this, I am signing this object:

@andsala
andsala / setWeblocThumb.js
Created August 31, 2018 17:41
setWeblocThumb Automator service script
const setWeblocThumb = "/usr/local/bin/setWeblocThumb";
var app = Application.currentApplication();
app.includeStandardAdditions = true;
function run(input, parameters) {
Progress.description = "Processing .webloc files";
Progress.totalUnitCount = input.length + 1;
let output = [];
gs \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/screen \
-dNOPAUSE \
-dQUIET \
-dBATCH \
-sOutputFile=output.pdf \
input.pdf
@andsala
andsala / PIA-PortForwarding.applescript
Created January 22, 2017 11:28
Request port forwarding for the Private Internet Access VPN service
(* Request port forwarding for the Private Internet Access VPN service
Requires curl and jq installed
*)
set user to "YOUR-PIA-USERNAME"
set pass to "YOUR-PIA-PASSWORD"
set interface to "utun1"
set local_ip to (do shell script "ifconfig " & interface & " | grep 'inet ' | cut -d\\ -f2|tee /tmp/vpn_ip")
if local_ip is equal to "" then
display notification "Error forwarding port" with title "PIA Port Forwarding"