Skip to content

Instantly share code, notes, and snippets.

View matthiasbayer's full-sized avatar

Matthias Bayer matthiasbayer

View GitHub Profile
@matthiasbayer
matthiasbayer / backlight.sh
Created April 22, 2016 23:07
Samsung ATIV Book 9 keyboard backlight toggle
#!/usr/bin/env bash
# Path can depend on laptop model
FILE=/sys/firmware/efi/efivars/KBDBacklitLvl-8be4df61-93ca-11d2-aa0d-00e098032b8c
NOW=$(xxd -p ${FILE})
if [ "0700000000" == "${NOW}" ]; then
echo 0700000005 | xxd -p -r > ${FILE}
echo "Backlight enabled"
else
@matthiasbayer
matthiasbayer / php7-build.sh
Created December 11, 2015 12:39
Build PHP7 from source
#!/usr/bin/env bash
set -e
PHP_DIR=${PHP_DIR:-/etc/php7/cli}
FPM_DIR=${FPM_DIR:-/etc/php7/fpm}
PHP_VERSION=${PHP_VERSION:-7.0.0}
MODS_DIR=${MODS_DIR:-/etc/php7/mods-available}
BUILD_DIR=/usr/src/php
@matthiasbayer
matthiasbayer / updateJetbrains.sh
Last active September 13, 2017 12:37
Install or update Jetbrains Software to latest EAP or stable version
#!/usr/bin/env bash
case "${1}" in
"phpstorm")
TOOL_NAME="PhpStorm"
INSTALL_DIR="/opt/phpstorm"
EAP_URL="https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program"
EAP_FILE="PhpStorm-EAP-[0-9\.]+(:?[a-z\-]+)?.tar.gz"
STABLE_URL="https://confluence.jetbrains.com/display/PhpStorm/Previous+PhpStorm+Releases"
STABLE_FILE="PhpStorm-[0-9\.]+.tar.gz"