This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# more efficient than base64 | |
$base85lib = | |
@" | |
using System; | |
using System.Text; | |
using System.IO; | |
using System.Linq; | |
namespace BaseN { | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# will prompt for passphrase on stdin | |
openssl genpkey -out skey.pem -verbose -pass stdin -aes-256-cbc -algorithm ed448 | |
openssl ec -in skey.pem -pubout -out pub.pem | |
# create hash | |
openssl shake256 -xoflen 64 -out dgst thefile | |
openssl pkeyutl -sign -inkey skey.pem -rawin -in dgst -out dgst.sig | |
openssl pkeyutl -verify -rawin -inkey pub.pem -pubin -sigfile dgst.sig -in dgst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Original author: Michalis Georgiou <[email protected]> | |
# Modified by Andrew http://www.webupd8.org <[email protected]> | |
# Current version by Kassius Iacchus https://github.com/iacchus/ | |
# Depends on: `wget` | |
# | |
# Install `wget` on Debian/Ubuntu with: | |
# apt install wget |
NewerOlder