Monthly Archives: December 2012

Ubuntu – Unity, XFCE, etc: making/changing applications shortcuts

For Unity, XFCE, and many more desktop environments, the files that cause programs to show up in your menus and Unity menus are in two places: /usr/share/applications ~/.local/share/applications <–especially for WINE Sometimes an application might not show up in your menus nicely because it doesn’t have a .desktop file in either of these locations. Try […]

Draftsight CAD software on Ubuntu 14.04 or 12.04 64-bit

You can easily install this and other .deb programs that have complicated prerequisites by using GDebi: sudo apt-get install gdebi sudo apt-get install libgtk2.0-0:i386 sudo gdebi ~/Downloads/draftsight.deb   Manual, complicated way follows: You can also consider trying more libre options Note: These directions applied to Draftsight version V1R3.1 .. V1R5.1 Note: alternatively, Draftsight Windows version […]

Ubuntu 12.10: Compiling POV-Ray 3.7: prerequisite packages

It’s handy to use Synaptic Package Manager to get these. or type in Terminal: sudo apt-get install libboost-dev libboost-thread-dev zlib1g-dev libpng12-dev libjpeg-dev libtiff5-dev libopenexr-dev libsdl1.2-dev Note: if using Ubuntu 12.04, get libtiff4-dev instead of libtiff5-dev

Ubuntu: Fixing Desktop icons and Menu items for MATLAB

MATLAB doesn’t automatically setup itself in the menus of Ubuntu, but you can easily fix this with these two steps: type in Terminal: sudo wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png sudo nano /usr/share/applications/matlab.desktop cut and paste these lines: #!/usr/bin/env xdg-open [Desktop Entry] Type=Application Icon=/usr/share/icons/matlab.png Name=MATLAB R2014a Comment=Start MATLAB – The Language of Technical Computing Exec=matlab -desktop Categories=Development; […]

Ubuntu 12.10: renaming ethernet interfaces from “p1p1″ to “eth0″

Sometimes, an ethernet interface will install itself as “p1p1″ or the like instead of the traditional “eth0″. Some software (e.g. MATLAB) will only accept “eth0″ for licensing. Here’s how to rename your network card in Ubuntu 12.10: Get your ethernet card MAC address: ifconfig | grep HWaddr keep it handy (open a new Terminal window […]

Repairing broken symbolic link (linux)

First of all, be sure you know what you’re doing. A symbolic link may become broken due to updating/compiling/installing software, showing up as red text in ‘ls’ in Terminal. Let’s suppose our broken link is named “foo.so” Steps find where link pointed to: readlink -v foo.so Determine where link should point do (e.g. a new […]

REGEXP to get formatted date out of arbitrary length string

This regexp was tested in Octave 3.6 and Matlab, and will hopefully work in plurality of regexp parsers in C etc. Based off of regexp string from: http://www.regular-expressions.info/dates.html REGEXP string to get YYYY-MM-DD string from arbitrary length string: (19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01]) Matlab/Octave REGEXP date string example code: input = ’09av8joj23oit2pojiijo/20398/vj89/2012-10-15/0298f9082j23′; %random stuff with date in it […]

Raspberry Pi: check temperature of CPU

Check Raspberry Pi temperature: type sudo /opt/vc/bin/vcgencmd measure_temp

MATLAB/Octave: check free disk space

This method is for Matlab or Octave running on Linux (or Cygwin) systems only. The example below assumes you want to check the free space on your C:\ drive using Cygwin, or your HOME directory using Linux. Choose one or the other. myDrive = ‘/cygdrive/c’; %for cygwin myDrive = ‘~’; % for Linux [err,freeSpaceBytes] = […]

Matlab/Octave 32-bit: injecting 64-bit integers like int2str()

int2str() may not work correctly on 32-bit Matlab/Octave when using 64-bit integers on all platforms. To ensure your 64-bit integer converts to string correctly, use: sprintf(‘%ld’,myInt) in place of: int2str(myInt)