Tuesday, December 23, 2014

Firefox Register protocol

Firefox 3.5 and above

(Works without installed Gnome libraries)
  • Type about:config into the Location Bar (address bar) and press Enter.
  • Right-click -> New -> Boolean -> Name: network.protocol-handler.expose.foo -> Value -> false (Replace foo with the protocol you're specifying)
  • Next time you click a link of protocol-type foo you will be asked which application to open it with. 
 http://kb.mozillazine.org/Register_protocol#Firefox_3.5_and_above

Friday, November 28, 2014

matlab fix bad ticks, fix plot print preview,

%%% nice tick format %%%%%%%%%%%%%%%%%%
% Query xTick numerical values.
yTick = get(gca,'yTick');
% Create strings out of yTick numerical values with a prescribed precision.
% The format string '%a.bf' means to present the values within a field that
% is wide enough to fit 'a' digits with 'b' digits after the decimal point
% in the format of a 'f'loating point number.
yTickLabel = arrayfun( @(y) sprintf('%1.3f',y), yTick, 'uniformoutput', false);
% Use xTickLabel on the plot.
set(gca, 'yTickLabel', yTickLabel);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
src: http://www.mathworks.com/matlabcentral/answers/103188-how-do-i-format-tick-labels

To prevent Matlab from messing it once again at the print level:


Thursday, November 27, 2014

latex invisible section

Something like this:
\newcommand\invisiblesection[1]{%
  \refstepcounter{section}%
  \addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}%
  \sectionmark{#1}}
...

\invisiblesection{Blah}
 
http://tex.stackexchange.com/questions/68272/make-section-headings-invisible 

Tuesday, November 25, 2014

makebst bst dbj file modify by hand

During the makebst-session:
COLLECTION/PROCEEDINGS TITLES (if quoted title)
(*) Quote collection and proceedings titles too
(x) Collection and proceedings titles not in quotes
Choose x.
It's unnecessary to redo the whole session (like I did four times), just open up the dbj-file and comment out the wrong answers, and remove the comment-sign (%) at the correct answers. Just remove one comment-sign at the relevant answer, sometimes there's a purpose to have a second comment-sign at some answers.
Then open up your terminal and call on the edited dbj-file that generates the bst-file.
latex foo.dbj
Where foo is the name you choose in the beginning of the session.

http://tex.stackexchange.com/questions/22902/adjusting-booktitle-in-inproceedings-in-a-makebst-file

Saturday, November 8, 2014

Beep in shell script

SRC: http://askubuntu.com/questions/19906/beep-in-shell-script-not-working

Solution 1)
First run sudo modprobe pcspkr and then beep should work.
The reason this doesn't is because by default Ubuntu no longer loads the hardware driver that produce beeps.
If this works for you then to enable the loading of pcspkr permanently edit the /etc/modprobe.d/blacklist.conf file (using gksudo gedit perhaps) and comment out line that says blacklist pcspkr so it looks like this:
# ugly and loud noise, getting on everyone's nerves; this should be done by a
# nice pulseaudio bing (Ubuntu: #77010)
# blacklist pcspkr
 
Solution 2) 
Not being a fan of the pcspkr beep, I use a beep from one of the system sounds with the installed pulseaudio server's paplay command.
First find a sound you like (you can browse /usr/share/sounds for some available ones for example) and create a reference to it
export BEEP=/usr/share/sounds/KDE-Im-Message-In.ogg
Then have it available as a command
alias beep='paplay $BEEP'
Now just run beep whenever you need it. For example, to alert you when a command is finished:
find . | grep treasure ; beep

Friday, October 24, 2014

Searching for marked (selected) text in Emacs

M-W (to get a copy of the selected text) C-s C-y . Then repeat C-s as needed. Similarly for C-r.

Src: http://stackoverflow.com/questions/202803/searching-for-marked-selected-text-in-emacs

Monday, October 13, 2014

KDE navigation shortcuts

The Go Menu

GoPrevious Page
View the previous page of the document.
GoNext Page
View the next page of the document.
GoBeginning of the document (Ctrl+Home)
Go to the beginning of the document.
GoEnd of the document (Ctrl+End)
Go to the end of the document.
GoBack (Alt+Shift+Left)
Go back to the previous view of the document.
GoForward (Alt+Shift+Right)
Move forward to the next view of the document. This only works if you have already moved back before.
GoGo to Page... (Ctrl+G)
Open a dialog which allows you to go to any page of the document.

Source: https://docs.kde.org/stable/en/kdegraphics/okular/menugo.html