Skip to content

Instantly share code, notes, and snippets.

View pirafrank's full-sized avatar
🎯
Focusing

Francesco Pira pirafrank

🎯
Focusing
View GitHub Profile
@pirafrank
pirafrank / ios_scriptable_codespaces.js
Last active March 22, 2024 08:35
iOS Scriptable widget and table to summarize, list, start, and stop your GitHub Codespaces
// *********
// constants
// *********
// Go to GitHub > Settings > Developer Settings > Personal access tokens > Tokens
// and create a new one with the following scopes:
// - codespaces (Full control over codespaces)
// - read:user
// - user:email
const token = "ghp_123secretToken"
@pirafrank
pirafrank / uninstall_office_2016.sh
Last active March 21, 2024 14:12
Uninstall Office 2016 from OS X completely
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo -e "
ROOT PRIVILEDGES NEEDED!
You have to run this script as root.
Aborting...
"
exit 1
else

$argon2id$v=19$m=8192,t=2,p=4$Y+r8NKkXj0fRU5SXsnU5wQ$ElL+7Y53Kfl1537JUzTvl2h8FwCttAsX

@pirafrank
pirafrank / cloudflareDoH.mobileconfig
Last active January 24, 2024 19:57
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 https://1.1.1.1/help after installing to check it
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>DNSSettings</key>
<dict>
<key>DNSProtocol</key>
@pirafrank
pirafrank / fix_outlook_copy_events.reg
Created December 6, 2023 13:10
A fix to restore Copy Calendar Events functionality in Microsoft Outlook 365 for Windows
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options\Calendar]
"EnableMeetingCopy"=dword:00000001
@pirafrank
pirafrank / .EXIF_renamer.md
Last active June 9, 2023 19:30
exif_renamer - EXIF to filename

EXIF_renamer

rename your photos to their DateTimeOriginal datetime in EXIF metadata.

@pirafrank
pirafrank / Dockerfile
Created April 4, 2023 13:05
vim from jonathonf's PPA in a Docker container
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
# explicitly set lang and workdir
ENV LANG="en_US.UTF-8" LC_ALL="C" LANGUAGE="en_US.UTF-8"
USER root
RUN apt-get remove -y vim-runtime gvim vim-tiny \
@pirafrank
pirafrank / open-with-default-application.py
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":
subprocess.call(["xdg-open", path])
@pirafrank
pirafrank / vim_install.sh
Last active March 18, 2023 12:02
Install vim from source (+python3 +ruby and more) on Ubuntu 20.04 Focal Fossa (GUI options enabled)
#!/bin/bash
# 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
pirafrank / download_entire_website.sh
Last active April 7, 2022 02:52
Quick script that use wget to download an entire website
#!/bin/bash
if [[ $# != 2 ]]; then
echo "Error: wrong number of arguments"
echo ""
echo "Usage: ./download-entire-website.sh <domain> <url>"
echo "Example ./download-entire-website.sh websitetodownload.com www.websitetodownload.com/page/"
echo ""
exit -1
fi