misc pinebook stuff
This commit is contained in:
parent
67db16d029
commit
02581ac3ce
|
@ -0,0 +1,213 @@
|
||||||
|
BRNAME = $(shell hostname -s)
|
||||||
|
|
||||||
|
all:
|
||||||
|
echo do stuff
|
||||||
|
|
||||||
|
push:
|
||||||
|
git pull
|
||||||
|
git add --all
|
||||||
|
-git commit -a
|
||||||
|
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
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Recompile with:
|
||||||
|
all:
|
||||||
|
mkimage -C none -A arm -T script -d sid.cmd /boot/sid.scr
|
||||||
|
# mkimage -C none -A arm -T script -d /boot/jcarr.cmd /boot/jcarr.scr
|
|
@ -0,0 +1,73 @@
|
||||||
|
# DO NOT EDIT THIS FILE
|
||||||
|
#
|
||||||
|
# Please edit /boot/armbianEnv.txt to set supported parameters
|
||||||
|
#
|
||||||
|
|
||||||
|
# default values
|
||||||
|
setenv load_addr "0x44000000"
|
||||||
|
setenv rootdev "/dev/mmcblk0p1"
|
||||||
|
setenv verbosity "1"
|
||||||
|
setenv rootfstype "ext4"
|
||||||
|
setenv console "both"
|
||||||
|
setenv docker_optimizations "on"
|
||||||
|
|
||||||
|
# Print boot source
|
||||||
|
itest.b *0x10028 == 0x00 && echo "U-boot loaded from SD"
|
||||||
|
itest.b *0x10028 == 0x02 && echo "U-boot loaded from eMMC or secondary SD"
|
||||||
|
itest.b *0x10028 == 0x03 && echo "U-boot loaded from SPI"
|
||||||
|
|
||||||
|
echo "Boot script loaded from ${devtype}"
|
||||||
|
|
||||||
|
if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then
|
||||||
|
load ${devtype} ${devnum} ${load_addr} ${prefix}armbianEnv.txt
|
||||||
|
env import -t ${load_addr} ${filesize}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,115200 console=tty1 single"; fi
|
||||||
|
if test "${console}" = "serial"; then setenv consoleargs "console=ttyS0,115200 single"; fi
|
||||||
|
|
||||||
|
# get PARTUUID of first partition on SD/eMMC it was loaded from
|
||||||
|
# mmc 0 is always mapped to device u-boot (2016.09+) was loaded from
|
||||||
|
if test "${devtype}" = "mmc"; then part uuid mmc 0:1 partuuid; fi
|
||||||
|
|
||||||
|
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"
|
||||||
|
|
||||||
|
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi
|
||||||
|
|
||||||
|
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
|
||||||
|
fdt addr ${fdt_addr_r}
|
||||||
|
fdt resize 65536
|
||||||
|
for overlay_file in ${overlays}; do
|
||||||
|
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/allwinner/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
|
||||||
|
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
|
||||||
|
fdt apply ${load_addr} || setenv overlay_error "true"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
for overlay_file in ${user_overlays}; do
|
||||||
|
if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
|
||||||
|
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
|
||||||
|
fdt apply ${load_addr} || setenv overlay_error "true"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if test "${overlay_error}" = "true"; then
|
||||||
|
echo "Error applying DT overlays, restoring original DT"
|
||||||
|
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
|
||||||
|
else
|
||||||
|
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/allwinner/overlay/${overlay_prefix}-fixup.scr; then
|
||||||
|
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
|
||||||
|
source ${load_addr}
|
||||||
|
fi
|
||||||
|
if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
|
||||||
|
load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr
|
||||||
|
echo "Applying user provided fixup script (fixup.scr)"
|
||||||
|
source ${load_addr}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
|
||||||
|
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image
|
||||||
|
|
||||||
|
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
|
||||||
|
|
||||||
|
# Recompile with:
|
||||||
|
# mkimage -C none -A arm -T script -d /boot/jcarr.cmd /boot/jcarr.scr
|
Binary file not shown.
|
@ -0,0 +1,76 @@
|
||||||
|
# Recompile with:
|
||||||
|
# mkimage -C none -A arm -T script -d /boot/sid.cmd /boot/sid.scr
|
||||||
|
|
||||||
|
# default values
|
||||||
|
setenv load_addr "0x44000000"
|
||||||
|
setenv rootdev "/dev/mmcblk2p1"
|
||||||
|
setenv verbosity "1"
|
||||||
|
setenv rootfstype "ext4"
|
||||||
|
setenv console "both"
|
||||||
|
setenv docker_optimizations "on"
|
||||||
|
|
||||||
|
# Print boot source
|
||||||
|
itest.b *0x10028 == 0x00 && echo "U-boot loaded from SD"
|
||||||
|
itest.b *0x10028 == 0x02 && echo "U-boot loaded from eMMC or secondary SD"
|
||||||
|
itest.b *0x10028 == 0x03 && echo "U-boot loaded from SPI"
|
||||||
|
|
||||||
|
echo "Boot script loaded from ${devtype}"
|
||||||
|
|
||||||
|
if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then
|
||||||
|
load ${devtype} ${devnum} ${load_addr} ${prefix}armbianEnv.txt
|
||||||
|
env import -t ${load_addr} ${filesize}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,115200 console=tty1"; fi
|
||||||
|
if test "${console}" = "serial"; then setenv consoleargs "console=ttyS0,115200"; fi
|
||||||
|
|
||||||
|
# get PARTUUID of first partition on SD/eMMC it was loaded from
|
||||||
|
# mmc 0 is always mapped to device u-boot (2016.09+) was loaded from
|
||||||
|
if test "${devtype}" = "mmc"; then part uuid mmc 0:1 partuuid; fi
|
||||||
|
|
||||||
|
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs} init=3"
|
||||||
|
|
||||||
|
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1 init=3"; fi
|
||||||
|
|
||||||
|
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
|
||||||
|
fdt addr ${fdt_addr_r}
|
||||||
|
fdt resize 65536
|
||||||
|
for overlay_file in ${overlays}; do
|
||||||
|
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/allwinner/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
|
||||||
|
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
|
||||||
|
fdt apply ${load_addr} || setenv overlay_error "true"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
for overlay_file in ${user_overlays}; do
|
||||||
|
if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
|
||||||
|
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
|
||||||
|
fdt apply ${load_addr} || setenv overlay_error "true"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if test "${overlay_error}" = "true"; then
|
||||||
|
echo "Error applying DT overlays, restoring original DT"
|
||||||
|
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
|
||||||
|
else
|
||||||
|
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/allwinner/overlay/${overlay_prefix}-fixup.scr; then
|
||||||
|
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
|
||||||
|
source ${load_addr}
|
||||||
|
fi
|
||||||
|
if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
|
||||||
|
load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr
|
||||||
|
echo "Applying user provided fixup script (fixup.scr)"
|
||||||
|
source ${load_addr}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
|
||||||
|
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
echo booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
echo Load the initial ramdisk
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
sleep 1
|
||||||
|
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
|
|
@ -0,0 +1,24 @@
|
||||||
|
# wpa_supplicant -B -i wlan0 -c wpa-supplicant.conf -D wext
|
||||||
|
|
||||||
|
killall:
|
||||||
|
-killall -9 wpa_supplicant
|
||||||
|
-killall -9 /sbin/wpa_supplicant
|
||||||
|
sleep 2
|
||||||
|
ifconfig wlan0 down
|
||||||
|
|
||||||
|
mac:
|
||||||
|
ifconfig wlan0 hw ether 02:ba:c0:5c:7b:53
|
||||||
|
nmcli con modify "WIT.COM Public" wifi.cloned-mac-address 02:ba:c0:5c:7b:53
|
||||||
|
|
||||||
|
debugging:
|
||||||
|
wpa_supplicant -d -i wlan0 -c wpa-supplicant.conf
|
||||||
|
|
||||||
|
background:
|
||||||
|
wpa_supplicant -B -d -i wlan0 -c wpa-supplicant.conf
|
||||||
|
|
||||||
|
dhclient:
|
||||||
|
dhclient wlan0
|
||||||
|
# ifconfig wlan0 192.168.151.100/24
|
||||||
|
# route add default gw 192.168.151.1
|
||||||
|
ifconfig
|
||||||
|
ping -c 10 1.1.1.1
|
|
@ -0,0 +1,4 @@
|
||||||
|
network={
|
||||||
|
ssid="WIT.COM Public"
|
||||||
|
psk="aaaabbbb"
|
||||||
|
}
|
Loading…
Reference in New Issue