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
# Clear all Android packages and user data via ADB, by @noseratio | |
# Run: powershell -f adb-clear-packages.ps1 | |
# To get ADB: https://community.chocolatey.org/packages/adb | |
# | |
# Q: Why not a factory reset? | |
# A: https://www.reddit.com/r/Android/comments/naetg8/a_quick_powershell_script_for_clearing_user_data/gxtaswl?context=3 | |
$confirmation = Read-Host "This will clear all packages data and user files. Are you sure you want to proceed? (y|n)" | |
if ($confirmation -ne 'y') { | |
return |
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
# found this useful at work, probably will be useful again | |
declare -a http_code | |
http_code[000]="Unknown" | |
http_code[100]="Continue" | |
http_code[101]="Switching Protocols" | |
http_code[200]="OK" | |
http_code[201]="Created" | |
http_code[202]="Accepted" | |
http_code[203]="Non-Authoritative Information" | |
http_code[204]="No Content" |
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 | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
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
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c> |
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 | |
# template script for running a command as user | |
# The presumption is that this script will be executed as root from a launch daemon | |
# or from some management agent. To execute a single command as the current user | |
# you can use the `runAsUser` function below. | |
# by Armin Briegel - Scripting OS X | |
# |
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 | |
# Creates DISK0.tree, DISK1.tree, DISKx.tree inside each disk, with the output of tree command. | |
# After generating the report, it send via email using mail. | |
# To add more disks, just add DISK[x]=/full/path to the disk. Just make sure that the array index are sequencial. | |
# Why this? | |
# With the reports from tree, in case of disk failure, you will know which file got lost and you can recover them, downloading or via backups. | |
# GIST: https://gist.github.com/rafaelbiriba/0ee7ca2baec1ef80a878c825295f09e1 | |
EMAIL_ADDRESS="" # EMAIL_ADDRESS="[email protected]" or leave it blank "" to disable email | |
DISKS[0]="/srv/dev-disk-by-id-ata-WDC_WD80EMAZ-00WJTA0_ABC123-part1" |
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
<!-- | |
/* | |
* Serverless contact form handler for Cloudflare Workers. | |
* Emails are sent via Mailgun. | |
* | |
* Learn more at https://maxkostinevich.com/blog/serverless-contact-form | |
* Live demo: https://codesandbox.io/s/serverless-contact-form-example-x0neb | |
* | |
* (c) Max Kostinevich / https://maxkostinevich.com | |
*/ |
This is now moved here: https://home-assistant.io/lovelace
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
# prerequisites: | |
## install software | |
apt install mariadb-server libmariadbclient-dev sqlite3 | |
## install mysqlclient in virtualenv | |
su -c 'homeassistant/bin/pip3 install mysqlclient --upgrade' -l homeassistant | |
## create database | |
mysql -e 'CREATE SCHEMA IF NOT EXISTS `hass_db` DEFAULT CHARACTER SET utf8' | |
## create user (use a safe password please) | |
mysql -e "CREATE USER 'hass_user'@'localhost' IDENTIFIED BY 'hass_pw'" | |
mysql -e "GRANT ALL PRIVILEGES ON hass_db.* TO 'hass_user'@'localhost'" |
NewerOlder