Skip to content

Instantly share code, notes, and snippets.

@woble
woble / _hsts.conf
Created June 10, 2022 18:53 — forked from R0GGER/_hsts.conf
Workaround - Security Headers @ NGINX Proxy Manager
{% if certificate and certificate_id > 0 -%}
{% if ssl_forced == 1 or ssl_forced == true %}
{% if hsts_enabled == 1 or hsts_enabled == true %}
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security "max-age=63072000;{% if hsts_subdomains == 1 or hsts_subdomains == true -%} includeSubDomains;{% endif %} preload" always;
add_header Referrer-Policy strict-origin-when-cross-origin;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Frame-Options SAMEORIGIN;
add_header Content-Security-Policy upgrade-insecure-requests;

The Freenode resignation FAQ, or: "what the fuck is going on?"

Update 2

Freenode staff have stepped down. The network that runs at freenode.org/net/com should now be assumed to be under control of a malicious party. Andrew Lee will likely gain control over the NickServ database at some point.

I recommend that you move to libera.chat as soon as possible, as the former Freenode staff has left the network that exists on the Freenode domains, and so they can no longer guarantee the safety of your information or community there. Basically, libera.chat is the continuation of Freenode.

@woble
woble / ssd-health.sh
Created May 14, 2020 05:26
Calculates and returns the health of the provided drive (SSD)
#!/bin/bash
device=$1
sudo smartctl -A $device |awk '
$0 ~ /Power_On_Hours/ { poh=$10; printf "%s / %d hours / %d days / %.2f years\n", $2, $10, $10 / 24, $10 / 24 / 365.25 }
$0 ~ /Total_LBAs_Written/ {
lbas=$10;
bytes=$10 * 512;
mb= bytes / 1024^2;
@woble
woble / disabledhotkeys.reg
Created March 16, 2019 20:09
Windows registry tweaks
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"DisabledHotkeys"=hex(2):30,00,78,00,31,00,31,00,31,00,32,00,33,00,34,00,35,00,\
36,00,37,00,38,00,39,00,30,00,00,00
@woble
woble / swap.sh
Created January 27, 2018 14:17
Swaps names of two files
function swap()
{
tmpfile=$(mktemp $(dirname "$1")/XXXXXX)
mv "$1" "$tmpfile" && mv "$2" "$1" && mv "$tmpfile" "$2"
}
@woble
woble / dell-h310.md
Created November 5, 2017 10:54
Flashing Dell PERC H310 to IT mode

If you have a Dell Perc H310 and your computer won't boot then you'll need to cover PCIe pins B5 and B6. You can cover them with a thin piece of electrical tape.

H310 DOS

  1. megacli.exe -AdpAllInfo -aAll -page 20 Write down SAS address.
  2. megarec.exe -writesbr 0 sbrempty.bin If this fails move on to next step.
  3. megarec.exe -cleanflash 0 Reboot.
  4. sas2flsh.exe -o -f 6GBPSAS.fw Reboot.
  5. sas2flsh.exe -o -f 2118it.bin
  6. s2fp19.exe -o -sasadd 500xxxxxxxxxxxxx