Skip to content

Instantly share code, notes, and snippets.

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

RoelDS roelds

:shipit:
(╯°□°)╯︵ ┻━┻
  • 20:10 (UTC -05:00)
View GitHub Profile
@roelds
roelds / keybase.md
Created December 4, 2022 01:59
keybase.md

Keybase proof

I hereby claim:

  • I am roelds on github.
  • I am roelds (https://keybase.io/roelds) on keybase.
  • I have a public key ASB7yu-JsK3LuohfgbPbkgUTq2Puwwp6xEM8cGVBZWGl8go

To claim this, I am signing this object:

@roelds
roelds / forkware.sh
Last active January 1, 2023 06:45
forkware - fish shell script : local clone latest git repo for line changes via yaml
#!/usr/bin/fish
#v1.0
echo $argv
set src (yq '.therepo' forkware.yaml)
set host (yq '.hosted' forkware.yaml)
set rel (yq '.release' forkware.yaml)
set meth (yq '.method' forkware.yaml)
echo $src
@roelds
roelds / forkware.yaml
Created January 1, 2023 07:55
forkware - yaml : used by forkware - fish shell script
# forkware.yaml
# hosted is github or gitlab
# latest or tag, clone or fork
# n is new line after, r is replace line, b is new line before, i is insert, a is append
---
therepo: prometheus/prometheus
hosted: github
release: latest
method: clone
files:
@roelds
roelds / compile_gnupg.sh
Last active September 7, 2023 04:41
Compile gnupg 2.4.x from Source for Debian Testing
# assumes new Debian Testing VM, for purpose of compiling, running below as root
# uses most libs already available from apt, only compiles lib ntbtls
lsb_release -a
uname -a
wget https://gnupg.org/signature_key.asc
gpg --import signature_key.asc
gpg -k
wget https://www.gnupg.org/signature_key.html
@roelds
roelds / ListPrivilegedServices.ps1
Last active September 8, 2023 23:39 — forked from RomelSan/ListPrivilegedServices.ps1
List privileged services that don't come with Windows 11
# updated for Win11
# List privileged services that don't come with Windows 11
# Exclusion List for Win11 built in
$exclusion = @('ALG', 'AppVClient', 'COMSysApp', 'diagnosticshub.standardcollector.service',
'edgeupdate', 'edgeupdatem', 'gcs', 'MicrosoftEdgeElevationService', 'MSDTC',
'msiserver', 'NetTcpPortSharing', 'perceptionsimulation', 'PerfHost', 'RpcLocator', 'SecurityHealthService',
'Sense', 'SensorDataService', 'SgrmBroker', 'SNMPTrap', 'spectrum', 'Spooler', 'sppsvc', 'TieringEngineService',
'TrustedInstaller', 'UevAgentService', 'uhssvc', 'vds', 'VSS', 'wbengine', 'WdNisSvc', 'WinDefend', 'wmiApSrv',
'WMPNetworkSvc', 'WSearch', 'WslService')
@roelds
roelds / as_admin.ps1
Created September 9, 2023 00:46
Require or Verify PowerShell Script Run As Admin
#Requires RunAsAdministrator
# put above comment at top of script to prevent running of script if it was not run as admin
# or quietly check for script run as admin:
([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
@roelds
roelds / asn.sh
Last active September 9, 2023 02:47 — forked from ethack/asn
ASN/IP/Route/hostname CLI lookup tool to map any network to corresponding ASN & prefix
#!/bin/bash
if command -v whois >/dev/null 2>&1 ; then echo "whois ok..." ; else echo "install whois!" && exit ; fi
# verified on latest Ubuntu server cloudimg
############################################################################################################
# ----------------------------------------------------------------------
# ASN/IPv4/Prefix lookup tool. Uses Team Cymru's whois service for data.
# ----------------------------------------------------------------------
# example usage:
# asn <ASnumber> -- to lookup matching ASN data. Supports "as123" and "123" formats (case insensitive)
@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 / get_latest_release_tagname.sh
Last active September 9, 2023 18:17
Shell - Get latest release tag name from GitLab or GitHub
# for GitHub:
# use this for name:
VERNAME=$(wget -q -O- https://api.github.com/repos/roelds/litaf/releases/latest | jq -r '.name')
# or this for tag name, if jq installed:
VERTAG=$(wget -q -O- https://api.github.com/repos/roelds/litaf/releases/latest | jq -r '.tag_name')
# or if jq not installed:
curl --silent "https://api.github.com/repos/roelds/litaf/releases/latest" | grep -Po "(?<=\"tag_name\": \").*(?=\")"
# latest release tag name, for GitLab:
curl -s https://gitlab.com/gitlab-org/cli/-/releases/permalink/latest | grep -m1 -Eo "releases/[^/]+\"" | awk 'BEGIN { FS="/" } {print $2}' | rev | cut -c2- | rev
@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