Open / create the inputrc file by typing pico ~/.inputrc And add the line: set completion-ignore-case on
Blog
switch off cpu cores in ubuntu/linux
For some benchmarks it can be important to have a system operating on just a specific number of CPU cores. To find out how many you have, just count them by: $ ls -l /sys/devices/system/cpu/ Switching a core off is just as easy as echo 0 > /sys/devices/system/cpu/cpu7/online which would switch off core 7. For… Continue reading switch off cpu cores in ubuntu/linux
tab exension for hostnames in ssh
Using the tab extension is a nice thing. To make ssh know your hosts, add three lines in the ~/.ssh/config folder: Host mySpecialHost HostKeyAlias somehost-somewhere.ch Hostname somehost-somewhere.ch
access (lot of small) functions residing in one MATLAB m file
Usually, you create one m-file for one MATLAB function. But what to do if you have many small functions? It’s odd to create a lot of files which just contain some lines of code. The other approach is to put the small functions just inside the m file where they are called from. This is… Continue reading access (lot of small) functions residing in one MATLAB m file
access NTFS partition from linux
http://ubuntuforums.org/showthread.php?t=217009
send big chunk of data over linux sockets
Sending a big chunk of data over linux sockets can be tricky, because we need to call the write function multiple times. The following snippet assumes a valid socket filedescriptor “socketfd”, after the connection is established. Make sure that PACKETSIZE is smaller or equal to 2^16 and that nbytes equals the amount of bytes of… Continue reading send big chunk of data over linux sockets
convert a video to a MATLAB readable file in UNIX
Convert the movie by: ffmpeg -y -i input_file.avi -f avi -vcodec rawvideo -pix_fmt bgr24 -acodec pcm_s16le output_file.avi
Compile MATLAB functions in C and link them with Intel MKL CBLAS
The MATLAB utility “mex” (enter “help mex” in command window in MATLAB) is a wrapper for your actual compiler, like gcc. It does not support intels icc. But this is no reason not to use the Intel MKL libraries! Write your code and compile it with: mex cpuMatrixCBLAS.c -I/opt/intel/Compiler/11.1/069/mkl/include/ -L/opt/intel/Compiler/11.1/069/mkl/lib/em64t /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_solver_lp64_sequential.a -Wl,–start-group /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_intel_lp64.a /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_sequential.a /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_core.a… Continue reading Compile MATLAB functions in C and link them with Intel MKL CBLAS
start MATLAB in command line mode from bash/linux console
Sometimes I want to start matlab without having the (lame) X interface. Instead of, I just use the command line. For this purpose, just run: matlab -nodisplay Or even easier, by adding a small script in /$MATLAB_HOME/bin maybe named “matlabnoX” with the content above. Make sure to chmod the file such that it is runnable!
Sort collections in java
Usual problem: When you pass a java list to Collections.sort(List list), the elements are sorted according to their returned values retrieved by calling the objects compareTo() methods. Well, what to do if you suddenly want to sort the same list by another criteria? Then a comparator is your friend. A comparator knows how to compare… Continue reading Sort collections in java