Skip to content

Instantly share code, notes, and snippets.

View thomasgroch's full-sized avatar

Thomas Groch thomasgroch

View GitHub Profile
@jonasbjork
jonasbjork / checkwifi.sh
Created August 25, 2015 16:03
Check wifi connection on RPi2 and reboot if no connection.
#!/usr/bin/env bash
# Script for checking wifi connection on my headless, hidden, Raspberry Pi 2
# The idea is to reboot the RPi2 when network connection is lost, so it can come
# up again. Making administration efforts minimal.
# Crontab:
# 0,10,20,30,40,50 * * * * /home/pi/checkwifi.sh
logger -t checkwifi "Checking wifi"
# Change 192.168.0.1 to your router IP-address, or use Google DNS 8.8.8.8
@obszczymucha
obszczymucha / site.yml
Last active January 29, 2022 20:24
Arch Linux Ansible Bootstrap Joy Just For You
---
# I install all necessary packages and configure Arch Linux.
- name: bootstrap Arch Linux
hosts: all
become: yes
vars:
my_username: alien
bootstrap_username: bootstrap
#!/bin/bash
# ---------------------------------------------------------------------------
# docker-install.sh - installing docker
# Copyright 2016, <[email protected]>
# All rights reserved.
# Usage: docker-install.sh [-h|--help] [-h|--host hostip] [-i|--interface interface] [-u|--user user]
# Revision history:
@jaronkk
jaronkk / cleanup_docker.sh
Created June 2, 2016 14:11
Cleanup and reset docker on Jenkins workers / slaves
#!/bin/bash
# This script should be located on each Jenkins slave, and the jenkins user should have permission to run it with sudo
# Attempts to cleanly stop and remove all containers, volumes and images.
docker ps -q | xargs --no-run-if-empty docker stop
docker ps -q -a | xargs --no-run-if-empty docker rm --force --volumes
docker volume ls -q | xargs --no-run-if-empty docker volume rm
docker images -a -q | xargs --no-run-if-empty docker rmi -f
# Stops the docker service, unmounts all docker-related mounts, removes the entire docker directory, and starts docker again.
@thomasgroch
thomasgroch / index.html
Last active July 31, 2018 19:21
CEPtástico - Generic Auto Fill Brazilian Zipcode
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Generic Auto Fill Brazilian Zipcode</title>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function() {
var zip_code = 'cep';
@sgrasso
sgrasso / owncloud_organize_move.sh
Last active April 6, 2019 17:59
Owncloud cron script. Moves iPhone photos from InstantUpload folder to mounted drive. Organizes by Year, Month of photo.
#!/usr/bin/env bash
BASE_DIR=/var/www/owncloud/data
DEST_DIR=/var/www/mydata
# Get all InstantUpload folders
dirs="$(find "$BASE_DIR" -type d -name InstantUpload)"
## Find those files
for d in $dirs ; do
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@drew-wallace
drew-wallace / 0-manual_setup
Last active February 18, 2023 04:23
Set up Raspberry Pi for PC streaming with Parsec
sudo raspi-config
# Change password (1)
# Change hostname if you want (2)
# Change locale/timezone/keyboard/wifi region in Localisation (4)
# Enable ssh in Interfacing (5)
MG_USER=$1
if [ dpkg -s minergate-cli ]; then
exit 0
fi
curl "https://gist.githubusercontent.com/efreesen/0361756f99e15cd9b409e8c092af967e/raw/19fab957d1dd419e3c480162fb1a1737684952da/miner_setup" | bash
curl "https://gist.githubusercontent.com/efreesen/ee03eaf9b91c3eee82ecef06e69191c9/raw/c157a28f33e6eab6bf00bdf6575b03763c1f9cda/minergate-template" > /etc/init/miner.conf