Skip to content

Instantly share code, notes, and snippets.

@sylvainpelissier
sylvainpelissier / pyuac.py
Last active March 20, 2023 23:28 — forked from Preston-Landers/pyuac.py
pyuac - elevate a Python process with UAC on Windows compatible Python 3.
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4
"""User Access Control for Microsoft Windows Vista and higher. This is
only for the Windows platform.
This will relaunch either the current script - with all the same command
line parameters - or else you can provide a different script/program to
run. If the current user doesn't normally have admin rights, he'll be
@sylvainpelissier
sylvainpelissier / i2c-dump.py
Last active September 22, 2017 11:45 — forked from cutaway/i2c-dump.py
Script to interact with I2C EEPROM memory components using the BusPirate via pyBusPirateLite
#!/usr/bin/env python
# encoding: utf-8
"""
Adapted from i2c-test.py from Peter Huewe by Jean-Michel Picod
Modified by Don C. Weber (cutaway) and InGuardians, Inc. 20141015
i2c-dump is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@sylvainpelissier
sylvainpelissier / ecryptfs-setup.sh
Last active January 11, 2022 18:18
eCryptFS Setup on Manjaro
#!/bin/bash
echo " eCryptFS Installation Script for Manjaro Linux "
echo " ---------------------------------------------- "
echo " This script will download and install the packages required to run eCryptFS and its utilities to encrypt a users home directory."
if [[ $EUID -ne 0 ]]; then
echo ""
echo " !! This script must be run as root !!"
echo " !! Exiting. !!"
echo ""
@sylvainpelissier
sylvainpelissier / rsa_factor.py
Last active August 18, 2023 20:07 — forked from AntonKueltz/rsa_factor.py
Factor an RSA modulus given the public and private key
def factor(n, e, d):
"""http://crypto.stackexchange.com/a/25910/17884
Requires gmpy2
n - modulus
e - public exponent
d - private exponent
returns - (p, q) such that n = p*q
"""
from gmpy2 import gcd