Skip to content

Instantly share code, notes, and snippets.

@g3rhard
g3rhard / promtail_docker_logs.md
Created July 7, 2021 15:11 — forked from ruanbekker/promtail_docker_logs.md
Docker Container Logging using Promtail
name: deploy api
on:
push:
branches:
- master
release:
types: [created]
env:
@g3rhard
g3rhard / proxy.conf
Created May 21, 2021 10:49 — forked from sirsquidness/proxy.conf
How to have nginx proxy_pass follow upstream 302 redirects (eg, when you're running a steam cache and you're behind Cox's layer 7 interception stuff)
# This config came around after a friend had problems with a Steam cache on his
# Cox internet connection. Cox would intercept any requests to Steam content
# servers and return a 302 to Cox's servers. The cache would return the 302
# to the Steam client, and the Steam client would go directly to Cox, bypassing
# the cache.
# This config makes nginx follow the 302 itself, and caches the result of the
# redirect as if it was the response to the original request. So subsequent
# requests to the URL that returned a 302 will get the file instead of a 302.
@g3rhard
g3rhard / new_sysadmin_job_todo_check_list.md
Created February 22, 2021 10:45
New sysadmin job - preparing a to-do/check list

New sysadmin job - preparing a to-do/check list (credits: https://www.reddit.com/r/sysadmin/comments/5ioemb/new_sysadmin_job_preparing_a_todocheck_list/) I change my sysadmin job for two months (after 10 years working in current workplace). I prepared a list of things to accomplish in my new workplace based on multiple posts on r/sysadmin Each comment will be valuable.

Audit/check/Inventory/review:

  • Scope definition: Are you responsible for electricity, laptops, desktops, software support, mobile phones, server, online services the company uses, defining policies, etc
  • General documentation: do not impove until you understand the environment (do backup before change)
  • Crucial services inventory: Identify mission critical services and where they are hosted; identify who is responsible for them if its not you
  • [DR] Disaster Recovery Plan: Backups are running properly? Backup rotation? Last DR test? Automated? In case of my absence?
  • [BC] Business Continuity Plan
  • [BIA] Business Impact Analysis
  • Network
@g3rhard
g3rhard / script-template.sh
Created December 14, 2020 15:22 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
trap cleanup SIGINT SIGTERM ERR EXIT
usage() {
cat <<EOF
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@g3rhard
g3rhard / docker-compose.yml
Created August 8, 2020 10:23
Wireguard in Docker via docker-compose
---
version: "2.1"
services:
wireguard:
image: linuxserver/wireguard
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
@g3rhard
g3rhard / commit-msg
Created July 17, 2020 09:34 — forked from insoul/commit-msg
git commit hook for redmine
#!/usr/bin/env ruby
BASEDIR = ENV["HOME"] + "/.git_redmine"
require BASEDIR + "/git_redmine"
include GitRedmine::Hooks
exit commit_msg(ARGV[0])
@g3rhard
g3rhard / google-dorks
Created June 30, 2020 11:28 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!

Obtain Mi Home device token

Use any of these methods to obtain the device token for the supported miio devices.

Method 1 - Obtain device token for miio devices that hide their token after setup

Use one of these methods to obtain the device token for devices that hide their tokens after setup in the Mi Home App (like the Mi Robot Vacuum Cleaner with firmware 3.3.9_003077 or higher). This is usually the case for most Mi Home devices. The latest versions of the Mi Home smartphone app dont hold the token anymore so before you begin with any of these methods you will need to install an older version of the smartphone app. Version 5.0.19 works for sure with the 1st gen Vacuum Robot, for the 2nd gen (S50) you should try version 3.3.9_5.0.30. Android users can find older version of the app here.

Android users

Rooted Android Phones

  • Setup your Android device with the Mi Home app version 5.0.19 or lower
  • Install [aSQLiteManager](https://play.google.c