Skip to content

Instantly share code, notes, and snippets.

View plivox's full-sized avatar
🎯
Focusing

Vincent Lauria plivox

🎯
Focusing
View GitHub Profile
@plivox
plivox / auto_switch_theme.py
Last active March 25, 2024 04:03
Automatic iTerm2 preset switching on MacOS
#!/usr/bin/env python3
import asyncio
import iterm2
THEME_LIGHT = "Tango Light"
THEME_DARK = "Tango Dark"
class AutoSwitchTheme:
@plivox
plivox / mod_session_crypto.go
Last active November 19, 2019 11:35
Decrypt/encrypt session data compatible with Apache's mod_session_crypto.
package main
import (
"crypto/sha1"
"encoding/base64"
"fmt"
"log"
"github.com/spacemonkeygo/openssl"
"golang.org/x/crypto/pbkdf2"
@plivox
plivox / s3get.ps1
Created June 20, 2017 14:16
AWS S3 Get file with PowerShell
function S3-Get([string]$uri, [string]$bucket) {
$date = Get-Date -format "ddd, dd MMM yyyy HH:mm:ss zz00"
$content_type = "text/plain"
$request = "GET`n`n${content_type}`n${date}`n${bucket}"
#
# Bash equivalent is:
# $ echo -en ... | openssl sha1 -hmac ... -binary | base64
#
@plivox
plivox / git-for-windows-bash-profile
Last active March 30, 2017 17:10
Bash profile file for "GIT for Windows" to run ssh-agent automatically and use Windows Credential Manager.
#
# Description: Bash profile file for "GIT for Windows" to run ssh-agent
# automatically and use Windows Credential Manager.
# Author: Vincent Lauria <vincent@lauria.ch>
# Data: 20170330
# Version: 0.2
#
# Dependency:
#
# - GIT for Windows