214 lines
5.2 KiB
Makefile
214 lines
5.2 KiB
Makefile
BRNAME = $(shell hostname -s)
|
|
|
|
all:
|
|
echo do stuff
|
|
|
|
push:
|
|
git pull
|
|
git add --all
|
|
-git commit -a -s
|
|
git push
|
|
|
|
update:
|
|
git pull
|
|
|
|
fucking-delete-everything:
|
|
rm -rf [A-Za-z]*
|
|
git reset --hard
|
|
|
|
# suggested 'best practices' as of 2017 (maybe?)
|
|
sshkeygen:
|
|
ssh-keygen -t ed25519 -a 100
|
|
ssh-keygen -t rsa -b 4096 -o -a 100
|
|
|
|
nmap:
|
|
nmap -v -sP 192.168.0.0/24
|
|
# nmap -sS 192.168.0.123
|
|
# nmap -v 192.168.0.123
|
|
|
|
diff:
|
|
git diff
|
|
|
|
systemd-resolve:
|
|
systemd-resolve --status
|
|
SYSTEMD_LOG_LEVEL=debug systemd-resolve git.wit.com
|
|
systemd-resolve --statistics
|
|
|
|
resolv-ipv6:
|
|
mv /etc/resolv.conf /etc/resolv.conf.old
|
|
cp resolv-ipv6-only.conf /etc/resolv.conf
|
|
ls -al /etc/resolv.conf
|
|
cat /etc/resolv.conf
|
|
|
|
resolv-1:
|
|
mv /etc/resolv.conf /etc/resolv.conf.old
|
|
cp resolv-1-1-1-1.conf /etc/resolv.conf
|
|
|
|
resolv-8:
|
|
mv /etc/resolv.conf /etc/resolv.conf.old
|
|
cp resolv-8-8-8-8.conf /etc/resolv.conf
|
|
|
|
showyourip:
|
|
dig myip.opendns.com @resolver1.opendns.com
|
|
dig +short myip.opendns.com @resolver1.opendns.com
|
|
|
|
realuser:
|
|
@echo you are actually user:
|
|
stat -c'%U' `tty`
|
|
|
|
sysbench:
|
|
sysbench --test=cpu --num-threads=8 --cpu-max-prime=100000 run # for 8 cpus
|
|
|
|
fwupd:
|
|
apt install fwupdate fwupd
|
|
fwupdmgr get-devices
|
|
fwupdmgr refresh
|
|
fwupdmgr get-updates
|
|
|
|
flashrom:
|
|
apt install flashrom
|
|
flashrom -p internal:amd_imc_force=yes # for amd
|
|
flashrom -p internal:boardenable=force # for coreboot
|
|
flashrom -p internal:ich_spi_mode=auto # for intel
|
|
flashrom -p internal:ich_spi_mode=swseq # for intel
|
|
flashrom -p internal:ich_spi_mode=hwseq # for intel
|
|
|
|
i2c:
|
|
apt install i2c-tools
|
|
ls /dev/i2c-* -l
|
|
i2cdetect 0
|
|
|
|
dmidecode:
|
|
biosdecode
|
|
dmidecode
|
|
|
|
efi:
|
|
apt install efitools efivar
|
|
efivar -L
|
|
|
|
# FirmWare Test Suite
|
|
fwts:
|
|
# add-apt-repository ppa:firmware-testing-team/ppa-fwts-stable
|
|
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A1E2B0920C32E7C6
|
|
# apt update
|
|
apt install fwts
|
|
cd; fwts
|
|
|
|
xinput:
|
|
xinput list # shows you all the registered devices
|
|
xinput test 13 # dumps out values for an event
|
|
xev # the old school X tool
|
|
|
|
# DSTREAM installer on x86 needs this
|
|
dstream:
|
|
dpkg --add-architecture i386
|
|
apt update
|
|
apt install libwebkitgtk-3.0-0
|
|
apt-file update
|
|
apt-file -x search '/libz.so.1$'
|
|
# lib32z1: /usr/lib32/libz.so.1
|
|
# libzadc4: /usr/lib/x86_64-linux-gnu/genwqe/libz.so.1
|
|
# zlib1g: /lib/x86_64-linux-gnu/libz.so.1
|
|
apt install lib32z1
|
|
# apt-get install libstdc++6:i386 # syntax for specifying i386
|
|
|
|
vrf:
|
|
ip vrf show
|
|
ip vrf pids mgmt
|
|
|
|
# change to mgmt vrf
|
|
vrf-mgmt:
|
|
ip vrf exec mgmt /bin/bash
|
|
|
|
# turn off all laptop suspend and sleep
|
|
# This does even disable the buttons in the GNOME logout interface
|
|
# leaving only 'restart' and 'poweroff' buttons
|
|
# This is how all GUI interfaces should work
|
|
systemctl_power_disable:
|
|
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
|
|
|
|
systemctl_power_enable:
|
|
# turn back on all laptop suspend and sleep
|
|
systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
|
|
|
|
systemctl_power_show:
|
|
# show what systemctl is using for suspend, sleep, etc
|
|
systemctl show -p FragmentPath sleep.target
|
|
systemctl show -p FragmentPath suspend.target
|
|
systemctl show -p FragmentPath hibernate.target
|
|
systemctl show -p FragmentPath hybrid-sleep.target
|
|
|
|
rename_wlan0:
|
|
/sbin/ip link set wlan0 down
|
|
/sbin/ip link set wlan0 name wifi0
|
|
/sbin/ip link set wifi0 up
|
|
|
|
ss_display:
|
|
# Display all TCP sockets.
|
|
ss -t -a
|
|
|
|
# Display all TCP sockets with process SELinux security contexts.
|
|
ss -t -a -Z
|
|
|
|
# Display all UDP sockets.
|
|
ss -u -a
|
|
|
|
# Display all established ssh connections.
|
|
ss -o state established '( dport = :ssh or sport = :ssh )'
|
|
|
|
# command line utility for networking on Cumulus Linux switches
|
|
net:
|
|
net show interface
|
|
net show bgp
|
|
|
|
# llpd (Link Layer Discovery Protocol) show what is connected to you:
|
|
llpd:
|
|
lldpcli show neigh
|
|
|
|
# pixelbook has port 1080 as the default socks port. So does golang it seems.
|
|
# you have to use this so that 'go get' works:
|
|
# git config --global http.proxy socks5://127.0.0.1:1080 # to set the socks proxy
|
|
# git config --global --unset http.proxy # to unset the socks proxy
|
|
# or this works too:
|
|
# http_proxy=socks5://127.0.0.1:1080 go get git.wit.com/wit/ipv6-gui
|
|
|
|
golangbinsizes:
|
|
eval `go build -work -a 2>&1`
|
|
find $WORK -type f -name "*.a" | xargs -I{} du -hxs "{}" | sort -rh
|
|
|
|
git.wit.options:
|
|
git config --global --add url."git@git.wit.com:".insteadOf "https://git.wit.com/"
|
|
git config --global --list
|
|
go get git.wit.com/jcarr/ipv6-gui
|
|
|
|
git-fsck:
|
|
git fsck
|
|
git show <commit>
|
|
# this will destroy them forever. No going back:
|
|
git-prune
|
|
git gc
|
|
|
|
android:
|
|
adb devices # shows all the devices on your USB bus
|
|
adb shell # opens a bash shell
|
|
|
|
# https://wiki.archlinux.org/index.php/DSDT
|
|
# https://blog.fpmurphy.com/2014/12/decompiling-acpi-tables.html
|
|
# remember kvm has a --no-acpi option
|
|
acpi-decompile:
|
|
# root@librem15:/sys/firmware/acpi# find . |less
|
|
dmesg | grep DSDT
|
|
# root@librem15:/sys/firmware/acpi# dmesg | grep DSDT
|
|
# [ 0.000000] ACPI: DSDT 0x000000007AB6B280 00304C (v05 COREv4 COREBOOT 20110725 INTL 20161222)
|
|
cat /sys/firmware/acpi/tables/DSDT > dsdt.dat
|
|
# apt install iasl
|
|
iasl -d dsdt.dat # decompile
|
|
iasl -tc dsdt.dsl # recompile
|
|
less dsdt.dsl
|
|
|
|
ip-del-all-ipv6:
|
|
ip -6 route del ::/0
|
|
ip -6 route del fe80::/64
|
|
ip -6 route del ::1
|
|
ifconfig wifi0 del fe80::85f1:48b8:601c:6a3/64
|