-
Bash For Loop With Spaces
I always forget how to do this. Iterating over files with a bash for loop when the file name has a space. There are few ways I tried using arrays and delimiters, but changing $IFS worked best. In this case I’m sorting by the first lowercase letter or number. files0="$(find...
-
Web Scraping with Ruby - Forex Example
Ruby is great for web scraping, I’ve been using it for things like the example below, automated downloading of Forex Quotes. The gems mechanize and nokogiri do all the work. I needed to maintain the script below - so I’m putting it here for future reference. Setup: >gem install mechanize...
-
Caltech Introductory Machine Learning online course (MOOC)
Very well delivered online course from Caltech: Introductory Machine Learning online course (MOOC). I’ve only been listening via iTunes University, however it’s delivered so well that even without the visuals the high level details are clear. (I will need to revisit everything after lecture 4 a second time…) Currently up...
-
Ubuntu GCC Alternative Versions
Manage different GCC versions. http://manpages.ubuntu.com/manpages/trusty/man8/update-alternatives.8.html $ update-alternatives --list gcc /opt/gcc-4.9/bin/gcc /usr/bin/gcc-5 /usr/bin/gcc-7 $ sudo apt-get install gcc-9 g++9 $ which gcc-9 /usr/bin/gcc-9 $ which gcc /usr/bin/gcc $ gcc --version gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 Copyright (C) 2017 Free Software Foundation, Inc. $ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 20 $ sudo...
-
Helios4 Suspend Setup
Helios4 in suspend mode keeps waking up. Watchdog timer wakeup seems to be the issue. As it’s a recent install wake on lan suspend feature is enabled: https://wiki.kobol.io/helios4/wol/#suspend-system. Looks like this is the solution: https://github.com/openmediavault/openmediavault/issues/343.