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 bash | |
# This script get all logs from all containers in the namespace | |
# Usage | |
# ./all-logs.sh -n [namespace] -s [hours] | |
# parse args | |
while getopts ":n:s:" opt; do | |
case $opt in | |
n) namespace="$OPTARG" |
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 bash | |
## | |
# Simle script to update domain resolve in OC masters | |
## | |
set -eu | |
AWS_PROFILE="" | |
HOSTED_ZONE_ID="" | |
DOMAIN="" |
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 <Adafruit_NeoPixel.h> | |
// necessary constants | |
const unsigned int ambient_diode_pin = A1, // input pin for ambient light phototransistor | |
set_moisturize_level_input_pin = A2, // input pin for DIP switch to set level of moisturize start | |
set_moisturize_duration_input_pin = A3, // input pin for DIP switch to set moisturize duration time | |
night_only_pin = 3, // input pin for DIP switch to set if we want to check if it's dark | |
moisture_sensor_pin = A0, // input pin for moisture sensor | |
motor_enable_pin = 10, // output pin to set motor speed | |
motor_pin1 = 9, // output pin for motor connector 1 |
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
// required liblaries | |
#include <LiquidCrystal_I2C.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266WebServer.h> | |
#include <Adafruit_BME280.h> | |
#include <RTClib.h> | |
#include <uptime_formatter.h> | |
#include <NTPClient.h> | |
#include <WiFiUdp.h> | |
#include <Timezone.h> |
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 datetime import datetime | |
import requests | |
from requests.exceptions import HTTPError | |
WEATHER_API_URL="http://<api-url>" | |
WEATHER_API_ENDPOINT = "/api/v1/sensor" | |
def run() -> None: | |
api = f"{WEATHER_API_URL}{WEATHER_API_ENDPOINT}" | |
try: |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.yubikey.app</string> | |
<key>Program</key> | |
<string>/Users/[user]/.yubico/yubikey-daemon.sh</string> | |
<key>KeepAlive</key> | |
<true/> |
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 | |
LAST_STATE=`system_profiler SPUSBDataType | grep -ci yubikey | cat` | |
while : | |
do | |
CURRENT_STATE=`system_profiler SPUSBDataType | grep -ci yubikey | cat` | |
if [ $LAST_STATE -eq $CURRENT_STATE ]; then | |
# do nothing | |
true | |
elif [ $LAST_STATE -lt $CURRENT_STATE ]; then | |
#echo "Key inserted" |
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 python2.7 | |
# -*- coding: utf-8 -*- | |
# encoding=utf8 | |
import re | |
import pprint | |
import json | |
import requests | |
import base64 | |
import sys |
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/sh | |
########################################################################### | |
# use freemem [lvl] [limit to run /num//unit/] [limit to 0- total 1- cache] # | |
# example usage ./freemem 3 3G 0 # | |
# author Mikolaj 'Metatron' Niedbala # | |
# licenced GNU/ GPL # | |
########################################################################### | |
echo $1 $2 $3 | |
if [ "$1" -gt "3" ]; then | |
echo "Cache cleaning level out of range" |