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
blueprint: | |
name: Appliance has finished | |
description: Do something when an appliance (like a washing machine or dishwasher) | |
has finished as detected by a power sensor. | |
domain: automation | |
input: | |
power_sensor: | |
name: Power Sensor | |
description: Power sensor entity (e.g. from a smart plug device). | |
selector: |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>A simple clock</title> | |
</head> | |
<body translate="no" > |
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 | |
c_FAN=26 # gpio pin the fan is connected to | |
c_MIN_TEMPERATURE=45 # temperature in degrees c when fan should turn on | |
c_TEMPERATURE_OFFSET=2 # temperarute offset in degrees c when fan should turn off | |
c_HARDDRIVE="sda" # name of your harddrive | |
temperature_offset=$(( $c_MIN_TEMPERATURE - $c_TEMPERATURE_OFFSET )) | |
fan_state=0 |
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
import os | |
import errno | |
from subprocess import call | |
from gitlab import Gitlab | |
def mkdir_p(path): | |
try: | |
os.makedirs(path) | |
except OSError as exc: # Python >2.5 | |
if exc.errno == errno.EEXIST and os.path.isdir(path): |
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 | |
RED='\033[0;31m' | |
GREEN='\033[1;32m' | |
BLUE='\033[1;34m' | |
NC='\033[0m' # No Color | |
echo -e "${BLUE}System update${NC}" | |
sudo apt-get update #2>&1 >/dev/null | |
echo -e "${BLUE}System upgrade${NC}" | |
sudo apt-get upgrade -y #2>&1 >/dev/null |
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 | |
# should install jq first, for mac:brew install jq | |
# Documentation | |
# https://docs.gitlab.com/ce/api/projects.html#list-projects | |
NAMESPACE="your group name in gitlab" | |
BASE_PATH="https://gitlab.example.com/" | |
PROJECT_SEARCH_PARAM="" |
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 | |
# Documentation | |
# https://docs.gitlab.com/ce/api/projects.html#list-projects | |
if [[ `whoami` == "root" ]]; then | |
echo "DO NOT run this program as root! Quitting." | |
exit 1 | |
fi |
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 | |
# Documentation | |
# https://docs.gitlab.com/ce/api/projects.html#list-projects | |
# NAMESPACE="YOUR_NAMESPACE" | |
BASE_PATH="YOUR_GIT_SERVER_PATH" | |
# PROJECT_SEARCH_PARAM="YOUR_SEARCH_PARAM" | |
if [ -z "$GITLAB_PRIVATE_TOKEN" ]; then |
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 | |
# Documentation | |
# https://docs.gitlab.com/ce/api/projects.html#list-projects | |
NAMESPACE="YOUR_NAMESPACE" | |
BASE_PATH="https://gitlab.example.com/" | |
PROJECT_SEARCH_PARAM="" | |
PROJECT_SELECTION="select(.namespace.name == \"$NAMESPACE\")" | |
PROJECT_PROJECTION="{ "path": .path, "git": .ssh_url_to_repo }" |
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 'bundler/setup' | |
# TWO WAYS TO RUN THIS SCRIPT: | |
# ---------------------------- | |
# --->>> THE FIRST WAY> Run this script as executable: `./clone_gitlab_projects.rb` | |
# You need to make the script executable: `chmod +x gitlab_clone_all_repos.rb` | |
# ---- ANYTHING ABOVE THIS LINE IS ONLY REQUIRED IF YOU WANT TO RUN THE SCRIPT WITH SINGLE COMMAND `./clone_gitlab_projects.rb` ---- # |
NewerOlder