Skip to content

Instantly share code, notes, and snippets.

@marc-fez
marc-fez / Get-KeepassPW
Created October 29, 2014 14:57
KPScript retrieve password in Powershell
function Get-KeepassPW{
$result = $null
$KeePath = "C:\Program Files (x86)\KeePass Password Safe 2\KPScript.exe"
# Path to your database
$KeeDataPath = "C:\Users\MyUser\Documents\KeePass\Database.kdbx"
while(!$result){
$pass = Read-Host 'What is your KeePassword?' -AsSecureString
$KePassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($pass))
$KeeCommands = @(
"-c:GetEntryString"
@marc-fez
marc-fez / elem2dict.py
Last active May 23, 2017 13:32 — forked from jacobian/elem2dict.py
Convert an lxml.etree node tree into a dict.
def elem2dict(node):
"""
Convert an lxml.etree node tree into a dict.
"""
d = {}
for e in node.iterchildren():
key = e.tag.split('}')[1] if '}' in e.tag else e.tag
value = e.text if e.text.strip() else elem2dict(e)
d[key] = value
return d
@marc-fez
marc-fez / dell-XPS-15-arch-linux-install
Last active January 7, 2023 22:56 — forked from mattiaslundberg/arch-linux-install
Instructions for installing arch linux on a Dell XPS 15 with full system encryption using dm-crypt and luks
# Having problems with the nvidia drivers
# Arch wiki page on XPS 15
# https://wiki.archlinux.org/index.php/Dell_XPS_15_9560
# Install ARCH Linux with encrypted file-system and UEFI on Dell XPS 15
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux