Skip to content

Instantly share code, notes, and snippets.

Avatar
😆
EAX,60

sjas

😆
EAX,60
  • 755517,642095,1140
  • EDESTADDRREQ
View GitHub Profile
@sjas
sjas / vimdiff.md
Created May 6, 2020 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet
View vimdiff.md

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)
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sjas
sjas / go-os-arch.md
Created Nov 16, 2019 — forked from asukakenji/go-os-arch.md
Go (Golang) GOOS and GOARCH
View go-os-arch.md

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
@sjas
sjas / Predictable Network InterfaceNames.md
Created Jun 5, 2019 — forked from bbak/Predictable Network InterfaceNames.md
Debian 9 / Stretch: Umstellung auf Predictable Network InterfaceNames
View Predictable Network InterfaceNames.md

Warnung an alle, die dieses Gist finden: Ich habe hier nur dokumentiert, was ich im Rahmen einer Umstellung herausgefunden habe. Es gibt Garantie auf Richtigkeit der Informationen, Zusammenhänge oder ob das unter allen Umständen wie hier beschrieben funktioniert.

Predictable Network InterfaceNames

Debian stellt auf ein anderes System von Namen für Netzwerkinterfaces um. In Debian 9 gehen noch die alten, manuell festgelegten - was der Standard ist, wenn man von Debian 8 aktualisiert.
Ab Debian 10 wird dieses System, welches mit udev und systemd zusammen hängt, zum Standard.

Mit zless /usr/share/doc/udev/README.Debian.gz kann man Debian-spezifische Informationen zu dem Thema finden.
Unter anderem auch, dass (und wie) man diesen Mechanismus in Debian 9 Stretch umgehen kann.

@sjas
sjas / parse_storcli.py
Created Apr 28, 2019 — forked from kamermans/parse_storcli.py
Script to parse storcli (replaced megacli) output for use in monitoring applications like Nagios, Zabbix, etc
View parse_storcli.py
#!/usr/bin/env python
#
# Parses the output of storcli:
# storcli /c0 show all J
import sys
import json
output_dir = "."
data = json.load(sys.stdin)
@sjas
sjas / gist:69350b1cd190af2c2a8019b0a5eee226
Last active Apr 8, 2019
`fws` alias for colored iptables output, designed to play well with firewalld
View gist:69350b1cd190af2c2a8019b0a5eee226
fws() {
for IPTABLES in iptables ip6tables
do
printf '\n\n\n\n\n'
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' '#'
echo "# ${IPTABLES}"
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' '#'
sudo "${IPTABLES}" -L -vnx --line-numbers | \
# table header
sed "/^num.*/ s//$(printf "\033[33m&\033[0m")/ " | \
View lxc device passthrough
10:15 <SoulRaven> i have this usb passthru
10:15 <SoulRaven> https://pastebin.com/8xrB1BTr
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/004/002 dev/bus/usb/004/002 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file10:15
10:16 <SoulRaven> for a serial to usb converor
10:16 <SoulRaven> but i can't get it working right
10:16 <SoulRaven> when i do on cat: can't open '/dev/ttyUSB0': Operation not permitted
View kubernetes bashrc
###################################################################################################################
# 0x00 - basics
###################################################################################################################
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
export PROMPT_COMMAND=echo
export PS0='\n'
export PS1='$( i=$?; if [ $i -eq 0 ]; then echo \\\[\e[32\;1m\\\]$i; else echo \\\[\e[31\;1m\\\]$i; fi )\[\e[0m\] \u@\h \[\e[33;1m\]\t\[\e[0m\] \w$(if git status 2>/dev/null | grep -q "nothing to commit"; then echo \\\[\e[32m\\\]; else if git status 2>/dev/null | grep -qi -e "^Changes not staged for commit" -e "^Untracked files:"; then echo \\\[\e[31m\\\]; else if git status 2>/dev/null | grep -q "to be committed"; then echo \\\[\e[36m\\\]; else echo \\\[\e[35\;1m\\\]; fi; fi; fi)$(__git_ps1)\[\e[0m\] \[\e[37;1m\]\$\[\e[m\]\[\e[36;1m\]$SHLVL \[\e[m\]\[\e[37;1m\]h\[\e[m\]\[\e[36;1m\]\! \[\e[m\]\[\e[37;1m\]c\[\e[m\]\[\e[36;1m\]\# \n\[\e[m\
View gist:bc31c3540509ac8d80a20b664a1d55c3
m() {
dpkg -s dialog &>/dev/null || { echo "Needs 'dialog' package which is not installed on this system!" && return; }
[[ $# -lt 1 ]] && echo 'Man page name consisting of a single word expected but not given.' && return
MANPAGE=$1
[[ -n $2 ]] && DEFAULTCHOICE=$2 || DEFAULTCHOICE='0'
man $MANPAGE > /dev/null 2>&1 || { echo $MANPAGE man page not present on this system!; return; }
mapfile -t OUTLINE < <(PAGER=cat man $MANPAGE | grep ^\\w | grep -v -e AUTHORS -e COPYRIGHT | sed '1d;$d')
RESULTSIZE=$(echo ${#OUTLINE[*]})
CHOICE=$(
dialog --keep-tite --default-item "$DEFAULTCHOICE" --menu "$(
You can’t perform that action at this time.