Posts

Setup housemon

 Based on Ubuntu 20.04: sudo ufw status sudo ufw default allow outgoing sudo ufw default deny incoming sudo ufw allow ssh sudo ufw enable sudo ufw status sudo apt-get install fail2ban sudo service fail2ban status sudo vim /etc/fail2ban/jail.local [DEFAULT]  bantime = 8h  ignoreip = 127.0.0.1/8 xxx.xxx.xxx.xxx  ignoreself = true  [sshd]  enabled = true  port = 22  filter = sshd  logpath = /var/log/auth.log  maxretry = 3 sudo systemctl restart fail2ban sudo iptables -L f2b-sshd --line-numbers sudo service fail2ban status sudo iptables -L f2b-sshd --line-numbers sudo iptables -L Install python via asdf. Install poetry. Install nginx. Copy hm_server.tgz to server. Untar hm_server.tgz in /opt/services. sudo chown -R userx:userx /opt/services/hm_server cp configs/hm_server.conf /etc/nginx/conf.d cp configs/hm_server.service /etc/systemd/system/ Edit configs/hm_server.service for appropriate user. sudo usermod -a -G www-data userx cd /opt/servi...

Syncthing install Ubuntu 20.4

curl -s https://syncthing.net/release-key.txt | sudo apt-key add - echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list sudo apt-get install apt-transport-https sudo apt-get update sudo apt-get install syncthing sudo apt install daemonize For WSL 2: (issue in admin Powershell) netsh interface portproxy add v4tov4 listenport=22000 listenaddress=0.0.0.0 connectport=22000 connectaddress=xxx.xxx.xxx.xxx netsh interface portproxy add v4tov4 listenport=21027 listenaddress=0.0.0.0 connectport=21027 connectaddress=xxx.xxx.xxx.xxx connectaddress from ip addr in WSL 2. Open both ports for UDP and TCP in Defender.

Cmake compile

 cd to top subdirectory. CXX=/opt/gcc-11.2.0/bin/g++-11.2 cmake . make

mp3splt

mp3splt -t 5.00 -a -d . mp3splt -S 2 -d .  a=1; for i in *.mp3; do   new=$(printf "%04d.mp3" "$a");   mv -i -- "$i" "$new";   let a=a+1; done;

Xonsh installation.

python3 -m pip install --user pipx python3 -m pipx ensurepath pipx install xonsh pipx inject xonsh pygments prompt-toolkit setproctitle

GCC 10.2 Ubuntu

sudo apt install build-essential wget m4 flex bison libgmp-dev libmpfr-dev libmpc-dev mkdir src && cd src tar -xvf ../gcc-10.2.0.tar.xz cd gcc-10.2.0/ mkdir build && cd build ../gcc-10.2.0/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/opt/gcc-10.2.0 --enable-checking=release --enable-languages=c,c++,d,fortran,go --disable-multilib --program-suffix=-10.2 make  -j 12 make install-strip export PATH="$PATH":/opt/gcc-10.2.0/bin export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":/opt/gcc-10.2.0/lib64 export CC=/opt/gcc-10.2.0/bin/gcc-10.2 export CXX=/opt/gcc-10.2.0/bin/g++-10.2 https://solarianprogrammer.com/2016/10/07/building-gcc-ubuntu-linux/

FT-8800 Cheat Sheet

Set CTCSS: [SET] key -> Menu #40 -> Press dial ->               Select tone -> [SET] key. Program memory: In VFO, set up params -> Hold [SET] key ->               Select memory -> [SET] key. Memory delete: Hold [SET] key -> select memory ->               [SCN] button. Memory to VFO: Select memory -> hold [SCN], "MT" appears ->               hold [V/M].

Install Node / Yarn / ReasonML

asdf plugin-add nodejs asdf list-all nodejs bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring asdf install nodejs 12.16.3 asdf global nodejs 12.16.3 npm install -g yarn yarn global add bs-platform

Install Opam

apt install bubblewrap mercurial darcs sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) opam init

Ubuntu / Arch packages for python source install

sudo apt install wget build-essential sudo apt install libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev libffi-dev uuid-dev tk-dev pacman -S openssl zlib ncurses readline sqlite3 gdbm db bzip2 gcc-libs expat xz libffi libutil-linux tk zypper install zlib-devel ncurses-devel readline-devel gdbm-devel sqlite3-devel libbz2-devel  db bzip2 expat xz-devel libffi-devel tk-devel libopenssl-devel env PYTHON_CONFIGURE_OPTS="--enable-shared" asdf install python 

x11vnc

x11vnc Execute on machine to be shared as normal user: x11vnc -bg -nevershared -tightfilexfer -usepw -display :0

Fixing DNS Resolution problems with Linux Mint 19

Fixing DNS Resolution problems with Linux Mint 19 Linux Mint 19 has an issue (at least on the machines I've installed it on) where resolv.conf has its nameserver entry pointing to 127.0.0.53. That works fine except for resolving local subnet names (in my case 196.168.1.x). The following fixes the symptoms, though I still don't know why 127.0.0.53 is being used instead of the assignment from DHCP. Run in root console, or sudo: # apt install resolvconf # nano /etc/resolvconf/resolv.conf.d/tail nameserver 192.168.1.1 # resolvconf -u This will tag the local nameserver entry onto the end of resolv.conf and persists through resets.

Create a new repo

Create a new repository Generate a local git repo in the project working directory: git init . SSH to remote server create a bare repo using the project name: ssh tim@fileserv git init --bare /files/git/xxxxxxx exit Add the files to be tracked and commit: git add blah.c git commit -a -m "Initial commit." Add the remote repo and push: git remote add origin tim@fileserv:/files/git/xxxxxxx git push --set-upstream origin master

dd Command

dd Command dd if=linuxmint-19-mate-64bit-v2.iso of=/dev/sdc bs=1M status=progress conv=fsync && sync

Rsync Commands

Rsync Commands rsync archive mode, preserve hard links, acls, extended attributes. rsync -aHAXv /mnt/src/ /mnt/dest/ rsync root filesystem. rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/folder