How to modify every day login in Linux

Every time you log into a *NIX machine you are wellcomed by a text banner that varies from one *NIX to other, even among Linux distributions.

If you want to customized this message it’s fairly easy, you only have to edit (as a root) the file /etc/motd and the next login will show your new message of the day.

My two cents to a so simple task is enrich your file writting inside some ASCII art. For instance, you may use figlet to writte inside the /etc/motd file your hostname. In short:

  1. Be sure you have figlet installed in your system or install: in Fedora; type yum list figlet or (lazy way) yum list figl* and figlet may appears in one of both list, installed or available package.
  2. Add different messages to each login with fortunes. First, be sure you have fortunes installed in your Fedora and then, edit your .profile and add an invocation to the fortunes program.
    For instance, I add this:
    echo -n "### Fortune for "
    echo -n `date +%d\-\%m\-\%Y`
    echo " ###"
    /usr/games/fortune

    I get this:
    ### Fortune for 22-04-2018 ###
    Computers are useless. They can only give you answers.
    -- Pablo Picasso

    BTW, I recommend to writte the full path to the fortune’s binary ’cause it’s installed out of the usual $PATH.

If you research a few over thhe Internet you may find differente fortunes collections, such The Simpsons, or my favorites inspired by BOFH.

Why am i going to “play” with a Rasperry Pi? (Update 31/03/2018)

Why am i going to “play” with a Rasperry Pi? Short answer; for educational purposes.

No the little bit more explained why I decide to sset up a Rasperry Pi, but also going to the point:

  • I’m very bad with hardware, so it’s a little bit challenging for me
  • a very good friend gift me its Raspberry Pi 1 (512Mb RAM) and it was collecting dust
  • I may obtain something useful at the end of the process, for instance, a media server, a little NAS, whatever.
  • I’m going to refresh my former sysadmin skills; file system formatting, installing different OS’s flavours, setting up a network, etc.
  • It’s a wide documented process so it keeps my attention in making the right thing, not in solve a new problem never before seen.

So, again, for educational purposes, mixing up fun with refreshing basic skills.

Update 31/03/2018:
Raspian up & running on an Raspberry Pi 1 model. Reasons for Raspbian:

  • Main reason: It forces me to get out of my usual Red Hat / CentOS / Fedora distro to a Debian based one. I hope this helps me in a future for getting the LP1 Certification
  • General purpose (I’m not looking for a particular functinality), I’m satisfied if it acts as a ssh gateway to the rest of home network
  • Well documented, this is a must since learn something new requires make mistakes. For example, I bought a USB – WiFi here you got how seting WiFi up via the command line, because command line always teches more than graphical interfaces IMHO

Dnf update problems and how to solve them

One of my workstations runs Fedora for a quite long. I’ve been following practices from my previous technical job and take easy to upgrade the distro or to switch the “lates-what-ever-technology” you would imagine.

I’ve finally adopt dnf command instead of yum to manage the command lines. It has being going well but suddenly I’ve started to received this error message in the terminal:

Traceback (most recent call last):
File "/bin/dnf", line 36, in
main.user_main(sys.argv[1:], exit_code=True
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 185, in user_main
errcode = main(args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
return _main(base, args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 115, in _main
cli.configure(map(ucd, args))
File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 981, in configure
self.optparser.usage = self.optparser.get_usage()
File "/usr/lib/python2.7/site-packages/dnf/cli/option_parser.py", line 255, in get_usage
usage += "%-25s %s\n" % (name, summary)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 40: ordinal not in range(128)

So I decide to go back to the trusty well worker yum.

Finally I’ve found how to solve the problem, by typing this:

  1. export LANG=C
  2. dnf clean all
  3. … and then you may type dnf clean all just is case
  4. Finally, type dnf update and everything must be settled and done, and your system gonna work with dnf or yum, as you wish

First things on an new Linux workstation

I got a second hand laptop -just adquired- that fulfills my requirements

  • New root prompt with red background, as I explained time ago, in my opinion it must be a default configuration in order to alert you who you’re. It’s specially useful when jump from one machine to another
  • Install pure flash (yes I know it’s not FLOSS)
    1. rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
    2. rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
    3. yum check-update
    4. yum -y install flash-plugin AdobeReader_enu adobe-release-x86_64
  • have a look on what daemons are running in the system in order to stop all unnecesary software (Type as a root systemctl and get familiar with the command line for the new Systemd)
  • Make your comfortable cozy room, custom .basrch; I’m used to add this lines (plus the root prompt I told you before):
    1. set -o vi
    2. alias ll='ls -l'

I’m just to do more things, such a install my favourite browser, or few concrete software I’m devoted to, let that for a former post.