My musings regarding GNU/Linux, FreeBSD, OpenBSD and GNU/Minix. Generally these are my comments towards topics related to "Free as in Freedom" software and tips for installing and configuring Debian GNU/Linux, Arch GNU/Linux, FreeBSD, OpenBSD on laptops and other generics. My deepest gratitude to all the devs and users keeping the whole FLOSS philosophy working. You can follow me on the fediverse through Mastodon. @srinicame
Sunday, August 6, 2023
Friday, October 30, 2020
Going "console only "on GNU/Linux
Got frustrated with the time taken for the browser to load up and then dependency trap for installing other gui applications. Add to that the nuisance of gtk and qt quirks on a 4K monitor. The feeling is share by many. But as we shall see living in this place is not easy. The major difficult piece of the puzzle is the browser. All your banking, shopping options are ruled out in the terminal.
What I did here was to disable even the start of the X server. I disabled sytemd unit which is supposed to reach the graphical login target. Disabled the graphical login manager, lightdm in my case. Disabled all the cloud stuff which ubuntu GNU/Linux starts with lot of difficulty. In fact, because of this the first boot of ubuntu after install is a hit or a miss. After boot do not try to login immediately. There are plenty of things ubuntu is doing in that phase. If you try to login, it will fail. Wait for 10 minutes, approx, it might be higher so that it spews many lines of information over the login prompt, then it will allow you to login and change the default password.
Disabled ssh service, because the rpi 4 is connected to a 4K monitor. Even during login, ubuntu tries to plenty of things. It will try to check for updates and provide a notification once in the motd. It will also provide information from the ubuntu motd server which canonical wants you to see. It will also spew out certain information from your computer like memory usage, load on the cpu etc. All this will take plenty of time considering the rpi 4. Find the respective scripts and disable them to speed up the time required to reach the login prompt. So, we have reached the login prompt. The fonts are so tiny, you have to squint to type any commands. First thing is to first reconfigure the fonts. Get the biggest font available while running the re configuring tool. Yes, the size can be changed, but the fonts are horrible. They are not for your daily tasks. All the fonts which you had installed in your X is now out of reach.
The console well, is a console. It will display fonts which are baked into the linux kernel. If anybody knows how to change the fonts on the default console, kindly advice or drop a link. But, as of now, we have a readable console and the font size is alright. The fonts are not. We have been pampered for the variety of fonts on X. It is a requirement that we should do something about it. Step in, fbterm. As the name suggests it is a terminal emulator designed to work with a framebuffer. The biggest advantage, supports all the fonts supported on X. There goes my first gripe about the console. So, we install fbterm and start and run it at the console. The console is taken over by fbterm and again we have micro-sized fonts, but nice looking fonts taken from the X environment you had installed earlier. Let us go ahead and fix the fonts by restarting fbterm with fbterm -s 24. This was for my monitor. Try experimenting with different sizes to get the optimum size.
The config file for fbterm is in .fbtermrc. Well, I already see your smiling face and I have received your gratitude and in turn it is time to congratulate you for completing the first time required for living in the console. Whatever further tools we are planning to used depends on this success. The fonts are beautiful and they are your favorite ones. They look good and it is as though you are back on your terminal emulator on X, but without all its bells and whistles(another name for bloat). You now can clearly distinguish between l and 1, 0 and O, I and L. I would like to thank all the creators of fonts which can clearly distinguish the characters of the English language. It is an artists job and the creator of any font is an artist.
You opened the fbterm man page and want to edit the configuration file by reading the manual, you are out of luck. You are on the console. There are no windowing systems. What d you do, you press C-A-F2 and switch to the next virtual console and login again. Then you can switch between the virtual consoles. Your are now flabbergasted. You have started hating yourself for moving away from X. But, fritter not, there are further goodies which come with fbterm. You can create multiple windows and switch to them using shortcuts as mentioned in the fbterm man page. This will give you a method of moving between multiple windows and then moving between them.
Let us go to the next step. Now, you would like to group certain windows and recognize them for a specific task group. You have a web page related, you have a manual page related and couple of windows concerned to the programming task related to the web page and the man page. You are out of luck. You cant see all the windows at once together on one single screen. Frustration. Enter terminal multiplexer. The first name which comes to he mind is tmux, if you are a year 2000 person and screen, if you are before that. These are excellent tools and are blind faith groups unto themselves. So, if you like a tool, silently use them. Do not compare them and publish your comparisons. This is because, if you have reached a position where you compare both these tools, that means you already "prefer" one among them. This will start a war. We already have the longest running war between Vi and GNU Emacs. These are the kitchen sinks of terminal multiplexers.
If you are a person believing in the *nix philosophy of "One tool that does one thing and does it best", then you have an alternate option. Many a times I had tried to pull myself together and learn tmux, but since I was using the i3 wm, I thought that it is not worth the effort. I could open as many windows and all would be started side by side preparing a huge canvas for exchanging information. I am in love with i3 wm for its simplicity and doing what it is supposed to do and doesnt do anything more. A huge shoutout to all the devs and users of this fantastic wm. Now, once again my terminal multiplexer flames were re-kindled by Mr. Bronie Robertson on his youtube channel. I like his videos. They are short and to the point with excellent examples and use case scenarios.
Plentiful thanks to him for introducing me to abduco. Such a strange name. If there are explanations for the name kindly enlighten me. A session management tool with such a strange and difficult to pronounce name. However, what caught my attention was the ease with which Bronie did the session management. No obscure keystrokes to remember. Just session management and nothing else. In fact, I understood session management in that under 10 minutes video, than I had tried for a good 10 years. So, Thank you Bronie. Yes, there might be plenty other things required for complex setups, but for a desktop use and a home network user, that is exactly what the doctor would prescribe.
So, three main things which a session manager has to do. Create a session. Detach a session. Re-connect to a session. abduco does all the three with elan. All technicalities, I would redirect you to Mr. Bronie. So to create a session, let us understand what is a session. A session is a group of tasks related to one another. It is a method of grouping applications and open files related to a task on hand. Let us say the session you have created contains a compile task which will take another hour. Now, you are free to let us say, listen to some music, read a novel, well, things like that. What we now do is, detach the task on hand. And now, the compiling and all other windows are moved to the background and keep running. We will now create another session and do the relaxing stuff related to music and reading. You now want to continue listening to music and then you would like to check your online accounts like your email, your toots etc. You detach the multimedia session and start a new session with these applications. Its been an hour and you would like check on your compile session, You detach the online session and re-connect to compiling session and so on. That is session management for dummies.
But in a session, if you have to have multiple windows grouped together, it is all good in an X environment. If you remember we are at a console running fbterm. We were very happy with good fonts but a bit sad about moving between windows as every window occupied the complete screen making it very difficult to share information between windows. Enter dvtm. The expansion will be dynamic virtual terminal manager. The name tells everything. It is there to manage windows. It will create, position, delete windows. It is an equivalent to i3 wm and more close to dwm wm but for terminals. When we create a new window in dvtm, we are starting a new terminal waiting for our input. dvtm does exactly what i3 does. It just arranges windows side by side in many different ways. But all your window contents are there for you to see and transfer between windows in the same screen. For our case it is a window manager for the console.
I hated the console because if you wanted to refer to a man page and return back to the editor, you had to suspend the editor read up and remember the man page and then suspend the man page and bring back the editor to the foreground and dump whatever you remembered from the man page. This is no way ideal. For the optimal setup, we combine a session manager with a terminal manager and you have Window management for the console. How do we do it? Well just run both the commands in unison as so.
abduco -c session_name dvtm -m ^x
What we are doing is asking our session manager abduco to create(-c) a new session and name that session "session-name" and the application it has to run is dvtm. The next option is for the MOD key. The default key for the MOD key is ^g. Yes, you are a bit confused here. For i3 users, the MOD key used to be a single key like the super key or the ALT key. But, these keys are not recognized by the console. So keep the default or change it to the value which I use, since x is close to the control key than the g key. Once you run this command, a session is created and control is handed over to dvtm. Now here you can start using the keybindings as suggested in the man page of dvtm. MOD-c will create a window in the tiled mode. Another MOD-c press will create another terminal window and so on. MOD-j and MOD-k will move between the windows and all windows are available in one single screen.
I cannot express my joy, when I saw my console splitting into multiple windows. For everything else there is MasterCard. You did plenty of work by moving between windows and your program is now copiling. Time to relax. Detach the session by pressing MOD-\. You now land back at your console. Now run another command as so abduco -c relax dvtm -m ^x You get a fresh canvas. Create multiple windows again for playing your music with lyrics, reading a book by the next window.
Enough of recreation, back to work. But, you want the music continue to play and want the book you were reading to be at the same place. Detach this session again by pressing MOD-\. Run without any arguments, abduco, will list all the live sessions. Run this command with the session name abduco -a session_name Now you are connected back to your compiling and editing session with all the windows as you left them when you detached from this session. The compiling is not complete, detach again and then re-connect to your relax session and continue reading your book.
You are smiling. Your low spec PC is so responsive. But, But, We are living in a modern world and it is very difficult to survive without a pdf viewer, an image viewer, a video player, an ebook reader, a music player, a text reader(should we talk about it), web browser, a spread sheet, a document writer, a presentation tool and what not........
Let us try and resolve these applications one by one.
1. Let us start with a pdf viewer. This was rather easy. I was happy that the less command is more than capable of displaying text based pdfs. It will display pdfs with images, but the images are ignored.
2. An image viewer. For this the framebuffer image viewer, fbi is upto the task and is enough for viewing images and also includes the capability to perform a slideshow of the images supplied to the command.
3. For a Text reader/editor we are spoilt for choice and I would rather not talk about the options here. Whatever I talk about would be less.
4. If we come to the web browser, we do have choices, but none capable of handling 2 - 4GB of modern websites. We have applications for displaying true html. Blogs written with text only are a joy to read. I would recommend w3m. It also has support for images(I have not tried out this feature). If you access gopher holes or the modern avatar, the gemini space, then you are in luck and there are plenty of options. With the gopher and gemini protocol, you are at home in the console. Want to access your banking site, forget it.
5. If you are on the fediverse, there are clients for the mastodon network. There are clients for reddit.
6. For reading ebooks like epubs and mobis, I would recommend epy.
7. For searching the web we have the duckduckgo client ddgr and surfraw. Both are powerful and meet all the web searching requirements.
8. Playing music has always been easy on the console with plenty of applications. My personal favorite is the mpd and mpc combination with ncmcpp added into the mix.
9. For playing video, mpv is my default goto. The framebuffer device plays most of the videos thrown at it.
This has already been a very long post. If you made it this far, then you are definitely a console junkie. If I could give you a hint of the entrance to the rabbit hole, then I would be most happy. Dont forget to buy yourself a mechanical keyboard. Thanks to all the devs and users who wrote all those wonderful applications and of course GNU/Linux. The journey with the tux and the beastie and the puffer since the year 2000 has been nothing but joy. I would like to end the post with the tagline of distrowatch. "Put the fun back into computing. Use GNU/Linux, Freebsd, Openbsd, Netbsd, Plan9, templeos, Haiku, Minix, GNU ..."
Friday, May 22, 2020
Privacy in the present world
Now, while your phone is locked and seemingly a brick to your father and yourself is more live than you. It is sending out and receiving data continuously. it is after all a computer and computers as you know are not tired. The amount of horse power in the present devices is enormous and all this is put to use 24 hours a day. Not even a second is left. When you are not using your phone facebook is busy getting the text your entered into whatsapp before your shoot send. Because before you shoot send the text and all other information you want to share is UN-encrypted. So now facebook has that data which you wanted to send through your favorite encrypted free messaging system. Though the founders have departed, the juggernaut rolls on. Of course facebook knows to whom you sent the data. So, you are basically using facebook whole over again in the guise of encryption.
You will definitely ask me why take that example. Well that nearly covers majority of the users on the planet outside the apple ecosystem. Now let us come to the make believe elite system which use the apple ecosystem. I always believed that apple had strong business ethics, not moral ethics. Like their hardware and software is elite and unique to their Eco-system. They will sell their devices at a premium and what the user does with that is not their concern. This I think was happening with all their desktop and laptop offering before the iphone. With the iphone came the moral conundrum. Actually the iphone to start with did not create this issue. The issue was created by google with its android ecosystem. Here was a company which is going to make money by selling user data. By targeting users with ads related to their tastes. How do you do it? Get the user to accept a complicated user agreement before you can access the device. It did not stop at ads. It progressed to speech recognition, AI and so on.
Now the thing is data became important. The costliest commodity on the planet next to the rarest element on the planet. The same strategy which the printing companies did with their cartridges. Though the printers could be given free since the users had to buy a physical product, Here, the phones could not be given for free. They are complicated computers. In this case the users are f*&d all ways in all the holes. You buy a premium phone and you will be giving away more data. It is like having the cake and the icing too. Your phone is pinging data every mill-second. It is pinging data to all corners of the world.
You are now having an app ecosystem to bring you out of this mess. Well, these apps are all built out of user contributions. The phone makers can alter the operating system itself to bypass all these apps which try to stop these pingings. So, if your phone is connected to the public network with the present crop for smart phones, you are pinging data. Have you not been surprised to see a link or a post related to "masturbation" after watching porn on your phone. Your were asking what are they going to do with the data. Now, it has been answered. This is one of the simplest way intelligence is taken out of your data consumed an exported from your device. Just imaging the amount of data collected through out the world and then feed it to "Big data" to make it even bigger.
Privacy is the context have been talking in the previous paragraphs. it is not what is described in the first para. The corporations have moved from text and binary data to voice and video. It is difficult to know whether the mic is activated through out the life of your phone or only switches on when you watch porn. And while doing so, it might the device might switch on the front facing camera also. Just see how embarrassing it might be. You might be talking about an ailment or your friends ailments or you might talk about buying something. You might do a search for a particular ailment a product. It is recorded against your id. the corporations can combine it with your data sets and come out with the perfect ad or will feed you more of what you talked. You watch a thriller in Netflix, you are offered an unknown number of the same genre. You will be shown links related to them, but your are their unsuspecting user and you will click through it. This relation is generated by the the data they have collected from the whole world. Though you feel UN-related this link will re-inforce whatever you were searching for.
All corporations now hire behavioral scientists, data researchers who help them with their strategies. So, how do we get out of it? Do we want to get out of it? Are we happy in our walled paradise? Do we value our private data? Do we thing we have nothing to hide? Do we think we dont have anything of value? Do we think commenting and up-voting of posts on social media yields nothing to anybody?Is convenience a better trade-off for individual privacy? Is an individual of no value? Is an individual only a data generator? Is an individual not a human? Will the individual stand up for his rights?

