Monday, May 02, 2016

Terminator: Set size and position in a config file

Example config file location: /home/mwo/.config/terminator/config

Example content [global_config]
parent = window0
profile = default
type = Terminal
parent = ""
type = Window
size = 2000, 500
position = 420:900

Wednesday, April 20, 2016

Ubuntu 16.04 and Matlab 2016a: MATLAB has encountered an internal problem and needs to close

There is some problem with matlab UI GPU-based rendering on nvidia as this is causing this problem
Stack Trace (from fault):
[ 0] 0x00007f5bbc4a024d /usr/lib/nvidia-361-updates/

The workaround is to launch matlab without GPU rendering: opt/MATLAB/R2016a/bin/matlab -softwareopengl

Thursday, April 14, 2016

Ubuntu: ssh to tor server

On the server:

Add this to /usr/tor/torrc HiddenServiceDir /var/lib/tor/sshd/
HiddenServicePort 22

Restart tor sudo service tor restart
Onion hostname file for the ssh service should be created sudo cat /var/lib/tor/sshd/hostname
Take note of the hostname
On the client:
Have tor browser running on the client.

Add this to ~/.ssh/config: host hidden hostname your_onion_hostname.onion
proxyCommand nc -x %h %p

Wednesday, April 13, 2016

Saturday, April 09, 2016

Ubuntu 16:04: Install Krusader with dependencies

sudo apt install krusader krename kdiff3 konsole kde-baseapps-bin Without kde-baseapps-bin, bookmarks manager does not work.

Tuesday, March 29, 2016

Ubuntu 16:04: wt-3.3.5 compile error

When compiling latest wt-3.3.5, the following compile errors can occure: usr/include/boost/core/ref.hpp:131:74: note: candidate: template const boost::reference_wrapper boost::ref(T&)
template BOOST_FORCEINLINE reference_wrapper BOOST_REF_CONST ref( T & t )

/usr/include/boost/core/ref.hpp:131:74: note: template argument deduction/substitution failed:
/tmp/wt-3.3.5/test/dbo/DboTest.C: In substitution of ‘template const boost::reference_wrapper
boost::ref(T&) [with T = dbo_test26::test_method()::CheckExpected]’:
/tmp/wt-3.3.5/test/dbo/DboTest.C:2381:76: required from here
/tmp/wt-3.3.5/test/dbo/DboTest.C:2381:76: error: template argument for ‘template const
boost::reference_wrapper boost::ref(T&)’ uses local type ‘dbo_test26::test_method()::CheckExpected’ model->dataChanged().connect(boost::bind(boost::ref(checkExpected),
/tmp/wt-3.3.5/test/dbo/DboTest.C:2381:76: error: trying to instantiate ‘template const
boost::reference_wrapper boost::ref(T&)’

This can be fixed, by compiling with C++11 mode: cmake ../ -DWT_CPP_11_MODE:STRING="-std=c++11"

To specify prefix folder (i.e., installation folder): cmake ../ -DWT_CPP_11_MODE:STRING="-std=c++11" -DCMAKE_INSTALL_PREFIX:PATH="/opt/wt"

To build wt libraries as static (i.e. *.a), do: cmake ../ -DWT_CPP_11_MODE:STRING="-std=c++11" -DCMAKE_INSTALL_PREFIX:PATH="/opt/wt" -DSHARED_LIBS=0

Saturday, March 26, 2016

Ubuntu 16:04: Segmentation fault (core dumped), but no core file

Make core files to be located in the current working folder sudo service apport stop
ulimit -c unlimited

Thursday, March 10, 2016

ImageMagick: Crop images in half verticly

Left halfmogrify -gravity West -crop 50%x100%+0+0 *.tiff Right halfmogrify -gravity East -crop 50%x100%+0+0 *.tiff

Wednesday, January 06, 2016

Thursday, November 05, 2015

rsync: copy files with a given extensions

rsync -zarv --include="*/" --include="*.h" --exclude="*" --prune-empty-dirs /home/marcin/cpp/bitmonero ./test