Skip to content

Instantly share code, notes, and snippets.

View sjas's full-sized avatar
😆
EAX,60

sjas

😆
EAX,60
  • 755517,642095,1140
  • EDESTADDRREQ
View GitHub Profile
@sjas
sjas / install_tools.sh
Created January 28, 2023 20:52 — forked from allenyllee/install_tools.sh
mount vhdx in linux
#!/bin/bash
# install qemu utils
sudo apt install qemu-utils
# install nbd client
sudo apt install nbd-client
@sjas
sjas / myweechat.md
Created June 27, 2021 11:46 — forked from danguita/myweechat.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

Enable mouse support

/mouse enable

Encrypted password in sec.conf

@sjas
sjas / ascii_movie_image_ver_1.py
Created June 6, 2021 11:45 — forked from MotionDesignStudio/ascii_movie_image_ver_1.py
Python ASCII Video And ASCII Image Creator
#!/usr/bin/env python
import sys
import cv2
import subprocess
from subprocess import call
import aalib
import Image
@sjas
sjas / add-music.rsc
Created February 19, 2021 16:32 — forked from ThinGuy/add-music.rsc
add music to mikrotik switches
/system script
add name="Music: Super Mario Bros" owner=admin policy=read source=":beep frequency=660 length=100ms;\
\n:delay 150ms;\
\n:beep frequency=660 length=100ms;\
\n:delay 300ms;\
\n:beep frequency=660 length=100ms;\
\n:delay 300ms;\
\n:beep frequency=510 length=100ms;\
\n:delay 100ms;\
\n:beep frequency=660 length=100ms;\
@sjas
sjas / vimdiff.md
Created May 6, 2020 10:22 — 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)

@sjas
sjas / tmux-cheatsheet.markdown
Created April 3, 2020 13:59 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

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

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 June 5, 2019 15:31 — forked from bbak/Predictable Network InterfaceNames.md
Debian 9 / Stretch: Umstellung auf Predictable Network InterfaceNames

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 April 28, 2019 12:07 — forked from kamermans/parse_storcli.py
Script to parse storcli (replaced megacli) output for use in monitoring applications like Nagios, Zabbix, etc
#!/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 April 8, 2019 10:14
`fws` alias for colored iptables output, designed to play well with firewalld
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")/ " | \