Skip to content

Instantly share code, notes, and snippets.

View roelds's full-sized avatar
:shipit:
(╯°□°)╯︵ ┻━┻

RoelDS roelds

:shipit:
(╯°□°)╯︵ ┻━┻
  • 05:57 (UTC -05:00)
View GitHub Profile
@roelds
roelds / oqsprovider_windows.cmd
Last active September 9, 2023 16:43
Use oqsprovider with openssl on Windows
:: put below in your config, usually for Win64 : C:\Program Files\Common Files\SSL\openssl.cnf
[provider_sect]
default = default_sect
oqsprovider = oqsprovider_sect
[default_sect]
activate = 1
[oqsprovider_sect]
activate = 1
@roelds
roelds / my_time.ps1
Created September 9, 2023 19:32
my timestamp as filename format in Linux & Windows
# my format
get-date -format "yyyy_MM_dd_HH_mm_ss"
# epoch in dec
(Get-Date).ToUniversalTime().Subtract((Get-Date "01/01/1970")).TotalSeconds
# alt format
gcim Win32_LocalTime | select Year,Quarter,Month,WeekInMonth,DayOfWeek | fl
@roelds
roelds / Ascii85.ps1
Last active September 16, 2023 06:18
Various Types to Add in PowerShell
# more efficient than base64
$base85lib =
@"
using System;
using System.Text;
using System.IO;
using System.Linq;
namespace BaseN {
/// <summary>
@roelds
roelds / git_sha2.sh
Created September 16, 2023 04:06
Git sha256 in Git 2.42+
# Git 2.42+
mkdir sha256
cd sha256
git init --object-format=sha256
git config extensions.preciousObjects true
git branch -m dev
dd if=/dev/zero bs=$((1024*1024)) count=$((5*1024)) | git hash-object --stdin --literally
# verify result :
dc18ca621300c8d3cfa505a275641ebab00de189859e022a975056882d313e64
@roelds
roelds / Python3.py
Created September 16, 2023 06:34
Various Python3 snippets
# hash checksum sha3-224
import sys
import hashlib
if sys.version_info < (3, 6):
import sha3
# initiating the "s" object to use the
# sha3_224 algorithm from the hashlib module.
s = hashlib.sha3_224()
@roelds
roelds / nc-aio.sh
Last active September 4, 2024 00:42
NextCloud AIO - Docker Run
#regular nat networking:
docker run \
--init \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 80:80 \
--publish 8080:8080 \
--publish 8443:8443 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
@roelds
roelds / show-self-hosts.sh
Last active September 6, 2024 13:18
Show Local Hosts Entry & Device Name & MAC
# uses network-manager
myip=$(nmcli device show | grep -m 1 "IP4.ADDRESS" | awk '{print substr($2, 1, length($2)-3)}')
myentry=$(echo -n $myip && echo -e "\t thishost.thisdomain.local" && echo -e "\t thishost")
echo $myentry
# get nic device name (enps)
nmcli device show | grep -m 1 "GENERAL.DEVICE" | awk '{print $2}'
# get nic mac addr
nmcli device show | grep -m 1 "GENERAL.HWADDR" | awk '{print $2}'
@roelds
roelds / afraid.ps1
Last active September 6, 2024 13:38
Afraid FreeDNS Dynamic Updater - Startup Scripts
# Windows PowerShell
while (($PSVersionTable).PSVersion.ToString().Chars(0) -eq '5') {
# $oneoneoneone = tnc "one.one.one.one" -CommonTCPPort HTTP -WarningAction SilentlyContinue | select TcpTestSucceeded
# if ($oneoneoneone.TcpTestSucceeded -eq $true) {
$oneoneoneone = Test-Connection "one.one.one.one" -Count 1 -WarningAction SilentlyContinue | select StatusCode
if ($oneoneoneone.StatusCode -eq 0) {
echo "yes ping out"
@roelds
roelds / rtc_time.ps1
Last active September 4, 2024 21:02
Use RTC Time In Windows 11 To Dual Boot Linux
sp -Path HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation -Name RealTimeIsUniversal -Value 1 -Type DWord -Force
sp -Path HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation -Name DynamicDaylightTimeDisabled -Value 0 -Type DWord -Force
Set-Service -Name w32time -StartupType Automatic
w32tm /tz
@roelds
roelds / hyperv_my_nat.ps1
Created September 5, 2024 21:17
HyperV New-VMSwitch - Static Subnet, No DHCP, Allowed Static MACs
New-VMSwitch -SwitchName AllInternal69 -SwitchType Internal
Get-NetAdapter
New-NetIPAddress -IPAddress 192.168.69.1 -PrefixLength 24 -InterfaceIndex INDEX
New-NetNat -Name AllInternal69 -InternalIPInterfaceAddressPrefix 192.168.69.0/24
# Local Static MACs:
# x2-xx-xx-xx-xx-xx
# x6-xx-xx-xx-xx-xx
# xA-xx-xx-xx-xx-xx
# xE-xx-xx-xx-xx-xx