Skip to content

Instantly share code, notes, and snippets.

<#
.SYNOPSIS
Removing Built-in apps from Windows 10
.DESCRIPTION
Removing Built-in apps from Windows 10
.PARAMETER
PathtoWim - Full path to .wim file.
selectapps - activates the selection function
index - allows the selection of an index. Default value is 1.
.EXAMPLE
@piratecarrot
piratecarrot / gist:77ef8793c20e8ccc7f90cf900eaf8f6e
Created April 12, 2019 04:04
Create MySQL database and give privileges
Login to the machine and run the following commands.
# sudo su
# mysql
You will now be within the MySQL client. Issue the following commands.
> CREATE DATABASE <DATABASE_NAME>;
> GRANT ALL PRIVILEGES ON <DATABASE_NAME>.* TO '<DATABASE_USERNAME>'@'localhost' IDENTIFIED BY '<DATABASE_PASSWORD>';
[bluetooth]# connect 94:54:93:4E:76:4E
Attempting to connect to 94:54:93:4E:76:4E
[CHG] Device 94:54:93:4E:76:4E Connected: yes
Connection successful
[CHG] Device 63:AD:14:BC:B4:C4 RSSI: -72
[CHG] Device 63:AD:14:BC:B4:C4 ManufacturerData Key: 0x004c
[CHG] Device 63:AD:14:BC:B4:C4 ManufacturerData Value:
01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 .
[NEW] Primary Service (Handle 0xe7ce)
@piratecarrot
piratecarrot / git-setup-kicad.sh
Last active March 1, 2024 22:49
KiCAD git setup
#!/bin/sh
git init
cat << EOF | tee .gitignore
# For PCBs designed using KiCad: http://www.kicad-pcb.org/
# Format documentation: http://kicad-pcb.org/help/file-formats/
# Temporary files
*.000
@piratecarrot
piratecarrot / metasploit.sh
Last active September 28, 2021 12:04
Metasploit installation on Arch with PostgreSQL Docker
# I use yay package manager on Arch
# This also assumes you have a Docker environment already setup
yay -S metasploit ruby-irb rubygems ruby-bundler
docker run --name postgres-metasploit -d -p 5432:5432 -e POSTGRES_PASSWORD=mysuperpassword postgres:alpine
msfdb --connection-string=postgresql://postgres:mysuperpassword@localhost:5432/postgres reinit --component database
@piratecarrot
piratecarrot / keepassxc-setup.sh
Last active October 2, 2023 10:45
Setting up KeePassXC with Google Drive synchronisation and SSH Agent
# This is intended to be copied and pasted to a console, not executed as a script... for now.
# Install some stuff, I use yay, you may use something else
sudo pacman -S keepassxc rclone curl
mkdir -p ~/.local/bin
mkdir -p ~/.local/lib/private
chmod 0700 ~/.local/lib/private
# CREATE YOUR KEEPASSXC BASE IN ~/.local/lib/private/
#!/bin/bash
DIR=~/workspaces/kicad
REPOS=('symbols' 'footprints' '3dmodels')
for i in "${REPOS[@]}"
do
echo git -C $DIR/$i "$@"
git -C $DIR/$i "$@"
export BASE=/var/lib/build
cd $BASE
mkdir -p $BASE/bbb/build
cd $BASE
git clone -b dunfell git://git.yoctoproject.org/poky.git poky-dunfell
cd poky-dunfell
git clone -b dunfell git://git.openembedded.org/meta-openembedded
git clone -b dunfell https://github.com/meta-qt5/meta-qt5.git
git clone -b dunfell git://git.yoctoproject.org/meta-security.git
git clone -b dunfell https://github.com/jumpnow/meta-jumpnow.git
@piratecarrot
piratecarrot / add-google-workspace-dns.sh
Created November 17, 2021 01:15
Add Google Workspace DNS records
#!/bin/bash
resourceGroup="my-resource-group"
sites=("test.com" "test.net" "test.org")
mailExchanges=("aspmx4.googlemail.com" "alt2.aspmx.l.google.com" "aspmx2.googlemail.com" "aspmx3.googlemail.com" "aspmx.l.google.com" "alt1.aspmx.l.google.com" "aspmx5.googlemail.com")
preferences=( 30 20 30 30 10 20 30 )
for site in ${sites[@]}; do
for i in ${!mailExchanges[@]}; do
az network dns record-set mx add-record \
@piratecarrot
piratecarrot / gist:5b51fbb979988d79f2b062b8f85b0549
Last active February 8, 2022 06:01
Flashing STM32MP1 eMMC for Seeed Odyssey board
# Put contents of $BUILDROOT/output/images onto Debian SD in /home/debian
# Run from /home/debian
cat<<__EOF__ | sudo sfdisk -f /dev/mmcblk1
label: gpt
label-id: 8180153F-48CF-4520-BB44-AF0F881C8679
device: /dev/sdc
unit: sectors
first-lba: 34
/dev/mmcblk1p1 : start= 34, size= 412, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=7AB96C94-9AAA-4736-A97F-4950BC078562, name="fsbl1"