- set system time-zone America/New_York
- Automatically Set Clock with NTP
- set system ntp server 1.2.3.4
- Repeat for additional servers
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
# This example lacks error checking | |
# late binding, call main AFTER defining check_ssl dependency | |
function main() { check_ssl -fqdn "your.fqdn.com" -port 443 } | |
function check_ssl($fqdn, $port) { | |
$tcpsocket = New-Object Net.Sockets.TcpClient($fqdn, $port) | |
$tcpstream = $tcpsocket.GetStream() | |
$sslStream = New-Object Net.Security.SslStream($tcpstream, $false) | |
$sslStream.AuthenticateAsClient($fqdn) |
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
// goerli dai 18 decimals at 0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60 | |
// see https://github.com/compound-finance/compound-money-market/blob/master/networks/rinkeby-abi.json | |
// FaucetToken and FaucetNonStandardToken | |
// This can be used with https://remix.ethereum.org/ Deploy & Run Transactions At Address feature | |
[ | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"name": "_owner", |
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
# vim: set filetype=dosini: | |
# Custom systemd / systemctl unit file for SmartFile FileHub veridocker | |
# /etc/systemd/system/veridocker.service | |
# After adding or modifying this file run: | |
# systemctl daemon-reload | |
# To enable startup on boot: | |
# systemctl enable veridocker.service | |
# Starting or stopping the veridocker using systemctl | |
# systemctl start veridocker.service | |
# systemctl stop veridocker.service |
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
// Get ABI-Encoded Constructor Parameters for Compound CAP Proposal Governor Bravo | |
// Remove 0x from beginning of output to paste into Etherscan contract code verifier | |
// Tricky things with validating a CAP, the contract is | |
// created by another contract method with mismatching parameters | |
// the event-log parameters are also mismatching | |
// We can find the event log for transaction when the CAP was created | |
// ... but the parameters for the constructor are slightly different | |
// You can run this in the web console at http://remix.ethereum.org/ | |
web3.eth.abi.encodeParameters( |
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
// Get ABI-Encoded Constructor Parameters for Compound CAP Proposal 36 | |
// Remove 0x from beginning of output to paste into Etherscan contract code verifier | |
// Tricky things with validating a CAP, the contract is created by another contract | |
// We can find the event log for transaction when the CAP was created | |
// ... but the parameters for the constructor are slightly different | |
// String encoding, watch out for \n and \u2019 special characters. | |
// You can run this in the web console at http://remix.ethereum.org/ | |
web3.eth.abi.encodeParameters(['address','address[]','uint[]','string[]','bytes[]','string','address','address'],[ | |
'0x9b68c14e936104e9a7a24c712beecdc220002984', |
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
import os, json, web3 | |
# TEST SETUP to check unclaimed comp: | |
# (1) Put your Compound account address in ... | |
# ... environment variable 'MYACCOUNT' (ethereum wallet address) | |
# (2) Download the compound network files 'mainnet-abi.json' & 'mainnet.json' | |
# ... https://github.com/compound-finance/compound-config/tree/master/networks | |
# (3) Put files 'mainnet-abi.json' and 'mainnet.json' in ... | |
# ... script working directory | |
# (4) Dependency is here: https://github.com/ethereum/web3.py ... |
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
# Change the filter and column list as needed to match your query needs. | |
# Query Active Directory Certificate Services for Certs issued to given hostname | |
function view_certs($prefix, $config=$null) { | |
# call like: view_certs -prefix "srv-name" | |
# Find $config value by running "certutil" with NO OPTIONS | |
# increment last character to get next prefix (stop matching) | |
$nextprefix = $prefix.Remove($prefix.Length-1) + [char]([int]$prefix[-1] + 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
#!/usr/bin/python | |
import datetime | |
import os.path | |
import os | |
# Update these to match your environment, schedule with crontab | |
dbs = ['db_one','db_two','db_three'] | |
outfolder = '/var/backup/mysql' | |
numToKeep = 7 |
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
# Show Special Folder Paths (Windows PowerShell) | |
function Show-SpecialPaths () { | |
foreach ($fName in [System.Enum]::GetNames([System.Environment+SpecialFolder])) { | |
New-Object PSObject -Prop ([ordered]@{ 'Name'=$fName; 'Value'=[System.Environment]::GetFolderPath($fName) }) | |
} | |
} | |
# Shows if desktop, documents, etc are redirected. | |
Show-SpecialPaths |
NewerOlder