Skip to content

Instantly share code, notes, and snippets.

View reloni's full-sized avatar
🐡

Anton Efimenko reloni

🐡
  • Moscow
View GitHub Profile
@reloni
reloni / Dockerfile
Created September 8, 2020 07:37 — forked from jensmeder/Dockerfile
Dockerfile for running x86 applications with Wine in Alpine Docker Containers
FROM i386/alpine:3.10.2
# Wine 32Bit for running EXE
RUN apk add --no-cache wine=3.0.4-r1 freetype=2.10.0-r0
# Configure Wine
RUN winecfg
# Install wget
RUN apk add --no-cache wget=1.20.3-r0
@reloni
reloni / jwt-decode.sh
Created June 16, 2020 08:08 — forked from angelo-v/jwt-decode.sh
Decode a JWT via command line
function jwt-decode() {
sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq
}
JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
jwt-decode $JWT
@reloni
reloni / kubectl-shortcuts.sh
Created January 6, 2020 17:39 — forked from tamas-molnar/kubectl-shortcuts.sh
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
@reloni
reloni / Kubernetes tricks
Last active January 5, 2020 12:30
Kubernetes tricks
Get container last termination message:
kubectl get pod gotest-app-morty-5d6f6667c4-8bffb -o go-template="{{range .status.containerStatuses}}{{.lastState.terminated.message}}{{end}}"
Get events sorted by date:
kubectl get event --sort-by .lastTimestamp
Get events sorted, filtered by deployment name:
kubectl get event --sort-by .lastTimestamp --field-selector involvedObject.name=go-static-files-rick
Get logs filtered by label (suitable for deployments):
@reloni
reloni / gist:35bd12ec00c549f77d84977dec69e72c
Created December 27, 2019 13:02
Disable macOS security check for app
xattr -d com.apple.quarantine "path to app.app"
@reloni
reloni / Git tricks
Last active April 22, 2021 09:44
Git tricks
Get git commit history for period:
git log --oneline --no-merges --after="2019-C10-01" --until="2019-10-31" --author="Anton Efimenko" --format="%s"
Unique commit messages:
git log --oneline --no-merges --after="2019-C10-01" --until="2019-10-31" --author="Anton Efimenko" --format="%s" | uniq
commits count by author:
git shortlog -s -n --all --no-merges
@reloni
reloni / killwindowserver.sh
Created January 11, 2019 10:17
Kill windowserver
killall -HUP WindowServer
@reloni
reloni / EmojiPointersDemo.swift
Created August 22, 2018 03:56 — forked from cellularmitosis/EmojiPointersDemo.swift
Representing pointer values as emoji can be useful for "visually" debugging certain issues, like cell reuse, etc.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
@reloni
reloni / upgrade-postgres-9.6-to-10.md
Created July 2, 2018 16:23 — forked from mdesantis/upgrade-postgres-9.6-to-10.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04

TL;DR

Install Postgres 10, and then:

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main