Skip to content

Instantly share code, notes, and snippets.

@xpn
xpn / LAPSDecrypt.cs
Last active October 26, 2023 01:43
Quick POC looking at how encryption works for LAPS (v2)
using System;
using System.Collections.Generic;
using System.DirectoryServices.Protocols;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Security.Policy;
using System.Security.Principal;
using System.Text;
@vi
vi / get_github_stars.sh
Last active October 28, 2022 09:38
Hacky workaround to track new stars of your repositoes (previously displayed on Github home page)
#!/bin/bash
set -e
TOKEN=...
USERNAME=...
D=$(mktemp -d)
cd "$D"
P=1
@b0c0de
b0c0de / css-3d-disco-ball.markdown
Created November 20, 2019 03:36
CSS 3D Disco Ball
@groz
groz / sync-http.swift
Created February 15, 2018 22:29
Synchronous http request in Swift
import Foundation
func query(address: String) -> String {
let url = URL(string: address)
let semaphore = DispatchSemaphore(value: 0)
var result: String = ""
let task = URLSession.shared.dataTask(with: url!) {(data, response, error) in
result = String(data: data!, encoding: String.Encoding.utf8)!
@lightrush
lightrush / README.md
Created November 3, 2017 05:18
X11vnc Systemd Unit File

X11vnc Systemd Unit File

This Systemd unit file starts X11VNC on boot

  1. Set VNC password: sudo x11vnc -storepasswd [YOUR VNC PASSWORD] /etc/x11vnc.passwd
  2. Install Systemd Unit File
sudo cp [path to]/vnc.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable vnc.service
@Mostafa-Hamdy-Elgiar
Mostafa-Hamdy-Elgiar / Filetimes.py
Created February 25, 2017 09:22
Python Script to convert Microsoft widows file time to python date and also date to windows file time
#!/usr/bin/env python
# Copyright (c) 2009, David Buxton <david@gasmark6.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@bluebat
bluebat / menu.ipxe
Created October 20, 2016 07:55
Menu script for iPXE
#!ipxe
menu Selection
item liveins-freedos-1.0 FreeDOS 1.0 (ro)
item livesys-fdos-1.1 FDOS 1.1 (ro)
item liveiso-slitaz-current Slitaz current (ro)
item liveiso-tinycore-7.2 TinyCore 7.2 (ro)
item netsys-fedora-23 Fedora 23 (rw)
item netsys-korora-24 Korora 24 (rw)
choose os && goto ${os}
@groundrace
groundrace / webcryptoapi.html
Created April 13, 2016 23:56 — forked from deiu/webcryptoapi.html
Web Crypto API: RSA keygen & export & import & sign & verify & encrypt & decrypt
<html>
<head>
<script>
function generateKey(alg, scope) {
return new Promise(function(resolve) {
var genkey = crypto.subtle.generateKey(alg, true, scope)
genkey.then(function (pair) {
resolve(pair)
})
})
@exabrial
exabrial / FreeRadius, PEAP-MSCHAP, Samba, Ubuntu 14.04, ActiveDirectory, LDAP.md
Last active January 10, 2022 01:08
FreeRadius, PEAP-MSCHAP, Samba, Ubuntu 14.04, ActiveDirectory, LDAP

FreeRadius, PEAP-MSCHAP, Samba, Ubuntu 14.04, ActiveDirectory, LDAP

Why This guide

@jasemagee
jasemagee / fortune-rnd-cowsay-lolcat.sh
Created May 30, 2015 09:42
Fortune with random cowsay character and lolcat
fortune | cowsay -f "$(ls /usr/share/cowsay/cows | sort -R | head -1)" | lolcat