Skip to content

Instantly share code, notes, and snippets.

View SalemHarrache's full-sized avatar
💭
🤤

Salem Harrache SalemHarrache

💭
🤤
View GitHub Profile
@SalemHarrache
SalemHarrache / renew-gpgkey.md
Created June 15, 2024 07:12 — forked from krisleech/renew-gpgkey.md
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@SalemHarrache
SalemHarrache / enable_windows_update.ps1
Created June 13, 2022 11:14
Revert Windows Update to default settings
#
# Revert Windows Update to default settings
#
Write-Host "Enabling driver offering through Windows Update..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue
@SalemHarrache
SalemHarrache / disable_windows_update.ps1
Created June 13, 2022 11:04
Disable all windows update except security updates
#
# Set Windows Update to Sane Settings
#
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) {
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
Exit
}
@SalemHarrache
SalemHarrache / smart-tv-blocklist.txt
Created November 30, 2020 00:26
Smart TV-PiHole Blocklist
# Title: Perflyst's Smart-TV Blocklist for Pi-hole
# Version: 06September2020v1
# Description: This is a blocklist to block smart-TVs sending metadata back home, sometimes with the added benefit of blocking interface ads for apps and movie services.
# Please help with collecting domains!
# It could occur that the TV fails to receive new updates, or that other apps or services no longer work. Please report such an incident.
# Make sure to also use the extra RegEx list at https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/regex.list, which helps remove regional LG ad domains among other things.
# Panasonic Viera & panny tv
0077777700140002.myhomescreen.tv
cert-test.sandbox.google.com
@SalemHarrache
SalemHarrache / harmony_update_blocklist.txt
Created November 11, 2020 10:22
harmony_update_blocklist.txt
svcs.myharmony.com
content.dhg.myharmony.com
logging.dhg.myharmony.com
myharmony.com
sus.dhg.myharmony.com
@SalemHarrache
SalemHarrache / arch-linux-install
Created June 14, 2020 15:39 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# 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
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
_resolv_domain_name() {
if _cmd_exists dscacheutil; then
# Mac OSX
dscacheutil -q host -a name "$1" | grep ip_address | cut -d ":" -f2 | head -n 1 | xargs
elif _cmd_exists dig; then
dig A +short "$1" | head -n 1 | xargs
elif _cmd_exists nslookup; then
# exclude IPV6
nslookup "$1" | awk '/^Address: / { print $2 }' | grep -Eo '[0-9\.]{7,15}' | head -n 1 | xargs
elif _cmd_exists host; then
#!/bin/bash
hexdump -n 6 -ve '1/1 "%.2x "' /dev/random |\
awk -v a="2,6,a,e" -v r="$RANDOM" '
BEGIN {
srand(r);
}
NR==1 {
split(a, b, ",");
r=int(rand() * 4 + 1);
printf("%s%s:%s:%s:%s:%s:%s\n", substr($1, 0, 1), b[r], $2, $3, $4, $5, $6);
docker network create --driver=macvlan --gateway=10.10.10.1 --subnet=10.10.10.0/8 --ip-range=10.10.10.192/26 -o parent=br0 homenet

This only really works if you don't mind losing any other keys (than your own).

Export public and secret key and ownertrust

gpg -a --export chris@seagul.co.uk > chrisroos-public-gpg.key
gpg -a --export-secret-keys chris@seagul.co.uk > chrisroos-secret-gpg.key
gpg --export-ownertrust > chrisroos-ownertrust-gpg.txt

Import secret key (which contains the public key) and ownertrust