This is basically a summary from Clean code : A handbook of agile software craftsmanship written by Robert C. Martin. This is done as an assignment work which is targeted at making programming students to read books for themselves. If this violates any copyright laws please let me know, although i had used my opinion as possible.

The site is in the process of moving to linux.lmpeiris.com in the hope to enable additional services than just wordpress.

All the new posts will be posted to the new blog address above; so it is recommended to visit the above site.

Possibility to redirect lmpeiris.wordpress.com to linux.lmpeiris.com by automatic redirection is under consideration, but it comes at a financial charge. At the mean time, you may need to click the above hyperlink to visit the new site.

There are many popular audio players for linux; to name a few they would be XMMS, audacious, amarock . But all of these players are GUI-based; and they does not feel like ‘home’ when you are so addicted to using the command line. So i did some searching on possible options, and i found many. I’m only listing two of the best here, mplayer and Music On Console (Player) or MOC. The command line players have the advantage of less crashes, less usage of resources, playability in CUI only OS’s, remote logging to play sound files on a remote machine. The MPD (music player daemon) server can stream audio using any sound output server to a remote machine.

The MOC has a decent UI for a CLI program. Consists of two panes, one displaying the music files in the current directory and the other showing the current playlist. Play stats and tag info are displayed in the bottom, with the progress bar. Navigation within playlist and song can be done using keyboard. It’s updated support for pulse, OSS and alsa output.

Installation

for debian based sytems use, sudo apt-get install moc

for rpm based systems, it is unlikely that moc would be on the repository. Try yum install moc and see. If that’s the case, we need to compile from source which can be downloaded from this link. You would need following packages

for mp3 support:yum install libmad-devel libid3tag-devel

for wma,mp4,aac,ra support:yum install ffmpeg-devel (This caused a compile error due to ffmpeg-devel relocating its .h files .. so please don’t do this if you know how to use linking). To activate support for other codecs, see README.

press q and type mocp -x to end program. Otherwise the server will still be running 🙂

Mplayer

Mplayer running on console

This doesn’t need much introduction; which is as my perception is the best multimedia player ever, which can play videos too. Apart from the gmplayer (or mplayer-gui), the mplayer command can be used to play music on command line, with showing in depth info. Mplayer can play any audio file, it’s heavily stable and takes less resources. You can see my previous post on mplayer.

Now you know what they use in Linux Mint to make a cow “talk” when the terminal starts :). I’m going to tell you how to do it in a much more awesome way. The programs they use are cowsay and fortune-mode. Cowsay can show any string, a text output of a command,program to appear as a dialog generated by an ascii art (including cow).

There are options to decide the appearance of the cow and its eyes. For example the switch -d will cause the cow to appear dead. But the most important hack can be done by -f which forces to use a files called cowsay files, so that we can get anything other than cow. Type

cowsay -l

to find the path of these files. Try each file with following syntax

cowsay -f <cowfile name, without extension> <string to display>

ex: cowsay -f tux $USER

The cowfiles can be edited to appear as we want. Only edit the stuff rounded by the circle. Do not edit anything else, and save by giving a different file name. Or we can simply download an ascii art from internet and replace the stuff in rounded area.

Linux mint uses an additional program called fortune-mod to get’s stuff. Other than the command cowsay, cowthink can be used to appear like the cow is thinking, not speaking.

Fortune-mod (The classic fortune cookie program)

Fortune-mod is so far the funniest FOSS program i have come across with. It generates a random text string of a joke, a saying by a great person, something useful etc… Can’t be saying it all just try it by yourself. I haven’t seen the same thing twice after using it for some time.

Sudo apt-get install fortune-mod (for debian based systems)

yum install fortune-mod (for rpm based systems)

to use type fortune in the command line.

This can piped to above cowsay easily

ex: fortune | cowsay

a fortune | cowsay piped output

for other options of fortune, refer man pages.

Making the cow talk

To make this show on terminal startup (or run any program) you can put the above command in your bashrc file.

gedit ~/.bashrc

and add above commands, as you wish in it. You can add figlet command too. Open a new terminal to see the change.

So, mine produced something like the first picture in this post by these commands

Mmmmm…….. it’s me after a long time writing on this blog. I’ve almost forgotten that there was a blog of mine just waiting to be refreshed by it’s author. Within the last year i changed my PC and the operating system twice, and now using the Fedora 14 x86/64 edition. So I guess we should start from some ascii arts on the terminal to show up whenever it’s started. This type art is familar to the Linux Mint users who will see an animal saying something in ascii art upon start of each terminal. However, it requires use of multiple commands. This post is part one.

How to install – figlet is not provided with most of the Linux distributions, and it’s not included in their package hosting servers. Hence using yum or apt-get simply may not work. If that’s the case, we need to compile it from the source. You can download the source from here. Decompress it and change in to it’s directory in the terminal and type;

make

to compile figlet. For further information on compiling from source, see my article. Unfortunately, there’s no make install here so we need to change in to figlet directory always to use the command (you can copy the binaries and man pages in to correct directories but this is complex).

Purism announced today that it delayed its upcoming Librem 5 privacy and security-focused Linux smartphone for the third quarter of 2019. Initially planned to ship in early 2019, the revolutionary Librem 5 mobile phone was delayed for April 2019, but now it suffered just one more delay due to the CPU choices the development team had to make to deliver a stab […]

The GNOME Project released today the second beta version of the forthcoming GNOME 3.32 desktop environment for public testing. The GNOME 3.32 beta 2 release is here two weeks after the first beta version to add even more improvements and squash as many bugs as possible before the final release hits the streets next month. The second beta release of the GNOME […]