Skip to content

Instantly share code, notes, and snippets.

View aubique's full-sized avatar
🦆
[object Object]

Alex M aubique

🦆
[object Object]
  • ENSIBS - UBS
  • 10:54 (UTC +02:00)
View GitHub Profile
@aubique
aubique / Sophie.ps1
Last active January 13, 2025 00:33
WSL2 setup config files
<#
.SYNOPSIS
Custom preset file for "Sophia Script for Windows 11"
Version: 6.8.0
Date: 29.12.2024
Modified: 2025-01-10 19:40
#>
#Requires -RunAsAdministrator
@aubique
aubique / generate-ssh-key.md
Last active January 16, 2022 16:04
Generate a new SSH key pair

SSH Key Generation

Generate an SSH public keypair with OpenSSH:

ssh-keygen -t rsa -C "email"

You can also specify arguments and provide info about the source machine:

@aubique
aubique / c4wol.ps1
Last active September 29, 2020 09:20
WakeOnLan script for PowerShell
function Main
{
# File containing a MAC device list
$filename = './c4_lan/c4_lan_list.txt'
# The variables above may vary according to your input
$ip = Get-IPAddress
$broadcast = Get-BroadcastAddress $ip
Send-WOL-FromFile $filename $broadcast -Verbose
@aubique
aubique / encode_decode_dictionary.py
Created June 7, 2019 00:50 — forked from khornberg/encode_decode_dictionary.py
python 3 base64 encode dict
"""
Given a dictionary, transform it to a string. Then byte encode that string. Then base64 encode it and since this will go
on a url, use the urlsafe version. Then decode the byte string so that it can be else where.
"""
data = base64.urlsafe_b64encode(json.dumps({'a': 123}).encode()).decode()
# And the decode is just as simple...
data = json.loads(base64.urlsafe_b64decode(query_param.encode()).decode())
# Byte encode the string, base64 decode that, then byte decode, finally transform it to a dictionary