Skip to content

Instantly share code, notes, and snippets.

@notesbytom
notesbytom / FaucetToken.abi
Created July 11, 2021 14:52
FaucetToken abi for Ethereum TestNet allocateTo function
// 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",
@notesbytom
notesbytom / veridocker.service
Last active April 19, 2021 16:54
SmartFile FileHub systemd unit file for systemctl
# 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
@notesbytom
notesbytom / compound_cap_gov_bravo_constructor_params.js
Created March 17, 2021 14:45
Compound CAP Governor Bravo Constructor Parameter example
// 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(
@notesbytom
notesbytom / compound_cap36_constructor_params.js
Created February 8, 2021 01:15
Compound CAP Proposal 36 ABI-Encode Constructor Parameters
// 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',
@notesbytom
notesbytom / check_unclaimed_comp.py
Last active January 22, 2021 02:05
Check Unclaimed COMP with Python and web3
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 ...
@notesbytom
notesbytom / Juniper-Switches.md
Last active June 7, 2019 13:42
Juniper Network Switch Configuration Hints

Juniper Network Switches

Common Configuration Snippets

System Time

  • set system time-zone America/New_York
  • Automatically Set Clock with NTP
    • set system ntp server 1.2.3.4
  • Repeat for additional servers
@notesbytom
notesbytom / mysql-db-backup.py
Created April 4, 2019 18:20
MySQL Backup Example Python Script
#!/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
@notesbytom
notesbytom / Show-SpecialPaths.ps1
Created March 26, 2019 17:31
Show Special Folder Paths (Windows)
# 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
@notesbytom
notesbytom / ListODBCDrivers.ps1
Created October 3, 2018 17:22
List ODBC Drivers on Windows 7 / Server 2008 with PowerShell
# List Native Architecture Drivers Installed (64-bit if Windows is x64)
Get-Item 'HKLM:\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers'
# List 32-Bit Drivers Installed on 64-bit Windows (not applicable to 32-bit Windows)
Get-Item 'HKLM:\software\Wow6432Node\ODBC\ODBCINST.INI\ODBC Drivers'
# Alternatively use Get-ItemProperty
# Windows 8, Server 2012 and newer have Get-OdbcDriver cmdlet available (easier to use)
@notesbytom
notesbytom / ChangeODBCDriver.vba
Last active October 3, 2018 19:04
Change ODBC Driver for Access Linked Tables
' Based on Stack Overflow Answer by @Fionnuala
' https://stackoverflow.com/questions/12606326/linked-table-ms-access-2010-change-connection-string
' NOTE: If a linked table is no longer valid, delete it and Restart Access or Compact the database
Function ChangeODBCDriver()
Dim tdf As TableDef
Dim oldDriver As String, newDriver As String
oldDriver = "SQL Server Native Client 10.0"
newDriver = "ODBC Driver 17 for SQL Server"
For Each tdf In CurrentDb.TableDefs
If tdf.Connect <> vbNullString Then