Skip to content

Instantly share code, notes, and snippets.

View epcim's full-sized avatar

Petr Michalec epcim

View GitHub Profile
@epcim
epcim / kcd.service
Created August 24, 2021 14:50
systemd.service and timer example
[Unit]
Description=KCD cron job
After=vpm.service
After=kubelet.service
[Service]
User=root
Type=oneshot
SyslogIdentifier=kcd
EnvironmentFile=-/etc/environment
@epcim
epcim / 1-OSXCustomizations.md
Last active March 10, 2021 16:45
OSX dotfiles and customizations

Install

pkg manager brew

  • see lists below

OSX shell gnu/linux experience

  • keep your profile shell as "bash"
  • install GNU tools and put them on your PATH first
@epcim
epcim / vimdiff.md
Created December 28, 2020 08:07 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@epcim
epcim / .zshrc
Created December 6, 2020 11:28 — forked from dwchiang/.zshrc
gcloud with zsh
# The next line updates PATH for the Google Cloud SDK.
source /Users/dwchiang/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc
@epcim
epcim / imapsync.md
Created October 26, 2020 07:22
imap sync
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: eksctl-us-west-2-managed
region: us-west-2
vpc:
id: vpc-0b953326cd7a2f917
subnets:
@epcim
epcim / disable-ipv6.sh
Created July 1, 2020 07:09 — forked from kwilczynski/disable-ipv6.sh
Amazon Linux OS tweaks
#!/bin/bash
set -u
set -e
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf
@epcim
epcim / systemd_loging.sh
Last active August 30, 2022 16:16
bash snippet for systemd logging functions
#!/bin/bash
printf_stdin() { local stdin; read -d '' -u 0 stdin; printf "$@" "$stdin"; }
exec {log_fd}> >(systemd-cat -t $(basename $0))
log_emerg() { echo "EMERG: $1"|tee /dev/stderr| printf_stdin '<0>%s\n' "$1" >&"$log_fd"; }
log_alert() { echo "ALERT: $1"|tee /dev/stderr| printf_stdin '<1>%s\n' "$1" >&"$log_fd"; }
log_crit() { echo "CRIT: $1" |tee /dev/stderr| printf_stdin '<2>%s\n' "$1" >&"$log_fd"; }
log_err() { echo "ERROR: $1"|tee /dev/stderr| printf_stdin '<3>%s\n' "$1" >&"$log_fd"; }
log_warn() { echo "WARN: $1" |tee /dev/stderr| printf_stdin '<4>%s\n' "$1" >&"$log_fd"; }
@epcim
epcim / instructions.md
Created March 24, 2020 12:09 — forked from douglasmiranda/instructions.md
Add email to Keybase.io PGP Key (Public Key)

Export your public key:

keybase pgp export > keybase-public.key

Export your private key:

keybase pgp export --secret &gt; keybase-private.key