Skip to content

Instantly share code, notes, and snippets.

@joel-wright
joel-wright / WD_Green_spin_down.md
Last active August 29, 2015 14:02
HD Idle Manual Spin Down
import base64
import json
import tarfile
import time
files = {
'c/o': {'name': 'tox.ini', 'size': 3935},
'c/o2': {'name': 'setup.cfg', 'size': 4396}
}
[tool.poetry]
name = "test-default"
version = "0.1.0"
description = ""
authors = ["Joel Wright"]
[[tool.poetry.source]]
name = "pypi-simple"
url = "https://pypi.org/simple/"
default = true
@joel-wright
joel-wright / set-backlight.sh
Created January 9, 2017 23:27
AW13 OLED Set Brightness
#!/bin/bash
sleep 1
if [ -f ~/.brightness ]
then
read -r br < ~/.brightness
bri=`echo "${br} * 100" | bc -l | xargs printf "%.0f\n"`
echo $bri
if [ ${bri} -gt 100 ]
@joel-wright
joel-wright / monitor-backlight.sh
Created January 9, 2017 23:26
AW13 OLED Monitor Brightness
#!/bin/sh
path=/sys/class/backlight/intel_backlight
luminance() {
read -r level < "$path"/actual_brightness
factor=$((max / 100))
ret=`printf '%d\n' "$((level / factor))"`
if [ $ret -gt 100 ]; then
ret=100
fi