Jun 24, 2017

(bash): The most useless commands (6)

After talking about
  1. rev
  2. yes
  3. sl
  4. cowsay
 i found another funny command:
cmatrix
The manpage says:
NAME
       CMatrix - simulates the display from "The Matrix"
and it is true:

Jun 21, 2017

(bash): The most useless commands (5) | bash builtin commands

[if you are looking for the builtin commands of jshell: read this posting]

In a comment Albert Godfrind pointed out, that the commands i was talking about like
  1. rev
  2. yes
  3. sl
  4. cowsay
are not really bash commands (in a way that they will be installed within the installation of the bash shell). They are commands, which can be used from on every shell. So my headline is a little bit missleading - thanks for this notice.

Just for clarification here a list with all bash builtin commands:
  • alias
  • bind
  • builtin
  • caller
  • command
  • declare
  • echo
  • enable
  • help
  • let
  • local
  • logout
  • mapfile
  • printf
  • read
  • readarray
  • source
  • type
  • typeset
  • ulimit
  • unalias
and the bourne shell builtins:

  • break
  • cd
  • continue
  • eval
  • exec
  • export
  • getopts
  • hash
  • pwd
  • readonly
  • return
  • shift
  • test
  • times
  • trap
  • umask
  • unset
Still missing:

Jun 18, 2017

Bash: The most useless commands (4)

The blog statistics show, that there are many people reading the posts about useless commands. And there is the next candidate:
cowsay
Now you are thinking, what is cowsay?
DESCRIPTION
       Cowsay  generates  an  ASCII picture of a cow saying something provided by the user.  If run with no arguments, it accepts standard input, word-wraps
       the message given at about 40 columns, and prints the cow saying the given message on standard output.
?

Okay. Here we go:
$ echo what a cool command | cowsay
 _____________________
< what a cool command >
 ---------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
One thing to add here: moo 

Jun 14, 2017

Bash: The most useless commands (3)

The blog statistics show, that there are many people reading the posts about useless commands. And there is the next candidate, suggested by an anonymous comment:
sl
This is my most hated program on a shell. Why?
NAME
sl − display animations aimed to correct users who accidentally enter sl instead of ls.
and this program is not interruptable by ctrl-c.
It shows a train running from the left to the right
and blocks your shell for at least 2-3 seconds (depends on the width of your shell window):
$ time sl
real 0m3.347s

Jun 10, 2017

Ubuntu: mouse jumps to trash icon / move to lower left corner / bottom left

There are many questions about jumping mouse cursors on ubuntu.
And there are often answers like
  • clean your touchpad
  • your touchpad is broken
  • send your laptop back
But there are so many people suffering this, so it is not reasonable that all these touchpads do not work well.

One thing to solve this is to install
gpointing-device-settings
but this does not really help.
Next thing:
add-apt-repository ppa:atareao/atareao
apt-get update
apt-get install touchpad-indicator
/opt/extras.ubuntu.com/touchpad-indicator/bin/touchpad-indicator 
But this is not really the solution. But you can disable your touchpad while typing, so that the window focus does not jump to the trash icon and your typing is interrupted.

After searching i found the following discussion on a mailing list:
https://lists.freedesktop.org/archives/xorg-devel/2014-June/042790.html

And the follwing did the job:
apt-get install xserver-xorg-core apt-get install xserver-xorg-input-libinput
apt-get remove --purge xserver-xorg-input-synaptics
and then a logoff and login into the x window system...

Jun 9, 2017

Bash: The most useless commands (2)

The last posting about useless commands for bash discussed the command
rev
. One nice comment pointed out, that the rev command can be used for searching inside logfiles (Thanks to phoxis.org).

Like it was said there, the command
yes
looks even more useless:
NAME
       yes - output a string repeatedly until killed
SYNOPSIS
       yes [STRING]...
Ok - it can be used for scripts to answer call backs. But which kind of script needs always the same answer? (and commands like "apt-get" support this via the option "-y".

Any other suggestions about useless bash commands?

Jun 4, 2017

Bash: The most useless command

After many years working with the bourne again shell i  am still learning some commands, which i never used.
I am completely convinced that i discovered the most useless command:
rev
The manpage says:
rev - reverse lines characterwise
 Is there anything, where i can use this command?

Ok. I can check if a word is a palindrome (like 123321 or otto):

#!/bin/bash
# Shell script to test if a string is a palindrome
# This simply uses the 'rev' command found in util-linux-ng package
# and checks if the reverse of the string is same as the original
 echo "Enter a String : "
read string
if [ "$(echo $string | rev)" = "$string" ]
then
 echo "\"$string\" IS a Palindrome"
else
 echo "\"$string\" IS NOT a Palindrome"
fi
This script i found in here.

Has anyone used the rev command for something reasonable?
Please write a comment!

More useless commands can be found here.

Jun 3, 2017

Ubuntu: Eclipse does not find openjdk (JRE)

On my Ubunut linux i decided to do some Java programming.
So first step is to install java:
apt-get install openjdk-9-jdk openjdk-9-demo openjdk-9-doc openjdk-9-jre-headless openjdk-9-source
This just works like expected. But after that i installed eclipse.
Download via www.eclipse.org was easy and the installation ran without any error.
But Eclipse was not able to find the JRE for compiling, autocorrection, etc.

For all developers, which are not used to linux:
The JRE is in Ubuntu located here:
/usr/lib/jvm/java-9-openjdk-amd64/jre
And it is added like on any other platform via the preferences window:
 After that Eclipse runs fine and you can start building your java applications...

Ubuntu: visudo problem / NOPASSWD option does not work for commands

It is always the same:
After installing a new Linux commands like
/usr/sbin/s2disk
/sbin/reboot
only work with entering your password everytime (or precisely: after every reboot).
This can be changed with visudo:
export EDITOR=vi; visudo
 Inside the /etc/sudoers.conf you will see:
# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
And this is the problem:
First idea is to double the line
root    ALL=(ALL:ALL) ALL
schroff    ALL=(ALL) NOPASSWD: /usr/sbin/s2disk
and do the desired changes.

BUT: This will not work!

You have to add your line at the end of the file and after you exit vi (or whatever editor you have configured) it will work...

UEFI and Linux: Installation of Ubuntu on a new laptop / How to add grob on UEFI

On my new laptop i decided to install in addition to windows 10 a linux distribution.
First idea was to install debian linux but the debian installer does not provide any functionality to resize the partitions. And without this, the windows partition will be erased after the installtion.
I knew, that the ubuntu installer had this functionality, so i created a usb stick and tried installing ubuntu.

The installation went through like a charm, but the next reboot does not show up the grub boot menu. The laptop started without any call back.

?

I found a solution here.

You have to enter the BIOS/UEFI and set a password:
After that you are allowed to select a new trusted uefi file:
 Then walk to grubx64.efi via HDD0 -> EFI -> ubuntu:
 



After that you have to reboot once and enter the BIOS/UEFI again.
New you can change the boot order and move the grub to the first entry:
Now every reboot enters the grub menu and you are able to choose ubuntu or windows...