Skip to content

Instantly share code, notes, and snippets.

@declon
declon / domain-join.sh
Last active September 1, 2023 03:11
AWS - Ubuntu 18.04 - Join Self Hosted Active Directory
DOMAIN_USR=domainjoinusername
DOMAIN_PWD=domainjoinpassword
# get instance ID
ID=$(curl http://169.254.169.254/latest/meta-data/instance-id)
# install deps
DEBIAN_FRONTEND=noninteractive apt-get -y install sssd heimdal-clients msktutil
# set hostname
@vadim-kovalyov
vadim-kovalyov / bootstrap-ubuntu.sh
Last active August 22, 2024 20:50
Dev box setup for Ubuntu 20.04
sudo apt update
sudo apt install -y build-essential curl make git vim hub libssl-dev graphviz jq cmake clang pkg-config p7zip terminator gnome-tweaks fonts-firacode protobuf-compiler
# intune
sudo apt install libpam-pwquality
sudo nano /etc/pam.d/common-password
# password requisite pam_pwquality.so retry=3 dcredit=-1 ocredit=-1 ucredit=-1 lcredit=-1 minlen=12
curl -sSl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
@shanewholloway
shanewholloway / export-yubi-to-ssh-key.sh
Created December 4, 2019 00:07
Export a Yubikey certificate to an ssh-keygen compatible key.
#!/bin/sh
# Seems to only support RSA keys...
ykman piv export-certificate 9a public-cert.pem
openssl x509 -in public-cert.pem -noout -pubkey > public-key.pem
ssh-keygen -i -m pkcs8 -f ./public-key.pem > id_yubi_9a.pub
@htr3n
htr3n / macos-ramdisk.md
Last active August 18, 2025 15:03
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@menushka
menushka / downloadiOSHeaders.py
Last active September 17, 2024 18:14
Download iOS Headers from http://developer.limneos.net. Includes settings for iOS version, download path and only downloading select frameworks.
from lxml import html
import requests
import re
import os
def createDir(path):
if not os.path.exists(path): os.makedirs(path)
# Settings
iosVersion = "12.1"
@parsa
parsa / ssh-key-to-fingerprint.md
Last active July 18, 2023 05:26
Generate MD5 and SHA256 fingerprint of an OpenSSH host

Generate MD5 and SHA256 fingerprint of an OpenSSH host

MD5

# ssh-keyscan -p 8000 -t rsa rostam.cct.lsu.edu 2>/dev/null | awk '{ print $3 }' | base64 -d | md5sum | awk '{ print $1 }' | fold -w2 | paste -sd':' -
71:5a:1d:bb:1f:1e:fa:e6:34:98:3d:48:f5:ce:9d:68
# ssh-keygen -l -E md5 -f <(ssh-keyscan -p 8000 -t rsa rostam.cct.lsu.edu 2>/dev/null)
2048 MD5:71:5a:1d:bb:1f:1e:fa:e6:34:98:3d:48:f5:ce:9d:68 [rostam.cct.lsu.edu]:8000 (RSA)
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active September 23, 2025 15:11
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@fecf
fecf / server.cc
Created August 28, 2018 11:37
bare minimum websocket server with c++/winrt
...
using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Networking::Sockets;
using namespace winrt::Windows::Storage::Streams;
using namespace winrt::Windows::Security::Cryptography;
using namespace winrt::Windows::Security::Cryptography::Core;
StreamSocketListener websocket_;
#include <string_view>
#include <exception>
#include <assert.h>
using namespace std::literals;
struct guid
{
uint32_t Data1;
uint16_t Data2;
@yidas
yidas / csr.conf.md
Last active September 7, 2025 06:15
Certificate(CSR) configuration file

Openssl commands:

openssl genrsa -out self-ssl.key
openssl req -new -key self-ssl.key -out self-ssl.csr -config csr.conf
openssl x509 -req -days 365 -in self-ssl.csr -signkey self-ssl.key -out self-ssl.crt -extensions req_ext -extfile csr.conf

Sign from Root CA: openssl x509 -req -days 365 -extensions req_ext -extfile csr.conf -CA RootCA.crt -CAkey RootCA.key -in self-ssl.csr -out self-ssl.crt