Welcome to my tweaking page: Arch Linux, Android, i3wm, Octave
Sharing is Caring! Push the Boundary Beyond the Norm!
Use Tech/Computing beyond what is provided to you! Possible only because of existing open-source projects.
An enthusiastic person to have fun with the Linux system. I learned the hard way. Therefore, all the posts are based on real tests and experience.
Systems Tested-On: Arch Linux, Proot Container, Samsung S21 ultra mobile.
Last Updated: 07/01/2024
A. Terminal Based Clients (Arch Linux using Termux, S21 ultra Phone)
You could download all these files from my github page. I tested on Arch linux as a proot-distro using termux on android (Samsung S21 phone and S6 tablet).
If you found my work helpful, don't hesitate to show your appreciation by giving a star to my Github repository or leaving a message through the contact page, anonymously. Your feedback and support are always appreciated.
For installation of Arch linux on Android phone, please see the youtube videos: Part 1, Part2, overall what we could do, and there will be many more.
(A.1) Mutt-Wizard Email Client: Gmail/Outlook
Step by Step commands (showed in Italic/bold-format)-
Learn from this LINK
https://github.com/LukeSmithxyz/mutt-wizard
yay –S mutt-wizard
gpg --full-gen-key
pass init abc@gmail.com
Now get an app-based password from a Gmail/outlook account for which 2FA is enabled. Those passwords will be needed for the below command to add an account for the mutt-wizard.
mw -a abc@gmail.com
#for sending email put in fish/bash config file
export EDITOR=nvim
Change to .mbsync file, Remove "[Gmail]All email" from Patterns section
Just keep Patterns "INBOX"
The size of the downloaded Gmail will be 1/3 of the actual Gmail space
mbsync -V abc@gmail.com
neomutt
Similar steps for outlook.com email from Microsoft like abc@outlook.com
(A.2) Mutt-Wizard Email Client: Office365
Little different for Office365 email from the University where Duo 2FA login is required for emails like abc@manchester.ac.uk. Here, I couldn't use the mutt-wizard automated process to succeed. Therefore, I did each manual every step and I couldn't find on the internet the total steps to be followed exactly for this kind of account.
Learn from these links
http://pnijjar.freeshell.org/2022/mutt-uw-duo/
https://wiki.archlinux.org/title/Isync#Using_XOAUTH2
Step-by-Step Guide (commands are in bold) -
1. Request IT services to enable IMAP for your University account
2. Follow the first link to edit the mutt_oauth2.py file accordingly and once you execute the command given below, you may not need to follow the rest. Here, I used the same email address abc@manchester.ac.uk for editing that file (i.e. for creating gpg key) and for the command below where you need to provide your University email address.
~/bin/mutt_oauth2.py ~/.mutt_token--verbose –authorize
3. yay –S cyrus-sasl-xoauth2-git
4. Manually Add to .mbsync file
IMAPAccount abc@manchester.ac.uk
Host outlook.office365.com
User abc@manchester.ac.uk
PassCmd "/home/user/bin/mutt_oauth2.py /home/user/.mutt_token"
AuthMechs XOAUTH2
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
Timeout 120
PipelineDepth 50
IMAPStore abc@manchester.ac.uk-remote
Account abc@manchester.ac.uk
MaildirStore abc@manchester.ac.uk-local
SubFolders Verbatim
Path /home/user/.local/share/mail/abc@manchester.ac.uk/
Inbox /home/user/.local/share/mail/abc@manchester.ac.uk/INBOX
Channel abc@manchester.ac.uk
Far :abc@manchester.ac.uk-remote:
Near :abc@manchester.ac.uk-local:
Patterns "INBOX"
Create Both
Expunge Both
SyncState *
MaxMessages 0
ExpireUnread no
# End profile
5. Manually Create abc@manchester.ac.uk.muttrc file at this location .config/mutt/accounts/
6. Add to abc@manchester.ac.uk.muttrc all those commands, similar to Gmail file : abc@gmail.com.muttrc or Outlook file: abc@outlook.com.muttrc
7. Manually add a MaildirStore folder for abc@manchester.ac.uk, similar to abc@gmail.com which was automatically created using mutt-wizard. Otherwise, you will see MaildirStore error : cannot open store
8. mbsync -V abc@manchester.ac.uk
9. neomutt
(A.3) Music Player : ncmpcpp and mpd daemon
To make ncmpcpp in working condition using mpd daemon, could be a nightmare and at some point, you might give up! Here, are the guidelines to make it work perfectly without any hassle.
Step by Step process -
sudo pacman –S ncmpcpp mpd mpc
sudo pacman –S --needed acpi alsa-utils pulseaudio pulseaudio-alsa
After installation make sure that .config/mpd/mpd.conf file has the set of following codes
db_file "~/.config/mpd/database"
log_file "~/.config/mpd/log"
music_directory "/sdcard/Music"
playlist_directory "~/.config/mpd/playlists"
pid_file "~/.config/mpd/pid"
state_file "~/.config/mpd/state"
sticker_file "~/.config/mpd/sticker.sql"
bind_to_address "127.0.0.1"
restore_paused "yes"
max_output_buffer_size "16384"
audio_output {
# type "alsa"
type"pulse"
name "pulse audio"
# name "mpd alsamixer-output"
# mixer_type"software"
}
audio_output {
type "fifo"
name "toggle_visualizer"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
port "6600"
4, Make sure that .config/ncmpcpp/config file contains this set of blocks
ncmpcpp_directory = ~/.config/ncmpcpp/
mpd_host = localhost
mpd_port = 6600
mpd_music_dir = "/sdcard/Music/"
One thing, sometimes you would be facing is that everything was okay before restarting the system and now ncmpcpp showing connection refused, that probably mpd daemon was not stopped/killed properly. Don’t worry either kill the mpd daemon using PID manually or boot the operating system.
Here, I used /sdcard/Music/ for my S21 phone where all the music files are stored locally. Make sure that the music file location for ncmpcpp and mpd config files remain the same.
Special case for Android Phone:
5. In this case you need to pipe/tunnel the sound from Android system to Proot Container where the Arch Linux system is installed. Just run the below command on Termux before entering into the Linux system or make a Termux widget for the command
pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1s
(A.4) OneDrive Client (1 TB storage): On Arch Linux (aarch64 architecture)
1) mkdir ~/OneDrive from your home folder/location
2) curl -fsS https://dlang.org/install.sh | bash -s ldc
3) clone/download the installation folder from https://github.com/abraunegg/onedrive/
4) add the following line to the fish config
source ~/dlang/ldc-1.30.0/activate.fish
5) go to the downloaded onedrive folder & execute the following commands to install
6) ./configure
7) make clean
8) make
9) sudo make install
10) exit from the folder
11) remove/uncomment the line from the fish config file source~/dlang/ldc-1.30.0/activate.fish
12) Execute the command onedrive from the terminal
13) A link will appear in the terminal right click and open it in the browser. You will get Microsoft’s login screen, enter credentials, and sign in via duo 2FA authentication for your university onedrive storage (say, 1TB) attached with your email id abc@manchester.ac.uk
14) After that, a blank screen will open, copy the link of the blank screen and paste into the terminal for [Enter the response uri]:
15) That’s it! OneDrive is now synched with Linux. Execute the below line from home folder to pull/sync all the files/folders from the OneDrive cloud storage to your local folder
16) onedrive --synchronize
17) onedrive --reauth, for refresh duo login in case it expires.
(A.5) Tracking favourite stocks from terminal : NSE & BSE
(1) One of the best is to watch all the listed stock on one page on the terminal, by using mop package.
Use the below command to install from the community (AUR) package
yay -S mop
Now after that, type mop in the terminal to launch the applications. It will show some USA-based stock lists. To get Indian stock, just check the file .moprc in the home folder and edit the list accordingly.
For example to monitor a few Indian stocks, add these inside the .moprc file.
"AFFLE.NS",
"INFY.NS",
"IRCTC.NS"
"ITC.NS"
(2) Another one to track individual stocks/currency value (such as GBP to INR) is the tstock package
Install it by using the command below
(a) yay -S tstock
(b) Get a free AlphaVantage key from this site https://www.alphavantage.co/support/#api-key
(c) After getting the key, add the following line either to your .bashrc file or fish config file.
export ALPHAVANTAGE_API_KEY= YOUR KEY FROM THE ABOVE LINK
Now Execute the following commands to see how it works
tstock gbp/inr
tstock ITC.BSE
tstock ITC.BSE -b 24
(A.6) Jupyter notebook from Smartphone : Usage of Python packages for plotting, coding, data analysis etc
It has something to do with how Arch saves sockets to systemd, which is not accessible in Proot, thus the permission denied error will come if I use jupyter notebook from Arch Linux or probably with Android 13 or the library libzq component.
first, install jupyter on termux and then use it.
Now, you could use the installed Jupyter Notebook from the proot Arch distro using sourcing the installed environment. No need to install it a second time on Arch Linux.
or If want to use inside arch Linux proot distro then, some workaround you could use is : create a file with the name skip_getifaddrs.c with nvim
#include <errno.h>
#include <ifaddrs.h>
int getifaddrs(struct ifaddrs **ifap) {
errno = EOPNOTSUPP;
return -1;
}
and save it.
now in python environment, execute the codes:
gcc skip_getifaddrs.c -o skip_getifaddrs.so -shared
LD_PRELOAD=/home/ochi/skip_getifaddrs.so jupyter notebook --allow-root
now the kernel won't die/crash inside Arch Linux
Jupyter Notebook is the best way to plot or run some fitting/code to some data and plot it using a smartphone. As it doesn't need any other visual server or manager. Use Termux proot distro as a server and then use any web browser on Android as a client to see the fitted data or plot data.
(A.7) Connect smartphone via Termux to Windows and Mac using WinSCP and FileZila
If you want to transfer files between your phone (or any Android devices) and PC/Macbook over the same wifi, then for Windows use WinSCP, and Macbook use FileZilla. No need to connect to over USB or such thing. This is a good way of doing it if you use the Termux Proot distro and would like to transfer files between Android/PC/Macbook to/from Termux Linux.
To connect to cluster/computing service, these two software are enough to connect to from a PC/Macbook. No need for other packages/software. If you are running Virtual Maschine OS (via Hyper-V or so) on Windows, then WinSCP is the best way to transfer files between the host OS and Hyper-V guest OS. BTW, WSL Linux is way faster than Hyper-V Linux.
How to connect to Termux :
(a) open Termux and execute command sshd (follow the link for OpenSSH), to start the server. Execute ifconfig to know the IP address.
(b) Choose only the SFTP transfer protocol from WinSCP/FileZilla.
(b) for WinSCP /FileZilla, in the server field put the IP address of the phone, port 8022 (not 22 as this will not work for the proot distro. Port 22 is only for the chroot distro.). Fill in the username, but do not put a password (after pressing the connect button, it will ask for a password and then provide one), and do not save the password for any of those. Now save the configuration.
(c) For FileZilla, use interactive session always (for duo authentication, it is a must otherwise it won't work).
That's it. Enjoy!
B. Quantum Espresso:
According to popular belief, "no one can craft espresso as superbly as the Italians".
(B.1) Installing QE-7.2 on WSL Ubuntu 22.04 Distro
Start with the following order:
wsl --install (open windows terminal in admin mode and install it by executing the command, then restart)
sudo apt update && sudo apt upgrade
sudo apt install autoconf build-essential ca-certificates gfortran libblas3 libc6 libfftw3-dev libgcc-s1 liblapack-dev
sudo apt-get install libomp-dev
sudo apt-get install openmpi-bin openmpi-common libopenmpi-dev libgtk2.0-dev
------------------------------------------------------------------------------------ These are not needed------------skip to no. 11--------------------------------------
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
------------------------------------------------------------------------------------ These are not needed------------skip to no. 11--------------------------------------
Then in the home directory extract the downloaded QE tar file by executing the following command:
tar -zxvf q-e-qe-7.2.tar.gz
Open a terminal in the extracted QE folder (which is qe-7.2) and run the following commands one by one to install QE. Don't run the "make" command in parallel mode while installing, because some of them won't compile in parallel mode because they run in serial mode.
./configure
make pw
make all
make epw
Then add these lines in .zshrc file
export PATH=~/qe-7.2/bin:~/qe-7.2/EPW/bin:$PATH
export PATH=~/qe-7.2/EPW/ZG/src:$PATH
C. Terminal Based Clients for MacOS
Apple's investment in turning Arch Linux into a sleek and polished MacOS has not only raised the bar for user experience but also instilled a sense of pride among Arch Linux enthusiasts who can now boast of a truly premium system.
So, if you handled Arch Linux before (or Manjaro derivatives), then it's almost the same. I am using the MacOs Ventura (13.3) which is University managed (which means, a bit restricted).
(C.1) Setting the Terminal
First, you need to add the home-brew repository to install different software packages.
Execute the following command on terminal
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After that, you are ready to install the software. I use the iterm2 terminal for various themes etc.
brew install -cask iterm2
(C.2) Install All the necessary packages
brew install ranger gdu lsd fortune sl htop cmatrix neovim mc vlc
brew install smplayer mpv mplayer mpd ncmpcpp audacity youtube-dl iina
brew install gimp inkscape klayout youtube-dlc spotify
brew install gotop bpytop openssh cmus eDEX-UI git
brew install rectangle the-unarchiver imageoptim onyx winzip
brew install foxitreader pipes-sh cowsay pngquant wget
brew install imagemagick ghostscript scrcpy
brew install —cask rectangle telegram slack spotify fantastical messenger signal zoom firefox
For radio: myTuner Radio is a good graphical application for world-based stations.
(C.3) Install Gywddion
brew install gwyddion
gyddion is installed on the following path
/opt/homebrew/Cellar/gwyddion/2.62_1/bin/gwyddion
Make an alias by right-clicking then copy it (/opt/homebrew/Cellar/gwyddion/2.62/bin/gwyddion alias) to the application folder in the file manager
launch the application by typing in the terminal: gwyddion
(C.4) Watch youtube videos from terminal
Brew install jq fzf kitty alacritty
brew install --cask font-fira-code-nerd-font
git clone https://github.com/pystardust/ytfzf
cd ytfzf
sudo make install doc
mkdir ~/.config/ytfzf
Now open ~/.config/ytfzf/conf.sh in a text editor (create it since it doesn't already exist), and paste the following:
YTFZF_HIST=1 # history is on by default it can be set to -> 0 history off, 1: history on
YTFZF_LOOP=0 # if set to 1 it is on but normally it is off by default. Can be turned on using option -l
YTFZF_PREF="bestvideo[height<=?80]+bestaudio/best" # set the video format
YTFZF_ENABLE_FZF_DEFAULT_OPTS=1 # fzf colors are going to be the ones from your fzf configuration
FZF_PLAYER="mpv"
# sets the video player used by ytfzf (mpv by default), e.g. FZF_PLAYER="devour mpv"; you can also specify the YTFZF_PLAYER_FORMAT, e.g. YTFZF_PLAYER_FORMAT="devour mpv --ytdl-format="
Now type the following in the terminal for the YouTube video: ytfzf bollywood audio song
ytfzf assamese audio song
If you face a sound issue with the mpv player then, change the command line as provided below. As of now, there is a bug for the latest mpv player with sound. As of now, there is an issue with merging audio and video. Use for audio only now, to listen to music.
FZF_PLAYER="mpv --audio-device=coreaudio"
PATCH: The updated patch will solve the sound issue :
a. mkdir -p ~/.config/mpv/scripts/
b. cd ~/.config/mpv/scripts/
c. curl --location --remote-header-name --remote-name https://raw.githubusercontent.com/mpv-player/mpv/master/player/lua/ytdl_hook.lua
d. ls -l ~/.config/mpv/scripts/
This will solve the audio issue
ytfzf ochitec youtube videos
(C.5) Install Latex for Mac
Download the MacTex file from the LINK
then unarchive the file, and double-click the installer to install the latex, just like for Windows.
then use the TeXShop editor (it comes with a MacTex package) for writing, and compiling the document.
(C.6) Terminal-based radio for Mac
brew install pipx
pipx install radio-active
radio --station "BBC Radio 3 HD"
Another Radio application is Tera.
brew install gh
brew tap shinokada/tera
brew install tera
type in the terminal tera
then follow the instructions
(C.7) Jupyter notebook and python coding for Mac : Easy steps
brew install jupyterlab
mkdir notebook
cd notebook
pip install matplotlib
try this example
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 5, 0.1);
y = np.sin(x)
plt.plot(x, y)
D. Life in the UK test for ILR (or PR)
"Life in the UK" test (30/03/2023) : TWO Days Enough
Read the book "Life in the UK". Another free version & not an official version can be found here (this file is not complete, though).
Watch some YouTube videos. I used this LINK (Funny and Good one, therefore you will remember).
Then load in your brain-drive this Excel Sheet (attached with the repository, named ILR.xlsx). It is not all covered, but you will pass.
Note: I created this one while I was preparing. If it is helpful, give a star to my GitHub repo page or use the contact page to express your gratitude anonymously.
Parliament and other obvious things, which are easy to remember, are not included in this Excel file. To memorize those years (numbers), try to mark major events and then do the plus or minus few years. You need to create tricks like that to memorize.
Try to do some online dummy tests:
a. This is a free website (15 tests)
b. And here if you have time, you could go through all. I did just the exam section.
Last 2 hours before your exam: Reviewing the Excel file before your exam can help refresh your memory and boost your confidence in tackling any related questions during the exam. 2-3 days is enough for the preparation. Don't waste much time on this.
One month before, you could book the test with a fee of £50.00 from the official site.
The sequence I would recommend:
(a) Read one time the main book (Life in the UK), (b) Watch the shared YouTube video, (c) Try to memorize the Excel sheet, (d) Now go for some dummy tests, and (d) Memorise the Excel sheet again.