Skip to content

Instantly share code, notes, and snippets.

View jtyr's full-sized avatar
🐧

Jiri Tyr jtyr

🐧
View GitHub Profile
@jtyr
jtyr / jtyr.zsh-theme
Last active March 20, 2016 02:30
jtyr's theme for oh-my-zsh
# jtyr's theme for oh-my-zsh
# Color shortcuts
RED=$fg_bold[red]
GREEN=$fg_bold[green]
YELLOW=$fg_bold[yellow]
BLUE=$fg_bold[blue]
CYAN=$fg_bold[cyan]
RESET=$reset_color
@jtyr
jtyr / Makefile
Last active April 27, 2016 11:30
Bundle and unbundle local Git repos
###
#
# This Makefile helps to bundle and unbundle local Git repos. Directories
# containing bare repos should end with `.git` (e.g. `mybarerepo.git`).
#
###
DIRS = $(shell find . -type d -maxdepth 1)
BUNDLES = $(filter-out $(wildcard *.git.bundle), $(wildcard *.bundle))
BUNDLES_BARE = $(wildcard *.git.bundle)
@jtyr
jtyr / sshpass_issue.txt
Created September 22, 2016 13:35
Set of steps which help to reproduce the issue when connection with sshpass through a proxy
# Create SSH keys to be able to use localhost as the proxy
ssh-keygen
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_key
chmod 700 ~/.ssh
# Create the SSH config
cat >~/.ssh/config <<END
Host *
# !!!Make sure this directory exists!!!
@jtyr
jtyr / Gitwebmarkdown
Last active January 3, 2017 15:49 — forked from nemoo/Gitwebmarkdown
Tampermonkey script for chrome to display README.md files rendered as html from markdown in gitweb
// ==UserScript==
// @name Gitwebmarkdown
// @version 0.2
// @description Renders readme files in markdown.
// @include http://yourserverhere.com/git/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @require https://cdn.rawgit.com/showdownjs/showdown/1.3.0/dist/showdown.min.js
// ==/UserScript==
var converter = new showdown.Converter();
@jtyr
jtyr / Vagrantfile
Last active January 4, 2017 17:19
Vagrantfile with external configuration
Move to https://github.com/jtyr/vagrantfile_config
@jtyr
jtyr / rpm_deps_tree.sh
Created May 5, 2017 09:29
Bash function which helps to print out the RPM dependency tree for a specific package.
function walk() {
if [ $1 == 0 ]; then
echo -n "" > /tmp/deps;
fi
echo $2 >> /tmp/deps;
for N in $(seq $1); do
echo -n ' ';
done
echo -n '- ';
echo $2;
@jtyr
jtyr / json2ini.py
Last active January 22, 2019 11:04
Scripts that converts the output of an Ansible dynamic inventory script into a static INI inventory.
#!/bin/env python
import json
import sys
'''
Description
-----------
@jtyr
jtyr / hostsfile.py
Last active April 25, 2019 10:35
Ansible dynamic inventory script that reads any Ansible hosts file and transforms it into the JSON data structure.
This was moved to https://github.com/jtyr/ansible-ini_inventory
@jtyr
jtyr / play-with-k8s.com-jtyr-setup.sh
Last active June 2, 2019 22:43
Shell script used to bootstrap Kubernetes on the play-with-k8s.com service
###
# Shell script used to bootstrap Kubernetes on the play-with-k8s.com service
###
#
# Inspired by https://gist.github.com/jjo/78f60702fbfa1cbec7dd865f67a3728a
#
# Usage:
# source <(curl -sL bit.do/jtyr-pwk-setup)
#
# Edit:
@jtyr
jtyr / resolv_conf.sh
Last active October 3, 2019 13:56
Script which helps to configure resolv.conf based on information pushed by the OpenVPN server.
#!/bin/bash
###
#
# Description
# -----------
#
# Script which helps to configure resolv.conf based on information pushed by
# the OpenVPN server.
#