Sometimes, python modules in pypi.org is outdated a little bit but it's source code has already fixed what you wanted. You can install the said module directly using: 1## git clone the module-name from its repo, then 2python -m pip install -e ./module-name or in one line (replace the repo accordingly): 1pip install -e …
Read MoreBest approach in doing development in any language is to have an isolated dev environment. In python, we do it this way: 1python3 -m venv env 2source ./env/bin/activate See more options in https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/
Read MoreVagrant in Linux repos are not always updated. It can be installed but had issues with the latest versions of Virtualbox. With that, always get latest from Hashicorp Vagrant Releases Page Alternative Boxes VagrantBox.es - boxes not found in Vagrant Cloud might be here Self-Hosting Vagrant Cloud If your security …
Read MoreSuppose you have a bash script that wants to pass a value to an awk line. You would do something like this: 1awk -v today="$(date)" 'BEGIN {print today}' Key above is the -v in awk which can be repeated as there are variables to assign. See man awk for details. If you put it into the awk body, (outside …
Read MoreAssume that you have a column of data and you want to separate each column into it's own file. It's relatively easy in awk. Input is a sha256 or hash of ebooks: 1~$ sha256sum *.pdf 29scac1ae26617a210e2211cce308aa2b770b08cb51f46621b13be272877cc068 ebook1.pdf …
Read MoreThis swaps every two lines of input. Given this input.txt 1wan 2tew 3free 4phore Ouput the following: 1tew 2wan 3phore 4free Full command to run: 1~$ cat input.txt | awk '{ 2if ((getline tmp) > 0) { 3print tmp 4print $0 5} else 6print $0 7}' CREDITS: https://www.math.utah.edu/docs/info/gawk_6.html
Read MoreHere's the TravisCI yml file I used while this site was still with TravisCI. It gets the hugo specific version, build the site and commit + push to gh-pages. Just adapt it to your situation and enjoy! 1language: python 23env: 4global: 5- USER="icasimpan" 6- EMAIL="deploy@travis-ci.com" 7- …
Read MoreIn WSL2 Console, create /etc/wsl.conf with this contents: 1[user] 2default=username Then in powershell (administrator): 1wsl --shutdown Reopen terminal and make sure default user is now changed. Reference: https://superuser.com/questions/1566022/how-to-set-default-user-for-manually-installed-wsl-distro
Read MoreInstall qemu from https://www.qemu.org/. Tested working on Windows and not on WSL 1.\qemu-img.exe create -f qcow2 'C:\Users\icasimpan\rockyLinux.hdd' 40G 2.\qemu-system-x86_64.exe -hda C:\Users\icasimpan\rockyLinux.hdd -cdrom C:\Users\icasimpan\Downloads\Rocky-8.6-x86_64-minimal.iso -boot d -m 2G -vga std -net …
Read More