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 -


 

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

#include <errno.h>

#include <ifaddrs.h>

int getifaddrs(struct  ifaddrs  **ifap)   {

                errno = EOPNOTSUPP;

               return   -1;

}


and save it.

gcc   skip_getifaddrs.c   -o   skip_getifaddrs.so   -shared

LD_PRELOAD=/home/ochi/skip_getifaddrs.so    jupyter notebook    --allow-root



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

(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: 

------------------------------------------------------------------------------------ These are not needed------------skip to no. 11--------------------------------------

------------------------------------------------------------------------------------ These are not needed------------skip to no. 11--------------------------------------

Then in the home directory extract the downloaded QE tar file by executing the following command:

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.  

Then add these lines in .zshrc file

CTerminal 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

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

(C.2Install All the necessary packages

For radio: myTuner Radio is a good graphical application for world-based stations.

(C.3)  Install Gywddion

/opt/homebrew/Cellar/gwyddion/2.62_1/bin/gwyddion

(C.4Watch youtube videos from terminal

cd ytfzf

sudo make install doc

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="

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

(C.5)  Install Latex for Mac

(C.6Terminal-based radio for Mac

Another Radio application is Tera.

(C.7Jupyter notebook and python coding for Mac : Easy steps

try this example

DLife in the UK test for ILR (or PR)

"Life in the UK" test  (30/03/2023) : TWO Days Enough

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. 

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.

(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.