Command line in browsers for private modes

Not as usual as a double click on a icon, but useful too, you may type a command line for start a browser.

Some brosers have a richfull command line options. If you want to start browsers in a private / incognito mode type:

  • for Firefox: firefox -incognito
  • (for more information check this article from Mozilla about Command Line Options)

  • for Epiphnay: epiphany --incognito-mode
  • (Epiphany has its own man page, so may type man epiphany to stay up to date for the options in your installed version).

  • for Google-chrome: google-chrome --incognito (for more information check this post from SuperUser about Google-chrome awitches)

You may dig into your favourite search engine to no found how many options they offer us.

How to tell to fail2ban what init system are you running

I owed myself a fail2ban installation on the Raspberry Pi. A simple view of this log tell you many things:

Jun 17 07:54:15 raspberrypi systemd[1]: Starting Fail2Ban Service...
Jun 17 07:54:28 raspberrypi fail2ban-client[11687]: ERROR No file(s) found for glob /var/log/proftpd/proftpd.log
Jun 17 07:54:28 raspberrypi fail2ban-client[11687]: ERROR Failed during configuration: Have not found any log file for proftpd jail
Jun 17 07:54:29 raspberrypi systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Jun 17 07:54:29 raspberrypi systemd[1]: Failed to start Fail2Ban Service.
Jun 17 07:54:29 raspberrypi systemd[1]: fail2ban.service: Unit entered failed state.
Jun 17 07:54:29 raspberrypi systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Jun 17 07:54:29 raspberrypi systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Jun 17 07:54:29 raspberrypi systemd[1]: Stopped Fail2Ban Service.
Jun 17 07:54:29 raspberrypi systemd[1]: Starting Fail2Ban Service...

You may notice I’ve tried to start up Fail2ban unsuccesfully. So let’s debug…
It appears an error that informs there’s no proftd.log. The second line points to the same log file, but related with fail2ban configuration (jail, here means fail2ban configuration).

After digging a lit bit I’ve found that fail2ban sets as auto its configuration and try to guess if your system is managed by systemd, traditional systemV init scripts or whatever. I edit the /etc/fail2ban/jail.conf, I set backend = systemd and fail2ban starts up succesfully.

How do you indetify an USB and get it mounted in your Linux?

I’m using a RaspberryPi to enforce myself to keep learning.

I’ve added an old 8Gb USB stick to the RaspberryPi. The Raspberry runs a very minimal Raspbian Strech Lite without assistants, or graphical interface, not even with the automunt command.

So, how do you identify the USB stick plugged and get it mounted or your Linux?

  1. Plug your USB stick to your RaspberryPi
  2. Run the command blkid as root.
    As an example I type:

    sudo blkid

    … and I get:

    /dev/mmcblk0p1: LABEL="boot" UUID="CDD4-B453" TYPE="vfat" PARTUUID="b1b51741-01"
    /dev/mmcblk0p2: LABEL="rootfs" UUID="72bfc10d-73ec-4d9e-a54a-1cc507ee7ed2" TYPE="ext4" PARTUUID="b1b51741-02"
    /dev/sda: LABEL="USB8GB" UUID="B21F-17E5" TYPE="vfat"
    /dev/mmcblk0: PTUUID="b1b51741" PTTYPE="dos"

    This line identify what device is used by the USB stick just plugged /dev/sda: LABEL="USB8GB" UUID="B21F-17E5" TYPE="vfat"

  3. Now we can mount normally the device by typing:

    sudo mount -t vfat /dev/sda /mnt/

What is the motivation of this post? I’ve to managed myself in order to get mounted the USB stick since the command lsusb gave me a lot of info but no so usefull, or simple, to get it mounted.

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.