Monthly Archives: August 2012

Installing PyEphem in Ubuntu–computing sunrise/sunset in Python

PyEphem has some of the functionality for Python that the NAIF SPICE package has for C, FORTRAN, IDL, and MATLAB–specifically, the ability to perform high-precision astronomical calculations. PyEphem may be obtained from: http://pypi.python.org/pypi/pyephem To install the PyEphem or Ephem packages for Python 2.7 or 3.x respectively, you must first have the python-dev or python3-dev respectively […]

One-double-click SSH Tunnel with RDP (from Linux to a remote Windows PC)

Assuming you have a remotely located Windows PC, and you’re using a Linux PC, and there is a port-forwarding router on the remote end, say: remote router WAN (internet-facing) address: 1.2.3.4 remote router forwarded port: 4321 remote PC RDP port: 3389 remote PC LAN address: 192.168.1.10 remote PC SSH login: MyPC remote PC name: MyPCname […]

Ubuntu: setting Nautilus default view to detailed list-view

I always want to see the “Date Modified” etc. detailed list-view in Nautilus. You can make the list-view be default in Ubuntu 12.04 by typing in Terminal: gsettings set org.gnome.nautilus.preferences default-folder-viewer ‘list-view’ If you wanted to check what your setting was first, you can read the current value by typing: gsettings get org.gnome.nautilus.preferences default-folder-viewer

Implementing Barron “Performance of Optical Flow Techniques” 1994 C code

W.r.t. the C code horn.c, lucas.c from the J.L. Barron 1994 article “Performance of Optical Flow Techniques” http://dx.doi.org/10.1007/BF01420984 http://www.cs.toronto.edu/~fleet/research/Papers/ijcv-94.pdf the original FTP site ftp://ftp.csd.uwo.ca/pub/vision is no longer available. There may be a partial mirror at University of Oviedo: ftp://ftp.uniovi.es/pub/vision/ Prof. Barron has reposted the data to his website: http://www.csd.uwo.ca/faculty/barron/FTP/ ———————————————————————- To compile the C code, […]

Filezilla FTP: Can’t list directories

If unable to list directories in Filezilla or other FTP software on a particular server, try enabling “Active Mode” for that server.

Making a 2D pyramid in MATLAB

To make a square-base 2D data pyramid in Matlab, where: N is the number of pixels per side (e.g. 512) MinVal is the minimum data value (e.g. 0) MaxVal is the maximum data value (e.g. 65535) do: N = 256; MinVal = 0; MaxVal = 2^16 -1; data = nan(N); temp = uint16(MinVal:round((MaxVal-MinVal)/(N/2)):MaxVal); for i […]

Installing FFMPEG and FFPLAY on Windows

To install FFMPEG and FFPLAY on Windows (XP through 7) follow these steps: 1) download FFMPEG from http://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-latest-win32-shared.7z 2) unzip the folders inside to c:\ffmpeg 3) set your PATH to include c:\ffmpeg\bin You can now use the powerful FFMPEG from the Windows Command Prompt. Note: if you don’t already have 7zip installed on Windows, download […]

Playing Motion JPEG 2000 (.mj2) videos from Matlab

MATLAB can create and read lossy and lossless Motion JPEG 2000 videos on Windows and Linux. You can play back Motion JPEG 2000 files on Linux with “ffplay” as follows: Linux In Terminal, type ffplay movie.mj2 where of course “movie.mj2″ is the .mj2 Motion JPEG 2000 video to be played. Windows from the Command Prompt, […]

Animated movies with image or imagesc in GNU Octave

As of GNU Octave 3.6.1, there does NOT seem to be a way to quickly update image (2D) data plots in a movie-like fashion. Here’s a code snippet for how to display movies of 2D timeseries data in MATLAB: % create data, 25 frames of 512×512 pixels data = rand(512,512,25); % create blank image img […]

Finding the biggest directories on Linux

Note, a very nice and small interactive program is ncdu. sudo apt-get install ncdu It will “graphically” show you the biggest directories and let you navigate your directories and delete large files. If you can’t install ncdu, try the process below using built-in functions. ———————————————————– To find the biggest directories on your Linux system, in […]