I hereby claim:
- I am chalvorson on github.
- I am chalvorson (https://keybase.io/chalvorson) on keybase.
- I have a public key ASDvn4ssYPI88gggFwG5y3movH3Zvyy1_GSKyz055_rFXwo
To claim this, I am signing this object:
var sheetName = SpreadsheetApp.getActiveSpreadsheet().getName(); | |
var sheetUrl = SpreadsheetApp.getActiveSpreadsheet().getUrl(); | |
var options = {} | |
options.htmlBody = "Here is a link to your spreadsheet.<br>" + | |
"<a href=\"" + sheetUrl + "\">" + sheetName + "</a>"; | |
MailApp.sendEmail("me@email.com", "Here is your link.", '', options); |
def gsheet_to_dataframe(sheet_service, sheet_id, sheet_range): | |
result = sheet_service.values().get( | |
spreadsheetId=sheet_id, range=sheet_range).execute() | |
values = result.get('values', []) | |
# Assuming the first row is column names | |
df = DataFrame(data=values[1:], columns=values[0]) | |
return df |
/* | |
* LoadLibraries.gs - App Script for cached local and remote javascript libraries | |
* | |
* Built from the ideas at: | |
* https://ctrlq.org/code/20380-load-external-javascript-with-eval | |
* https://stackoverflow.com/questions/18646554/importing-external-javascript-to-google-apps-script | |
* https://stackoverflow.com/questions/22410210/how-do-i-use-momentsjs-in-google-apps-script/49934393#49934393 | |
* https://stackoverflow.com/questions/16149760/calculating-year-month-days-between-dates-in-google-apps-script/18171101#18171101 | |
* | |
*/ |
I hereby claim:
To claim this, I am signing this object:
''' | |
This script uses netmiko to take a backup from cisco ios switches. The config files | |
are stored in config/ and the log files are stored in log/ | |
Arguments: -u - login username | |
-p - login password | |
-s - enable password | |
-f - file with list of switch ip addresses | |
Output is an .ios file for each switch with date stamp | |
Requirements: netmiko, loguru |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$true, | |
Position=0)] | |
[string] | |
$WsusServer, | |
[int] | |
$Port = "80", | |
[Parameter(Mandatory=$true)] | |
[ValidateScript({Test-Path $_ -PathType 'Leaf'})] |
#!/bin/bash | |
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)" | |
let secs=$((${upSeconds}%60)) | |
let mins=$((${upSeconds}/60%60)) | |
let hours=$((${upSeconds}/3600%24)) | |
let days=$((${upSeconds}/86400)) | |
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"` | |
# get the load averages |
"""Simple context manager for impersonating the current logged-in user | |
under Windows OS. | |
Requires: | |
pywin32 | |
""" | |
import ctypes | |
from win32process import GetWindowThreadProcessId | |
from win32api import OpenProcess |
import win32wnet, win32netcon | |
from impersonate import ImpersonateUser | |
with ImpersonateUser(): | |
# map the drive using the current user's login | |
try: | |
nr = win32wnet.NETRESOURCE() | |
nr.dwScope = win32netcon.RESOURCE_GLOBALNET | |
nr.dwType = win32netcon.RESOURCETYPE_DISK | |
nr.dwUsage = win32netcon.RESOURCEUSAGE_CONNECTABLE |
Notes to create a personal code-signing certificate. Assumes that Easy-RSA is already set up as Certificate Authority. | |
Tools used: | |
OpenSSL | |
Easy-RSA | |
signtool.exe (winget install Microsoft.WindowsSDK) | |
Using OpenSSL: | |
Generate a key and a certificate signing request |