Thursday, July 9, 2015

MATLAB uniform ticks (uniformticks) and printing

The following script can make the axes nicer. Example:

%% render uniform ticks digits on Y axis
function uniformticks_y(deci) ; % input number of decimals as string
command = ['%0.' mat2str(deci) 'f|'] ;
ticks = get(gca, 'Ytick') ;
set(gca, 'YTickLabel', sprintf(command, ticks));

However, changing the graph manually in the GUI can upset the nice axes settings. Simply rerun the script from the console without closing the graphs.

Monday, June 22, 2015

convert graph image to text data

To convert a screenshot, photo or scan of a graph or plot to a text data table, use this software:

Engauge Digitizer

http://sourceforge.net/projects/digitizer/?source=navbar

bash copy a directory recursively, excluding some directory or file name

rsync -av --progress sourcefolder /destinationfolder --exclude thefilenametoexclude
rsync -av --progress sourcefolder /destinationfolder --exclude thefoldertoexclude
 
NOTE: if the filename or directory appear multiple times, they will be excluded multiple times

Src:http://stackoverflow.com/questions/4585929/how-to-use-cp-command-to-exclude-a-specific-directory 

Sunday, May 24, 2015

Latex / Bibtex rename Bibliography / references section when using babel

\addto\captionsenglish{\renewcommand{\refname}{Newname}} %% for babel

Monday, May 11, 2015

Kubuntu 12.04 wifi before logon

Check both boxes in network manger to get wifi running before login:
connect automatically & system connection

bash config files

For this task, you don't have to write fat parser routines (unless you want it 100% secure or you want a special file syntax) - you can use Bash's source command. The file to be sourced should be formated in key="value" format, otherwise bash will try to interpret commands:
#!/bin/bash
echo "Reading config...." >&2
source /etc/cool.cfg
echo "Config for the username: $cool_username" >&2
echo "Config for the target host: $cool_host" >&2
So, where do these variables come from? If everything works fine, they are defined in /etc/cool.cfg which is a file that's sourced into the current script or shell. Note that this is not the same as executing this file as a script! The sourced file most likely contains something like:
cool_username="guest"
cool_host="foo.example.com"
These are normal statements understood by Bash, nothing special to do. Of course (and that is a big disadvantage under normal circumstances) the sourced file can contain everything that Bash understands, including evil code!
Src/more: http://wiki.bash-hackers.org/howto/conffile

Wednesday, May 6, 2015

Subversion 1.7 on Ubuntu 12.04

there’s an official Subversion PPA on Launchpad, so for Ubuntu 12.04 all you have to do is add the following couple lines to your /etc/apt/sources.list file:

deb http://ppa.launchpad.net/svn/ppa/ubuntu precise main 
deb-src http://ppa.launchpad.net/svn/ppa/ubuntu precise main 

 To configure APT to trust this repository's signing key, run script from the page
https://launchpad.net/~svn/+archive/ubuntu/ppa

And upgrade Subversion to its latest version with apt-get:
sudo apt-get update
sudo apt-get install subversion

Source: https://kovshenin.com/2013/subversion-1-7-on-ubuntu-12-04/