Skip to content

Instantly share code, notes, and snippets.


Jan Warchoł jan-warchol

View GitHub Profile
jan-warchol /
Last active Aug 7, 2020
Synchronize history across bash sessions
# Synchronize history between bash sessions
# Make history from other terminals available to the current one. However,
# don't mix all histories together - make sure that *all* commands from the
# current session are on top of its history, so that pressing up arrow will
# give you most recent command from this session, not from any session.
# Since history is saved on each prompt, this additionally protects it from
# terminal crashes.
jan-warchol /
Last active May 22, 2020
GPG tutorial demonstrating typical workflow in practice

Learn GPG by doing

This tutorial will walk you through typical GPG workflow: generating, signing, trusting, renewing and backing up keys. Instead of long explanations it just shows what happens in practice on test data.

Important: older GPG versions behave significantly different and use different formats for storing data. This tutorial was tested with GPG 2.2.4; you can check your version using gpg --version.

jan-warchol / ansible-systemd-test.yml
Last active Mar 14, 2020
Learning systemd and how to manage it with ansible
View ansible-systemd-test.yml
# Use with Vagrantfile liks this:
# # -*- mode: ruby -*-
# # vi: set ft=ruby :
# Vagrant.configure("2") do |config|
# = "ubuntu/xenial64"
# config.vm.provision "ansible" do |ans|
# ans.playbook = "ansible-systemd-test.yml"
# end
jan-warchol /
Last active Feb 8, 2019
Przepis na czekoladowiec

Autor przepisu: Kacper Peek


  • 2 gorzkie czekolady (60-70%)
  • kostka masła (200 g)
  • 6 jajek
  • 200 g cukru
  • kakao
  • ziemniaki powracają
jan-warchol / .bashrc
Created Mar 21, 2018
Miscellaneous bash history settings
View .bashrc
# enable keeping history timestamps and set display format to ISO-8601
# ignore duplicates and commands starting with space
# ignore specific commands (full-length match)
HISTIGNORE=”?:cd:ls:ll:bg:fg:vim:git status”
# disable terminal flow control key binding, so that ^S will search history forward
stty -ixon
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
fzf-down() {
fzf --height 50% "$@" --border
jan-warchol /
Last active May 15, 2017
Yet Another set of rules for writing good commit messages

Important rules

  • explain why
  • explain why
  • explain why
  • help with code review

Important formatting rules

  • start with summary line (max 70 characters)
  • add more description after empty line
jan-warchol /
Created Jun 17, 2016
Ansible hostvars evaluation problem
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
(1..2).each do |i|
jan-warchol / gist:f7e556267fede72ab41e
Last active Nov 29, 2015 — forked from mbadran/gist:130469
replace cd in bash to (silent) pushd
View gist:f7e556267fede72ab41e
# "cd with history"
# Bash has a nice feature called "directory stack" - sort of "location history":
# However, I find the built-in commands not really convenient. This makes the
# directory stack available as a sort of extension to `cd` interface.
function _cd {
# typing just `_cd` will take you $HOME ;)
if [ "$1" == "" ]; then
You can’t perform that action at this time.