Skip to content

Instantly share code, notes, and snippets.

Avatar

Sandro Machado SandroMachado

View GitHub Profile
@SandroMachado
SandroMachado / pi-reboot-on-network-failure
Created May 14, 2017
Script to reboot the raspberry pi if there is no network available
View pi-reboot-on-network-failure
#!/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
@SandroMachado
SandroMachado / convert-to-webp.sh
Last active Jan 13, 2021
Script to convert all the `JPEG` images to the `WEBP` format in your Android project
View convert-to-webp.sh
#/bin/sh
# Inpiration: http://engineeringblog.yelp.com/2016/05/yelp-android-app-went-on-a-diet.html
# `-lossless` not used to give support for Android 4.0+
# Make sure cwebp is installed.
if ! type "cwebp" > /dev/null; then
echo "Please install cwebp to continue:"
echo "brew install webp"
exit 1
fi
View gist:34834c353fe353a7bf668ad2977b5ece
### Keybase proof
I hereby claim:
* I am SandroMachado on github.
* I am sandromachado (https://keybase.io/sandromachado) on keybase.
* I have a public key whose fingerprint is 64A2 1ECB 97A1 604B D5B3 967E D630 EF06 008C 09AA
To claim this, I am signing this object: