Cheatography
https://cheatography.com
Basic Commands + Software Everyone Uses
This is a draft cheat sheet. It is a work in progress and is not finished yet.
tMux
Action Key () |
Ctrl-B |
See Active Sessions |
tmux ls |
Attach Session |
tmux a (-t <session id>) |
Split View (H or V) |
+ % or " |
Paste |
+ ] |
Move to tmux |
Ctrl-Z, bg, jobs -l, disown XXX, tmux, reptyr -L XXX |
Close pane |
Ctrl-D |
name session |
+ $ |
Zoom |
+ z. |
Synchronize panel input |
+ a |
vi / neoVim
Goto line 5 |
5G or 5gg |
Delete line |
dd |
OpenSuse
install |
sudo zypper in <package> |
install other |
opi <package> |
software |
htop, tmux, neovim, solaar, vs code, lucmos/UltrawideWindows |
|
prox sys bbr for better downloads |
Window manager |
Ctrl-Win+numpad -> 25/50/25 |
Open Build Server
checkout |
osc co NAME:OF:DEV-TICKET |
build |
cd NAME:OF:DEV-TICKET/bonding/; osc build Debian_11 |
|
|
BondingAdmin
enter |
mdep nsenter ba |
set user |
su - bondingadmin |
set venv |
. /var/lib/bondingadmin/environment/bin/activate |
test |
cd /bi/bondingadmin/django/ && ./manage.py test --parallel=15 |
test with new DB |
./manage.py test --parallel 15 --recreate-db |
use local |
./manage.py runserver 0.0.0.0:8000 2> >(grep MIKEM) |
url local |
|
build |
./build.sh build -j17 && ./build.sh install && bondingadmin-setup ; systemctl restart bondingadmin |
Bonding
enter |
mdep nsenter bond1 |
test |
make test |
build |
make restart |
add-interface |
mdep add-bridge-interface bond1 br0 leg2 |
repo |
|
QA
build (/bi/estrada) |
qa build-image app:bonding:opensuse:tumbleweed |
mdep
create agg |
mdep create agg2 image=dist:debian:bullseye; mdep start agg2; mdep nsenter agg2; go to web ba, spaces -> node setup |
resize image |
mdep resize agg2 8G |
|
|
git
git commit -m "First release of Hello World!" |
git cherry -v destination_branch source_branch |
git cherry-pick commit_id |
git log --name-status HEAD^..HEAD |
exec ssh-agent bash && ssh-add |
Command Line Tidbits
find text in files |
grep -r text_to_find * |
firefox detatch tab |
ctrl-L, Win-Shift-Enter |
journalctl - time |
journalctl --since "1 hour ago" |
journalctl - unit |
journalctl -u nginx.service |
journalctl - other |
-r (reverse) -n (number) -f (follow) |
Network Analysis
Packets Per Second |
bwm-ng --unit packets |
Show TCP Pkts |
tcpdump -ni host0 port 2001 |
list routing rules |
ip rule list |
list table from routing rule |
ip route show table XXX |
modify NFT rules |
nft list ruleset > rules.nft; edit rules.nft (add flush ruleset; as first line, add counters); import: nft -f rules.nft |
list all routing IPT |
iptables -t nat -L -n -v |
list all routing NFT |
nft list ruleset |
add routing NFT |
nft insert rule inet filter input ip6 saddr $IP_ADDR drop |
list routing NFT |
nft -a list chain inet filter input |
del routing NFT |
nft delete rule inet filter input handle 59 |
host webserver |
/bi/estrada/qa/bin/test-webserver 8080 |
fetch webserver |
curl 172.30.0.1:8080/uncompressible?size=120000000 -o /dev/null |
ping flood |
sudo ping -f 172.30.0.0 |
renew ip address |
dhclient (or dhclient -R) |
nft tracing |
add trace to rule meta mark eq 0xf0 meta nftrace set 1; then watch in console nft monitor trace |
|