This file contains 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 ruby | |
require 'rubygems' | |
require 'rb-fsevent' | |
require 'ruby-growl' | |
def sync(local, host, remote, growl) | |
# Construct the bash command that runs rsync. |
This file contains 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 should do: | |
# | |
# 1) test if nfs folder is mounted and exit 0 if yes | |
# 2) try to mount it and exit 0 if success | |
# 3) try to wake the server if not possible to mount | |
# 4) wait while its not woked (pinging) | |
# 5) try againt 2-4 several times |
This file contains 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
# Get the server name | |
$hostName = hostname | |
# Define the email address to send notifications to | |
$toAddress = "[email protected]" | |
# Send the notification | |
Send-MailMessage -To $toAddress -From "[email protected]" -SmtpServer smtp.contoso.com -Subject "$hostName - Server Reboot" -Body "The server $hostName has rebooted." |
This file contains 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
from twisted.internet.protocol import DatagramProtocol | |
from twisted.internet import reactor | |
import time | |
class Echo(DatagramProtocol): | |
def datagramReceived(self, data, (host, port)): | |
print "received %r from %s:%d" % (data, host, port) | |
# Login |
This file contains 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
from twisted.internet.protocol import DatagramProtocol | |
from twisted.internet import reactor | |
import time | |
import RPi.GPIO as GPIO | |
#import time | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setwarnings(False) | |
for x in range(2, 7): | |
GPIO.setup(x, GPIO.OUT) |
This file contains 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 <FS.h> | |
#include <ESP8266WiFi.h> | |
#include <WiFiClientSecure.h> | |
#include <PubSubClient.h> | |
#include <time.h> | |
// Insert your FQDN of your MQTT Broker | |
#define MQTT_SERVER "mqtt.srvx1.local" | |
const char* mqtt_server = MQTT_SERVER; |
This file contains 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
/* | |
Project: ESP32 Bluetooth Mobile Robot | |
Board: | |
- ESP32 Dev Module (Node32 Lite) | |
https://my.cytron.io/p-node32-lite-wifi-and-bluetooth-development-kit | |
*/ | |
#include <BluetoothSerial.h> | |
BluetoothSerial btSerial; | |
#define BT_NAME "ESP32BT-Idris" // Set bluetooth name |

This file contains 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
using Newtonsoft.Json; | |
///Use of Newtonsoft.Json is fully optional | |
namespace Backend | |
{ | |
[JsonObject] | |
public struct GameState | |
{ | |
[JsonProperty("maxPlayers")] public int MaxPlayers; | |
[JsonProperty("imposterCount")] public int ImposterCount; |
This file contains 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
# Cleanup Docker weekly | |
### | |
# First clear all volumes that are not associated with containers | |
# This way volumes can live up to 2 weeks without use. | |
# | |
15 8 * * 1 docker volume prune | |
### | |
# Then clear all images that have not been used in last week. |
OlderNewer