Saturday, 3 September 2016

Automate ssh execution with password auth

Warning: The following command should be used only, operating on hosts not shared with other users, for example in internal test-labs. Otherwise the following command line might leak the password via ps process table to other users. 

In case  to automate ssh commands for example in test-lab and using password authentication instead of public-private authentication the following command options could be used with ssh (sshpass and -o options will work similar for scp).

sshpass -p${PASSWORD} ssh -c arcfour  -o StrictHostKeyChecking=no  -o UserKnownHostsFile=/dev/null -o ControlMaster=no -o LogLevel=ERROR -l ${USER} ${HOST_IP} ${COMMAND}

Explaining a few elements:
  • sshpass is a command feeding the password into ssh via stdin, emulating terminal input.
  • StrictHostKeyChecking=no will disable the lookup of host-key of the target host in local whitelist. In case of freshly added machines to test-lab, the ssh command will not wait for manual confirmation to trust the new remote host.

Using Ubuntu sshpass can be installed as:

sudo apt-get install sshpass

Sunday, 20 March 2016

Lenovo X230 wifi stops - re-activate

I'm am using Ubuntu 15.10 on Lenovo X230. Sometimes the wifi does not work anymore, after waking the system up from suspend. The wif is available, but does not find any hotspots around.

After reboot the wifi is back again. But it is sufficient to unload and reload the kernel-module rtl8192ce

sudo rmmod -f rtl8192ce
sudo modprobe rtl8192ce


Afterwards the hotspots around will be detected again.

Monday, 21 December 2015

Installing Haskell IDE leksah in Ubuntu 15.10

On fresh Ubuntu-15.10 (Desktop) you must install the following packages to compile the Haskell IDE leksah.

$ sudo apt-get-install ghc ghc-testsuite cabal-install libgtk-3-dev libgtksourceview-3.0-dev alex happy libwebkitgtk-3.0-devlibghc-quickcheck-instances-dev doctest libghc-doctest-dev

https://wiki.haskell.org/Gtk2Hs/Installation
https://github.com/leksah/leksah/wiki/Getting-started-with-Leksah
$ mkdir -p ${HOME}/build/leksah
$ cd build/leksah
$ cabal sandbox init
$ cabal update
$ cabal install gtk2hs-buildtools
$ cabal install leksah


In case of cabal error messages please execute cabal in verbose mode to get to know the reason for the error
$ cabal install -v leksah

Finally leksah has been installed to the user specific sandbox  "${HOME}/build/leksah/.cabal-sandbox"  

Leksah is being started using the following command:

$ PATH="$PATH:${HOME}/build/leksah/.cabal-sandbox/bin" ${HOME}/build/leksah/.cabal-sandbox/bin/leksah
Starting up first time, Leksah will download and pre-compile some packages of Haskell. This may take some minutes.

Tuesday, 3 March 2015

Anniversary coming close: 
Almost 5 years ago I deployed  Android on the SmartQ7 tablet first time :)

https://skednet.wordpress.com/2010/04/09/qdroid-2-0-on-smartq7/


Wednesday, 11 June 2014

Lock/Unlock Icons for Encrypted Content/Devices

Hi, I am wondering why a mechanical old fashioned lock is used as icon to illustrate encrypted content. Thinking about this the following icons came into my mind, representing locked/protected data or unlocked/accessible data within a container. Maybe this icon will find its way into future software ;)

Thursday, 1 May 2014

Howto verify all files of first directory hierarchy reside somewhere in second hierarchy.

Imagine, you took a huge bunch of files residing in one directory subtree and you re-arranged them in a new directory hierarchy and now you want to prevent loss of any file.

The following command will read all filenames from ORIGINDIR directory and search for the filename in destination directory DESTDIR subtree. If the filename is not found, print it to console:
 
find ORIGINDIR -type f  | while read ENTRY ; do case `find DESTDIR  -name  $(basename $ENTRY) -print -quit` in '') echo "? $ENTRY" ;; *) echo -n "" ;; esac ; done

Friday, 7 March 2014

Granting Wireshark privileged capabilities

If you want to run wireshark as normal user (not root), the following capabilities should be set, so that wireshark can access the required socket capabilities:


sudo addgroup -system wireshark
sudo chown root:wireshark /usr/bin/dumpcap 

sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap 
sudo usermod -a -G wireshark YOUR_USER_NAME