I hereby claim:
- I am bengosney on github.
- I am 00dog (https://keybase.io/00dog) on keybase.
- I have a public key whose fingerprint is 5DCA 60FD DC95 174F FAB7 E08E 9059 AFB5 FD42 59E8
To claim this, I am signing this object:
#!/bin/bash | |
max_bat=`cat /sys/class/power_supply/BAT0/charge_full` | |
cur_bat=`cat /sys/class/power_supply/BAT0/charge_now` | |
per_bat=`echo "scale=0; $cur_bat*100/$max_bat" | bc` | |
status=`cat /sys/class/power_supply/BAT0/status | grep Discharging` | |
if [ $per_bat -le 100 ]; then | |
echo -ne "$(tput sgr0)" |
I hereby claim:
To claim this, I am signing this object:
Turn it pinkish | |
gatttool -b D0:39:72:C8:40:F0 --char-write-req -a 0x0043 -n 56ff5e5300f0aa | |
Warm | |
56000000ff0faa | |
56000000860faa | |
BB - brightness of warm | |
Colour | |
56 RR GG BB 00f0aa |
--- | |
- name: Check current timezone | |
shell: "timedatectl | gawk -F'[: ]+' ' $2 ~ /Timezone/ {print $3}'" | |
register: current_zone | |
changed_when: False | |
- name: Set UTC timezone | |
file: src=/usr/share/zoneinfo/{{ timezone }} dest=/etc/localtime state=link force=yes | |
when: current_zone.stdout != '{{ timezone }}' |
import re | |
class EmailParamType(click.ParamType): | |
name = 'email' | |
email_re = re.compile(r"[^@]+@[^@]+\.[^@]+") | |
def convert(self, value, param, ctx): | |
if self.email_re.match(value): | |
return value | |
else: |
// Copyright 2018 Ben Gosney - MIT licence - https://opensource.org/licenses/MIT | |
const fs = require('fs'); | |
const mkdirp = (full_path) => { | |
while (!fs.existsSync(full_path)) { // loop untill the full path excists | |
let part_path = full_path; | |
while(!fs.existsSync(part_path)) { // this will be true after we find a dir we can make then loop and start again | |
try { |
#!/bin/bash | |
ASPELL=$(which aspell) | |
if [ $? -ne 0 ]; then | |
echo "Aspell not installed - unable to check spelling" >&2 | |
exit | |
else | |
WORDS=$($ASPELL --mode=email --add-email-quote='#' list < "$1" | sort -u) | |
fi | |
if [ -n "$WORDS" ]; then | |
printf "\e[1;33m Possible spelling errors found in commit message:\n\e[0m\e[0;31m%s\n\e[0m\e[1;33m Use git commit --amend to change the message.\e[0m\n\n" "$WORDS" >&2 |
.PHONY := serv, cleancd | |
.DEFAULT_GOAL := serv | |
SCRIPTFILE=simple-https-server.py | |
CERT=server.pem | |
IP=$(shell hostname -I | cut -f 1 -d " ") | |
DIR=$(shell pwd) | |
$(SCRIPTFILE): | |
@echo "" > $@ |
.PHONY: help clean test install all init dev | |
.DEFAULT_GOAL := install | |
.PRECIOUS: requirements.%.in | |
HOOKS=$(.git/hooks/pre-commit) | |
REQS=$(wildcard requirements.*.txt) | |
PYTHON_VERSION:=$(shell python --version | cut -d " " -f 2) | |
PIP_PATH:=.direnv/python-$(PYTHON_VERSION)/bin/pip | |
WHEEL_PATH:=.direnv/python-$(PYTHON_VERSION)/bin/wheel |
$size: 15px; | |
$background: white; | |
background-image: | |
linear-gradient(to right, $background, $background), | |
linear-gradient(to right, $background, $background), | |
radial-gradient(ellipse closest-side, rgba(0,0,0,.25) 0%,rgba(0,0,0,0) 100%), | |
radial-gradient(ellipse closest-side, rgba(0,0,0,.25) 0%,rgba(0,0,0,0) 100%); | |
background-position: left center, right center, -($size / 2) center, right (-($size / 2)) center; | |
background-repeat: no-repeat; | |
background-color: $background; |