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 is an example of connecting poles from | |
// https://gist.github.com/BarDweller/f467cb58f5c252efda60eaa6777309ca | |
poleradius = 9/2; //radius of pole | |
socketdepth = 15; //depth required for pole socket (note: not absolute due to ball join) | |
totalplugsize = 20; //exterior depth of pole corner | |
wallthick = 2; //thickness for walls | |
joinangle = 120; //angle to join two connectors at. | |
smoothness = 64; //number of faces for cylinder/sphere. |
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 can be found/tracked at this public GIST: | |
# https://gist.github.com/seakintruth/ab55e008d6bdda78c97d7d1a124d93b0 | |
# Modified from These: | |
# https://gist.github.com/MatthewSteeples/ce7114b4d3488fc49b6a?permalink_comment_id=3682064 | |
# https://stackoverflow.com/a/15846912 | |
$defaultNumLockStateOff = $false | |
$defaultScrollLockStateOff = $true | |
$defaultCapsLockStateOff = $true |
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
function Get-IniFile { | |
<# | |
.SYNOPSIS | |
Read an ini file. | |
.DESCRIPTION | |
Reads an ini file into a hash table of sections with keys and values. | |
.PARAMETER filePath | |
The path to the INI file. |
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 requests | |
# From https://stackoverflow.com/a/28374584 | |
def downloadfile(name,url): | |
name=name+".mp4" | |
r=requests.get(url) | |
print("****Connected****") | |
f=open(name,'wb'); | |
print("Downloading.....") | |
for chunk in r.iter_content(chunk_size=255): |
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/env bash | |
# using template from: https://betterdev.blog/minimal-safe-bash-script-template/ | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f || --folder_name] "a folder name" |
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/env Rscript | |
if (!require("pacman")) install.packages("pacman") | |
pacman::p_load(tcltk) | |
# From: https://gist.githubusercontent.com/jbryer/3342915/raw/07cede2640889d82944e604be6a4840a964a1a58/varEntryDialog.r | |
#' Creates a dialog box using tcl/tk to get input from the user. | |
#' | |
#' This function will create a tcl/tk dialog box to get user input. It has been | |
#' written to be extensible so the R programmer can easily create a dialog with | |
#' any number of varaibles with custom labels and data conversion of the user |
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/env bash | |
# set log path | |
LogPath=/data/logs/crontab/dynamic_dns.txt | |
echo "---------------------------------" >> $LogPath | |
date -u >> $LogPath | |
echo "---------------------------------" >> $LogPath | |
# get this machine's public IP address from a service | |
# [TODO] currently only icanhazip is working, need to check the syntax of the others | |
remoteIp=$(curl ifconfig.me) |
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_pretty_timestamp_diff <- function( | |
start_timestamp, | |
end_timestamp, | |
seconds_decimal=2, | |
round_simple=TRUE | |
){ | |
# Set defaults | |
.days_decimal <- 0 | |
.days <- 0 | |
.hours_decimal <- 0 |
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
def extractDomain(data): | |
# Remove protocol part of url | |
data = re.sub(r"^http(s)?\x3a\x2f\x2f", "", str(data), flags=re.IGNORECASE) | |
# Remove part after FQDN | |
data = re.sub(r"\x2f(.*)$", "", str(data), flags=re.IGNORECASE) | |
# Remove port | |
data = re.sub(r"\x3a\d{1,}$", "", str(data), flags=re.IGNORECASE) |
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
'Notes: Visual Basic (VBScript, or VBA) to handle UNIX like Epoch Timestamps with timezone corrections to UTC | |
' TimeStampEpoch, and date2epoch functions return epoch as fracional decimal values in seconds since epoch | |
'Maintained at:https://gist.github.com/seakintruth/ddcc3d5e400a5083458494ae30d55466 | |
'Dependencies: Windows with "WbemScripting.SWbemDateTime", a default 32bit app | |
'Contributing: Jeremy D. Gerdes<seakintruth@gmail.com>, https://stackoverflow.com/a/22842128 | |
'License: CC-BY-SA 3.0 | |
'Version: 1.0.6 | |
Function TimeStampEpoch() | |
'Returns a time stamp in the format of seconds since epoch | |
' Use this when you need epoch values, from testing, calling Timer() is roughly 10 times faster than calling TimeStampEpoch |
NewerOlder