Skip to content

Instantly share code, notes, and snippets.

View jan-warchol's full-sized avatar

Jan Warchoł jan-warchol

View GitHub Profile
@jan-warchol
jan-warchol / 0-learn-gpg-by-doing-README.md
Last active October 20, 2020 11:29
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
jan-warchol / ansible-systemd-test.yml
Last active March 14, 2020 09:38
Learning systemd and how to manage it with ansible
# Use with Vagrantfile liks this:
#
# # -*- mode: ruby -*-
# # vi: set ft=ruby :
#
# Vagrant.configure("2") do |config|
# config.vm.box = "ubuntu/xenial64"
# config.vm.provision "ansible" do |ans|
# ans.playbook = "ansible-systemd-test.yml"
# end
@jan-warchol
jan-warchol / README.md
Last active February 8, 2019 22:03
Przepis na czekoladowiec

Autor przepisu: Kacper Peek

Składniki

  • 2 gorzkie czekolady (60-70%)
  • kostka masła (200 g)
  • 6 jajek
  • 200 g cukru
  • kakao
  • ziemniaki powracają
@jan-warchol
jan-warchol / .bashrc
Created March 21, 2018 10:02
Miscellaneous bash history settings
# enable keeping history timestamps and set display format to ISO-8601
export HISTTIMEFORMAT="%F %T "
# ignore duplicates and commands starting with space
HISTCONTROL=ignoreboth
# 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
@jan-warchol
jan-warchol / sync-history.sh
Last active February 4, 2024 04:52
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
jan-warchol / functions.sh
Last active June 26, 2017 09:04 — forked from junegunn/functions.sh
Key bindings for git with fzf (https://junegunn.kr/2016/07/fzf-git/)
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% "$@" --border
}
@jan-warchol
jan-warchol / writing-good-commit-messages.md
Last active May 15, 2017 07:51
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
jan-warchol / description.md
Created June 17, 2016 18:35
Ansible hostvars evaluation problem
Setup
-----
Vagrantfile
```
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
(1..2).each do |i|
@jan-warchol
jan-warchol / gist:f7e556267fede72ab41e
Last active November 29, 2015 16:11 — forked from mbadran/gist:130469
replace cd in bash to (silent) pushd
# "cd with history"
#
# Bash has a nice feature called "directory stack" - sort of "location history":
# https://www.gnu.org/software/bash/manual/html_node/The-Directory-Stack.html
# 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