Skip to content

Instantly share code, notes, and snippets.


Francesco Pira pirafrank

View GitHub Profile
pirafrank /
Last active May 7, 2023 00:18
Uninstall Office 2016 from OS X completely
if [[ $EUID -ne 0 ]]; then
echo -e "
You have to run this script as root.
exit 1
pirafrank / Dockerfile
Created April 4, 2023 13:05
vim from jonathonf's PPA in a Docker container
View Dockerfile
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
# explicitly set lang and workdir
USER root
RUN apt-get remove -y vim-runtime gvim vim-tiny \
pirafrank /
Created August 20, 2015 21:12
Open given file with the default application. Works on Linux, OS X and Windows. On Linux requires xdg-open (usually built-in).
import sys
import subprocess
import os
import platform
def open_with_default(path):
current_platform = platform.system()
if current_platform == "Linux":["xdg-open", path])
pirafrank /
Last active March 18, 2023 12:02
Install vim from source (+python3 +ruby and more) on Ubuntu 20.04 Focal Fossa (GUI options enabled)
# Remove old vim installs
sudo apt-get remove vim vim-runtime gvim vim-tiny \
vim-common vim-gui-common vim-nox gvim
# install vim-gtk deps
sudo apt-get build-dep vim-gtk
# install some more deps
pirafrank / cloudflareDoH.mobileconfig
Last active August 16, 2022 04:01
iOS, iPadOS and tvOS 14 support MDM profile to set encrypted DNS requests (DNS-over-HTTPS and DNS-over-TLS) on cellular and Wi-Fi connection. To install, open this page from your device and click ‘Raw’ on the one of your choice in the GitHub page. Then continue installation in Settings app. Browse after installing to check it
View cloudflareDoH.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
pirafrank /
Last active April 7, 2022 02:52
Quick script that use wget to download an entire website
if [[ $# != 2 ]]; then
echo "Error: wrong number of arguments"
echo ""
echo "Usage: ./ <domain> <url>"
echo "Example ./"
echo ""
exit -1
pirafrank / get-lockscreen-wallpapers.ps1
Created January 18, 2022 14:04
Copy Windows 10 lockscreen background images to a subdir of YOURUSERNAME\Pictures. Subdir content will be replaced on each run.
View get-lockscreen-wallpapers.ps1
Copy-Item -Force -Recurse $env:USERPROFILE\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets $env:USERPROFILE\Pictures\LockScreen_Wallpapers
Dir $env:USERPROFILE\Pictures\LockScreen_Wallpapers | rename-item -newname { [io.path]::ChangeExtension($, "jpg") }
explorer $env:USERPROFILE\Pictures\LockScreen_Wallpapers
pirafrank / aws_lambda_callback_redirect.js
Created January 13, 2022 19:57
callback function to make an HTTP redirect with AWS Lambda
View aws_lambda_callback_redirect.js
callback(null, {
statusCode: 307,
headers: {
Location: '',
pirafrank / tasks.json
Created December 18, 2021 02:10
VS Code tasks config for Jekyll
View tasks.json
// See
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
"label": "Serve",
"type": "shell",
"command": "bundle exec jekyll s",
"problemMatcher": []
pirafrank / run_other_teams.ps1
Created November 19, 2021 17:04
Powershell script to open another instance of Microsoft Teams desktop application. This script runs the app as another user, you need to create another local Windows user before running the script. Check the link the comments to find out how. Tested on Windows 10 and Microsoft Teams v1.4.00.29469 (64-bit, last updated on 11/19/2021)
View run_other_teams.ps1
# Read me:
# You need to do some setup before running this script.
# Check the link below.
# Run this script as admin in powershell.
# By the way if you run it in a standard powershell it will
# prompt to open a new shell as admin.