Skip to content

Instantly share code, notes, and snippets.

View tblong's full-sized avatar

Tyler B. Long tblong

  • Atlanta, GA
View GitHub Profile
@SandroMachado
SandroMachado / pi-reboot-on-network-failure
Created May 14, 2017 20:15
Script to reboot the raspberry pi if there is no network available
#!/bin/bash
while true
do
wget -q --tries=10 --timeout=20 --spider http://google.com
if [[ $? -eq 0 ]]; then
echo "Online"
else
echo "Offline"
echo raspberry | sudo -S sudo reboot
fi
@fbrnc
fbrnc / file2cfn.php
Created October 31, 2015 05:07
CloudFormation File Helper
<?php
echo '{"Fn::Base64": {"Fn::Join": ["\n", ' . json_encode(file($argv[1], FILE_IGNORE_NEW_LINES), JSON_PRETTY_PRINT) . ']}}';
@mlapida
mlapida / EC2-Stopped-Tagged-Lambda.py
Last active January 30, 2023 15:09
Using a lambda function, stop all instances that are tagged appropriately.
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#define the connection
ec2 = boto3.resource('ec2')
@DanielSWolf
DanielSWolf / Program.cs
Last active May 2, 2024 18:33
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@renatolfc
renatolfc / android-client.ovpn
Created December 28, 2014 18:59
A sample OpenVPN client configuration file in the unified format
client
dev tun
remote example.com
resolv-retry infinite
nobind
persist-key
persist-tun
ca [inline]
cert [inline]
key [inline]