Skip to content

Instantly share code, notes, and snippets.

Avatar

rslay

View GitHub Profile
@rslay
rslay / set_date_with_timezone.sh
Created April 17, 2021 02:47
Script to set datetime localtime $TZ Variable
View set_date_with_timezone.sh
# Adjust the number 2 to suit your needs, or use a different timezone like PDT
export TZ=EST2EDT
# Get the current time from an internet site (clearly, not a reliable method) and store into file
wget "https://www.utctime.net/" -O curtime.txt && grep "td>UTC</td" curtime.txt|head -n 1|cut -f 4 -d '>'|cut -f 1 -d '<'|sed -e 's/T/ /g'|
# Remove the Z character (for me, on a weird Unix distro, this causes the date command issues)
sed -e 's/Z//g' > curtime_fmt.txt &&
# Take a few seconds, just in case, because some versions of wget theoretically(?) might not be blocking
@rslay
rslay / tasks.json
Last active December 7, 2019 20:58
vscode tasks.json - real-world example w/ multiple commands
View tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Build for Windows x64",
"type": "shell",
// Place the labels of commands in this array, in order. More can be added.
"dependsOn":["UpdateFiles", "WarpExe"],
"command": "echo",
"args": [