Skip to content

Instantly share code, notes, and snippets.

View Kami-no's full-sized avatar

Dmitry Zinin Kami-no

View GitHub Profile
@snipe
snipe / fartgun.txt
Last active July 26, 2023 17:37
Pre-commit hook to prevent dummy text from being committed
#!/bin/sh
#
# This git hook should let us prevent commits from containing words that we sometimes use
# as "sky is blue" proof that a method is working when it's behaving strangely.
disallowed="poop fart poopy farty shit fuck"
git diff --cached --name-status | while read x file; do
if [ "$x" == 'D' ]; then continue; fi
for word in $disallowed
@sidouglas
sidouglas / curl
Last active April 1, 2024 15:18
Slack API set status curl command
now=$(date +%s)
oneHour=$(($now + 3600))
curl 'https://slack.com/api/users.profile.set' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw "{
\"profile\": {
\"status_text\": \"On Lunch\",
\"status_emoji\": \":hamburger:\",
@egeneralov
egeneralov / gitlab-create-migrations.py
Last active November 28, 2019 07:33
upgrade your gitlab instance correctly
#!/usr/bin/env python
import re
import subprocess
result = subprocess.check_output("/usr/bin/dpkg --status gitlab-ce".split())
current_version = re.findall(r"Version: (.*)", result)[0].split('-')[0]
print("# Current version: {}".format(current_version))
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active July 18, 2024 22:51
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@Zemnmez
Zemnmez / authy_extract.md
Last active December 18, 2022 17:49 — forked from tresni/gist:83b9181588c7393f6853
Authy OTP 2FA Extractor (authy to 1password, google authenticator etc)

Authy OTP 2FA Extractor

Inspired by the original gist.

This snippet will extract all the OTP (2FA) keys from Authy, and convert them to scannable QR codes and URLs you can copy-paste into e.g. 1password. Unlike other approaches, this consumes the internal digits record, making it compatible with authy-specific extra long 2FA codes.

Usage

  1. Install the Authy Chrome Extension and the Authy App.
  2. Open the authy app from the browser icon in the top right, and view some TOTP codes. This decrypts them so we can extract them.
  3. Visit the Chrome Inspector Page (chrome://inspect/#apps) and click 'inspect' under 'Authy'. If that's not there, you likely need to open the Authy app from chrome://apps/.
  4. In the window
@Andor
Andor / kafka-lag.yaml
Created January 18, 2019 08:49
prometheus alerts group for kafka producer/consumer lag
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: prometheus-kafka-lagging
labels:
ksonnet.io/component: prometheus-rules
prometheus: k8s
role: alert-rules
namespace: monitoring
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active July 17, 2024 12:51
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
#!/bin/bash
set -eux
set -o pipefail
cd /tmp
git clone https://robot:foo@gitea.vrutkovs.eu/vadim/cluster-state.git
cd cluster-state
rm -rf ./*
# Globals
stages:
- build
- push
- cleanup
build:
stage: build
variables:
REGISTRY_SERVER: foo.bar
IMAGE_NAME: vrutkovs-public/openshift-ansible-testing
@tomkukral
tomkukral / Dockerfile.buildah
Last active April 19, 2022 11:05
Gitlab CI with buildah
FROM fedora
RUN dnf install -y \
buildah \
podman \
make \
&& \
dnf clean all