Skip to content

Instantly share code, notes, and snippets.

View mrjk's full-sized avatar

mrjk

  • Montréal
View GitHub Profile
@mrjk
mrjk / pgprepmgr.sh
Last active October 16, 2015 21:12 — forked from dansimau/pgprepmgr.sh
Wrapper for pgpools' pcp tools to help you manage your pgpool setup and postgresql cluster. See usage in the comment below.
#!/bin/bash
#
# pgpool-II replication manager
#
# Interfaces with pgpool's pcp command-line tools to provide access to common functions for managing
# load-balancing and failover.
#
# mrjk.78 at the famous google mail
# 2014-10-13
# dsimmons@squiz.co.uk
@mrjk
mrjk / keybase.md
Created May 24, 2017 04:06
Keybase proof

Keybase proof

I hereby claim:

  • I am mrjk on github.
  • I am mrjk (https://keybase.io/mrjk) on keybase.
  • I have a public key whose fingerprint is 6684 1AF5 79E5 D08F FE31 0636 AE08 F1AE E051 5AEC

To claim this, I am signing this object:

@mrjk
mrjk / streamit.rb
Created November 23, 2020 04:34 — forked from trisweb/streamit.rb
Script to run an esound stream from soundflower to a pulseaudio server
#!/usr/bin/env ruby
# Requirements:
# - A PulseAudio server running at the host in TO below.
# - SoundFlower installed
# - ESound installed (on mac, brew install esound)
# Select SoundFlower (2ch) as both Input AND Output devices, then run "streamit start"
# otherwise you don't have to worry about anything; it's a daemon, will run in the background,
# once you're finished just kill esd or run "streamit stop"
@mrjk
mrjk / libvirt-hook-wrapper.sh
Created May 13, 2021 21:36
A generic shell hook handler for libvirt
#!/bin/bash
#
# Libvirt Hook Wrapper
# =========================
# Little tool to manage libivrt hooks in an easy way.
#
# Documentation:
# ---------------
# - https://libvirt.org/hooks.html
#
@mrjk
mrjk / disks_infos.sh
Created July 11, 2021 19:15
A little script to get disks informations
#!/bin/bash
# Tooling: Debian
# apt install smartmontools sysstat hdparm
# Sata infos
# SATA revision 1.0 => 1.5 Gbit/s, 150 MB/s
# SATA revision 2.0 => 3 Gbit/s, 300 MB/s
# SATA revision 3.0 => 6 Gbit/s, 600 MB/s
# SATA revision 3.2 => 16 Gbit/s, 1969 MB/s
@mrjk
mrjk / run_iodine_client.sh
Created September 16, 2021 12:01
Iodine Scripts
#!/bin/bash
# Author: https://gist.github.com/mrjk/
# License: MIT
IODINE_PASS=mypass
IODINE_DOMAIN=t.mydomain.org
IODINE_GW=10.18.0.1
IODINE_FORWARD=true
IODINE_SERVER=w.x.y.z
@mrjk
mrjk / .bashrc
Last active September 7, 2022 04:31
minimal bashrc
# Base stuffs
alias la='ls -ah'
alias ll='ls -lh'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias ~='cd ~'
@mrjk
mrjk / gist:7098e4b882025e777407e2ea8a3b7676
Created November 11, 2022 22:42
poetry-bug-report-broken-pipe
[tool.poetry]
name = "python-project-poetry-template"
version = "0.1.0"
description = "Python Project Poetry Template"
authors = ["mrjk"]
license = "GPLv3"
packages = [
{ include = "myprj"}
]
@mrjk
mrjk / merge_dirs
Created December 14, 2022 09:27
Merge two directory and does not overwrite things.
#!/bin/bash
# To install in in: /usr/local/bin/merge_dirs
# Then: chmod +x /usr/local/bin/merge_dirs
set -eu
# Source: https://unix.stackexchange.com/a/155633
# Usage: like mv but: SRC DEST
@mrjk
mrjk / README.md
Created January 19, 2023 05:09
How to tcpdump a docker container interface from host?

How to find which container map on the host

$ docker exec -ti $container cut -d: -f1 /proc/net/dev
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo
  eth0
  eth1
 eth2