This file contains 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
{ | |
"log-driver": "json-file", | |
"log-opts": { | |
"max-size": "90m", | |
"max-file": "9" | |
} | |
} |
This file contains 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
awk 'BEGIN{ | |
s="/\\/\\/\\/\\/\\"; s=s s s s s s s s; | |
for (colnum = 0; colnum<77; colnum++) { | |
r = 255-(colnum*255/76); | |
g = (colnum*510/76); | |
b = (colnum*255/76); | |
if (g>255) g = 510-g; | |
printf "\033[48;2;%d;%d;%dm", r,g,b; | |
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b; |
This file contains 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
Netblock Description | |
0.0.0.0/8 "This" network | |
10.0.0.0/8 Private-use networks | |
100.64.0.0/10 Carrier-grade NAT | |
127.0.0.0/8 Loopback | |
127.0.53.53 Name collision occurrence | |
169.254.0.0/16 Link local | |
172.16.0.0/12 Private-use networks | |
192.0.0.0/24 IETF protocol assignments | |
192.0.2.0/24 TEST-NET-1 |
This file contains 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
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 |
This file contains 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
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 |
This file contains 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
# 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" |
This file contains 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
# 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}' |
This file contains 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
#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 \ |
This file contains 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 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 |
NewerOlder