Skip to content

Instantly share code, notes, and snippets.

@HalisCz
HalisCz / gh_repos.sh
Created April 6, 2023 13:50
Bash script to get list of all repos from GitHub organization and clone them in parallel. Requires bash, >=git-2.26, jq, parallel, find, sed. Also contains commented line for host substitution, in case you are using different hostname to utilize settings from .ssh/config
#!/bin/bash
# Modified version of https://gist.github.com/caniszczyk/3856584#gistcomment-3157288
# Source https://gist.github.com/caniszczyk/3856584?permalink_comment_id=3335247#gistcomment-3335247
# Sample syntax:
# foobar\.git
# foobar\.git|helloworld\.git
# Bash strict mode
@HalisCz
HalisCz / Vagrantfile
Last active September 19, 2022 08:01
# -*- mode: ruby -*- vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "ubuntu" do |ubuntu|
ubuntu.vm.hostname = "ubuntu"
ubuntu.vm.box = "ubuntu/kinetic64"
ubuntu.vm.network "private_network",
ip: "192.168.56.14"
ubuntu.vm.synced_folder "./data-ubuntu", "/vagrant_data", create: true
ubuntu.vm.provision "shell", inline: <<-SHELL
apt-get update
@HalisCz
HalisCz / VrcholyPohoriCR
Last active May 1, 2021 12:22
Seznam nejvyšších vrcholů pohoří v ČR pro import do Mapotic.com. Původní seznam převzat z https://www.michalblaha.cz/2015/04/101-vyletu-v-jednom/
Kategorie,Oblast,Jméno,Nadmorska vyska,Zeměpisná délka,Zeměpisná šířka,GoogleMaps Link,Mapy.cz link
Vrcholy,Středočeská pahorkatina,Benešovská pahorkatina - Stráž (638 m),638,49.52800360,13.84773810,https://www.google.com/maps/place/49.5280036.13.8477381,http://www.mapy.cz/turisticka?x=13.8477381&y=49.5280036&z=17&source=coor&id=13.8477381%2C49.5280036
Vrcholy,Slovensko-moravské Karpaty,Bílé Karpaty - Velká Javořina (970 m),881,50.65777800,15.98833300,https://www.google.com/maps/place/50.657778.15.988333,http://www.mapy.cz/turisticka?x=15.988333&y=50.657778&z=17&source=coor&id=15.988333%2C50.657778
Vrcholy,Středočeská pahorkatina,Blatenská pahorkatina - Drkolná (729 m),970,48.85781500,17.67565300,https://www.google.com/maps/place/48.857815.17.675653,http://www.mapy.cz/turisticka?x=17.675653&y=48.857815&z=17&source=coor&id=17.675653%2C48.857815
Vrcholy,Brněnská vrchovina,Bobravská vrchovina - Kopeček (479 m),729,49.33863280,13.39353030,https://www.google.com/maps/place/49.3386328.13.3935303,http://www.mapy.cz/
2020-05-09 20:13:42 - [sway/main.c:153] Linux xps 5.6.11-300.fc32.x86_64 #1 SMP Wed May 6 19:12:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
2020-05-09 20:13:42 - [sway/main.c:169] Contents of /etc/os-release:
2020-05-09 20:13:42 - [sway/main.c:153] NAME=Fedora
2020-05-09 20:13:42 - [sway/main.c:153] VERSION="32 (Thirty Two)"
2020-05-09 20:13:42 - [sway/main.c:153] ID=fedora
2020-05-09 20:13:42 - [sway/main.c:153] VERSION_ID=32
2020-05-09 20:13:42 - [sway/main.c:153] VERSION_CODENAME=""
2020-05-09 20:13:42 - [sway/main.c:153] PLATFORM_ID="platform:f32"
2020-05-09 20:13:42 - [sway/main.c:153] PRETTY_NAME="Fedora 32 (Thirty Two)"
2020-05-09 20:13:42 - [sway/main.c:153] ANSI_COLOR="0;34"
@HalisCz
HalisCz / lint-shell.yml
Last active April 11, 2019 14:44
lint-shell
variables:
SHELLCHECK_SEVERITY: style
lint-shell:
tags: [kubernetes]
stage: prepare
image: koalaman/shellcheck-alpine
script:
# check with hard fail and customizable severity level
- find ./ -name '*.sh' -exec shellcheck --check-sourced --color=always --severity=${SHELLCHECK_SEVERITY} {} +
# Home preparation
Because Ansible is unsupported to run from Windows boxes, and for the sake of unified environment during this workshop, we are going to use Vagrant and VirtualBox to create our testing environment. With Linux, MacOS or Windows, we will have the same environment.
## Tasks:
- get vagrant and virtualbox installed on your computer
- [Vagrant](https://www.vagrantup.com/)
- [VirtualBox](https://www.virtualbox.org/)
- download your vagrant boxes in advance by running:
```
@HalisCz
HalisCz / how to sign keys after pgp signing
Last active October 8, 2018 08:20
what to do after pgp signing party
# create work dir
mkdir pgp-signing; cd pgp-signing
# fetch public keys from keyservers and export into .asc files
for mail in list
do
gpg2 --no-default-keyring --keyring=~/linuxdays.keyring --search-keys $mail
done
# run the PIUS signing script to sign keyring with key 0x12345 (https://www.phildev.net/pius/)
pius \
-H smtp.googlemail.com \
@HalisCz
HalisCz / ansible-vpsfree-kvm-alpine
Created January 2, 2018 15:54
Ansible playbook pro přípravu KVM hypervizoru ve vpsFree.cz na OS Alpine Linux
---
- name: Instalace KVM na Alpine Linuxu #podle https://kb.vpsfree.cz/navody/vps/kvm#instalace_balicku_a_konfigurace_hypervizoru
block:
- name: install packages
apk: name={{ item }} state=latest
update_cache: yes
with_items:
- qemu-system-x86_64
- qemu-openrc
- qemu-img
@HalisCz
HalisCz / ssh-copy-id-exchange
Created June 29, 2017 11:37
Shell function to ssh into server and authenticate with old ssh key, and then add new ssh key into authorized_keys
ssh-copy-id-exchange() {
OLDKEY="/home/halis/.ssh/id_rsa-old"
OLDKEY_PUB="/home/halis/.ssh/id_rsa-old.pub"
NEWKEY="/home/halis/.ssh/id_rsa"
NEWKEY_PUB="/home/halis/.ssh/id_rsa.pub"
echo "Trying login with new key"
ssh -i $NEWKEY -o "PreferredAuthentications=publickey" $1 "true"
#exit if it successed
if [ $? -eq "0" ]; then

Keybase proof

I hereby claim:

  • I am HalisCz on github.
  • I am haliscz (https://keybase.io/haliscz) on keybase.
  • I have a public key whose fingerprint is EF32 9B72 EFBB DB46 96A3 CC44 6D7D 57DE D18B B5BA

To claim this, I am signing this object: