(Also see [remarkable][], the markdown parser created by the author of this cheatsheet)
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
[alias] | |
st = status | |
co = checkout | |
ci = commit | |
br = branch | |
df = diff | |
lp = log -p | |
com = checkout master | |
fe = fetch origin | |
hr = reset origin/master --hard |
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
# MIB2YAML converts MIB files to YAML files for the Ruby SNMP library with support for imports | |
# | |
# The code is heavily based on http://snmplib.rubyforge.org/, the only addition is the "find imports" block | |
require 'rubygems' | |
require 'fileutils' | |
require 'yaml' | |
module MIB2YAML | |
def MIB2YAML.convert(module_file, mib_dir = '.') |
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
-- 多分こんな感じでできる | |
local x_hub_signature = ngx.hader['X_Hub_Signature'] | |
local body = ngx.req.read_body | |
local expected_signature = 'sha1=' .. ngx.hmac_sha1(ngx.var.secret_token, body) | |
if expected_signature ~= x_hub_signature then | |
ngx.log(ngx.WARN, 'Invalid access detected') | |
ngx.header.content_type = 'text/plain' | |
ngx.status = ngx.HTTP_UNAUTHORIZED | |
ngx.print('401 Access Denied') |
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
# The original settings confirmed by running: rpm --showrc | |
# -14: __gpg %{_bindir}/gpg2 | |
# -14: __gpg_check_password_cmd %{__gpg} | |
# gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so - | |
# | |
# -14: __gpg_sign_cmd %{__gpg} | |
# gpg --batch --no-verbose --no-armor --passphrase-fd 3 | |
# %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} | |
# --no-secmem-warning | |
# -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename} |
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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
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'" |
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
// dm Klopapier Widget | |
// | |
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com> | |
// | |
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL | |
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | |
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | |
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE |
The Brother P-touch Cube PT-P300BT labelling machine is intended to be controlled from the official Brother P-touch Design&Print 2 app for Android and iOS devices, instead of from a computer.
This Gist provides small code revision and some additional scripts to the dogtopus/Pipfile one, which in turn is forked from the excellent stecman one, in order to print text labels via scripts on computers with different O.S. or subsystems.
The scripts are used to convert text labels to appropriate images compatible with 12mm width craft tapes like [TZe-131
OlderNewer