Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Vincent Lauria plivox

🎯
Focusing
View GitHub Profile
@plivox
plivox / auto_switch_theme.py
Last active Aug 28, 2022
Automatic iTerm2 preset switching on MacOS
View auto_switch_theme.py
#!/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 Nov 19, 2019
Decrypt/encrypt session data compatible with Apache's mod_session_crypto.
View mod_session_crypto.go
package main
import (
"crypto/sha1"
"encoding/base64"
"fmt"
"log"
"github.com/spacemonkeygo/openssl"
"golang.org/x/crypto/pbkdf2"
@plivox
plivox / s3get.ps1
Created Jun 20, 2017
AWS S3 Get file with PowerShell
View s3get.ps1
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 Mar 30, 2017
Bash profile file for "GIT for Windows" to run ssh-agent automatically and use Windows Credential Manager.
View git-for-windows-bash-profile
#
# 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