This file contains hidden or 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
#!/bin/bash | |
# This script pings an IP address at regular intervals and plays a sound | |
# indicating the IP address is reachable or unreachable. | |
IP=$1 | |
DELAY=10 | |
TIMEOUT=3 | |
# Check if an IP address was provided as an argument | |
if [ -z "$IP" ]; then |
This file contains hidden or 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
#!/bin/bash | |
#-------------------------------------------------- | |
# Set touchscreen to monitor mapping | |
declare -A mapping | |
mapping["ELAN9008:00 04F3:4063"]="eDP-1" | |
mapping["ELAN9009:00 04F3:4068"]="DP-1" | |
This file contains hidden or 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
#!/bin/bash | |
echo "Cleaning Xcode..." | |
# Clear Xcode Caches | |
CLEANDIRS=("~/Library/Developer/Xcode/DerivedData" \ | |
"~/Library/Caches/org.swift.swiftpm" \ | |
"~/Library/Caches/org.swift.swiftpm.$USER" \ | |
"$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" \ | |
"$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$USER/ModuleCache" \ |
This file contains hidden or 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
{ | |
"workbench.startupEditor": "none", | |
"workbench.sideBar.location": "right", | |
"editor.renderWhitespace": "boundary", | |
"editor.suggest.snippetsPreventQuickSuggestions": false, | |
"emmet.showAbbreviationSuggestions": false, | |
"editor.wordBasedSuggestions": "off", | |
"editor.snippetSuggestions": "none", | |
"editor.inlineSuggest.enabled": true, | |
"editor.acceptSuggestionOnCommitCharacter": false, |
This file contains hidden or 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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <filesystem> | |
#include <cstdlib> | |
#include <regex> | |
/** This program executes a command for each file in a directory that matches a filter. | |
Usage : test_args <directory> <file-filter> <executable> [extra arguments...] |
This file contains hidden or 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
#!/bin/bash | |
# http://github.com/wheresjames | |
# Run this from the command line like | |
# | |
# $ ~/path/to/cmake-tasks.sh clean-config-build release build ./some/cmake/project | |
# | |
# OR | |
# | |
# $ cd ./some/cmake/project |
This file contains hidden or 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
echo $DOMAINNAME | |
# Get cert expire info | |
EXPDATE=$(echo | openssl s_client -servername $DOMAINNAME -connect $DOMAINNAME:443 2>/dev/null | openssl x509 -noout -enddate) | |
EXPDATE2=${EXPDATE[@]:9} | |
FMTDATE=$(date --date="$EXPDATE2" "+%Y-%m-%d %H:%M:%S") | |
# Cert expire time | |
EXPTIME=$(date --date="$EXPDATE2" +%s) |
This file contains hidden or 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 promiseWhile(cond, prom) { | |
return prom().then(r=> { return cond(r) ? promiseWhile(cond, prom) : r; }); | |
} | |
function countTo(n) { | |
let i = 0; | |
return promiseWhile((r)=> r < n, () => { | |
return new Promise((resolve, reject)=> { | |
console.log(i); | |
setTimeout(()=>{i++; resolve(i);}, 1000); |
This file contains hidden or 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
#!/bin/bash | |
#-------------------------------------------------------------------------------------------------- | |
# | |
# Examples | |
# | |
# Setup new instance | |
# $ ./linode-deploy.sh create-setup <username> newserver.example.com | |
# | |
# After you've added the IP address to your DNS, get a lets encrypt cert with |
This file contains hidden or 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 python3 | |
from __future__ import print_function | |
import os | |
import sys | |
import time | |
import json | |
import random | |
import inspect | |
import argparse |
NewerOlder