commands from my meetup session Jan 2021
uptime #load avg
dmesg -T | tail #kernel msgs
vmstat -Sm 1 #mem in MB
vmstat -Sm 1 -d 1 #disk in MB
mpstat -P ALL 1 #cpus
pidstat -t 1 #procs with threads
iostat -xy 1 #disk queue length, etc
| ``` | |
| sleep() { | |
| if [[ $@ == "infinity" ]]; then | |
| while true | |
| do | |
| /bin/sleep 1 | |
| done | |
| else | |
| /bin/sleep "$@" | |
| fi |
| ``` | |
| // Create a large heap allocation of 10 GiB | |
| // to prevent garbage collection gets | |
| // triggered before the amount of heap | |
| // allocation is reached | |
| ballast := make([]byte, 10<<30) | |
| ``` |
| ``` | |
| pushd $HOME/.ssh | |
| cp -p id_rsa id_rsa.pem | |
| ssh-keygen -p -N "" -m pem -f id_rsa.pem #replaces file | |
| popd | |
| ``` |
commands from my meetup session Jan 2021
uptime #load avg
dmesg -T | tail #kernel msgs
vmstat -Sm 1 #mem in MB
vmstat -Sm 1 -d 1 #disk in MB
mpstat -P ALL 1 #cpus
pidstat -t 1 #procs with threads
iostat -xy 1 #disk queue length, etc
| FROM archlinux | |
| RUN pacman -Sy --noconfirm git go base-devel docker | |
| # makepkg needs to run under an unprived user and sudo out | |
| RUN useradd -m -G wheel -s /bin/sh worker | |
| RUN echo "ALL ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/tempbuild | |
| USER worker | |
| RUN cd $HOME && git clone https://aur.archlinux.org/docker-pushrm.git | |
| RUN cd $HOME/docker-pushrm && makepkg -si --noconfirm | |
| USER root | |
| RUN rm /etc/sudoers.d/tempbuild |
chrome://flags/#enable-reader-mode
| codesign --remove-signature "/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app" |
These are curl examples for confirming the captive portal login page of some public WIFI Hotspots.
SSID: Telekom
alias telekom='onlinestatus=; onlinestatus=$(curl --silent --data-binary "{\"rememberMe\":false}" "https://hotspot.t-mobile.net/wlan/rest/freeLogin" | jq -r ".user.wlanLoginStatus"); if [ "$onlinestatus" != "online" ]; then echo error; else echo online; fi; onlinestatus='
| function octokey () { | |
| if [ "${1}" == "" ]; then echo -e "Get a github user's ssh key(s). \nUsage: octokey github_username [all | key_index]" && return 1; fi | |
| case "${2}" in | |
| "") | |
| local key_index=0 | |
| ;; | |
| a) | |
| local key_index='' #jq wildcard | |
| ;; | |
| all) |
| #!/bin/bash | |
| docker-credential-desktop list | \ | |
| jq -r 'to_entries[].key' | \ | |
| while read; do | |
| docker-credential-desktop get <<<"$REPLY"; | |
| done |