Monday, May 18, 2026

Installing VS Code 1.106 on Big Sur

Apparently 1.106 is the last version to work on Big Sur (macOS 11). If auto-update updates you to an incompatible version, you will need to downgrade to continue to use it.

Fortunately Microsoft keeps all old VS Code releases available for direct download.

The URL pattern is: https://update.code.visualstudio.com/{version}/darwin/stable

 


Monday, January 22, 2024

LaCie 2big Firmware Update

How to update the Firmware on an old LaCie network drive.

Hardware: LaCie 2 big Network v.2 2 TB Gigabit Ethernet Professional 2-Bay RAID Hard Drive 301507U 

Purchase date: February 2011

Current firmware version: 2.2.9.3 (applied in 2012)

Latest firmware version: 2.2.13.3 (released in 2015)

Current date: January 2024

Process:

Firmware updates 2.2.10.1, .2.12.2, and 2.2.13.3 are currently (still) available from LaCie here:

https://www.lacie.com/support/network-storage/2big-network-2/

The first two updates need to be installed using the LaCie Network Assistant tool which I found on a download site. The tool no longer works on macOS since support for 32 bit apps was dropped. I installed it on a VirtualBox running Windows 7. Set the networking to use a "Bridged Adapter" to get network shares working. Use the tool to apply the updates:

The 2.2.13.2 update can be installed by coping the file to a specific location on the drive. See the PDF file in the zip for details.


Wednesday, October 4, 2017

Truncate docker logs

Set $id to the container id prefix and then run:

file=`sudo docker inspect --format='{{.LogPath}}' ${id}`
sudo truncate -s 0 $file

Sunday, January 15, 2017

Angular 2 and jsPlumb

Here's an example showing how to start using jsPlumb with Angular 2.

Create a new project using the Angular CLI and add the jsPlumb package:

    ng new PROJECT_NAME
    cd PROJECT_NAME
    npm install jsplumb --save

Add the jsPlumb script to angular-cli.json:

    "scripts": [
      "../node_modules/jsplumb/dist/js/jsplumb.min.js"
    ],

Modify the app component:

    import { Component, ViewChild } from '@angular/core';

    declare var jsPlumb:any;

    @Component({
      selector: 'app-root',
      template: '<div #test>Test</div>'
    })
    export class AppComponent {
      @ViewChild('test') testEl;
      ngAfterViewInit() {
        let me = this;
        jsPlumb.ready(function() {
          jsPlumb.addEndpoint(me.testEl.nativeElement);      
        }); 
      }
 
Run the server:

    ng serve 
 

Sunday, May 15, 2016

Visual Studio Code

VS Code is a Free, Lightweight Tool for Editing and Debugging Web Apps.
Visual Studio Code 1.0.0 was released in March 2016 and it's the best thing I've seen from Microsoft in a while. Definitely worth checking out: https://code.visualstudio.com/

Friday, April 22, 2016

Angular 2 Text Field Autocomplete



 Similar to Facebook mentions, adds auto-complete to text boxes and text fields:

Angular 2 Mentions on Github

Angular 2 Radio Buttons

Until they fix checkboxes to use ngModel binding (here), this works pretty well:

<input type="radio" [checked]="selectedType=='first'" value="first" (click)="selectedType='first'"> First
<input type="radio" [checked]="selectedType=='second'" value="second" (click)="selectedType='second'"> second
{{selectedType}}

Sunday, April 3, 2016

GitHub Primer

Clone a repo:
git clone https://github.com/username/repo.git

To see the status of files:
git status

To commit changes:
git commit

Config git for a push:
git config --global user.name "username"
git config --global user.email "username@users.noreply.github.com"

To see the config:
vi ~/.gitconfig

To undo a git push
(from http://stackoverflow.com/questions/1270514/undoing-a-git-push):
git push -f origin 67..dc:master

Thursday, March 24, 2016

Apache httpd SSL Reverse Proxy

Generate a certificate:
# Generate private key 
openssl genrsa -out ca.key 2048 
# Generate CSR 
openssl req -new -key ca.key -out ca.csr
# Generate Self Signed Key
openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
See: https://wiki.centos.org/HowTos/Https">https://wiki.centos.org/HowTos/Https

Put the files here: /etc/httpd/conf.d/

Install mod_ssl:
ls -l /etc/httpd/modules/
yum install mod_ssl
Add this confirguration to the end of the /etc/httpd/conf.d/ssl.conf file:
NameVirtualHost *:443
<VirtualHost *:443>
  SSLEngine on
  SSLProxyEngine On
  ServerName yourhostname.com
  ProxyPass / https://yourserver/
  ProxyPassReverse / https://yourserver/
  SSLCertificateFile /etc/httpd/conf.d/ca.crt
  SSLCertificateKeyFile /etc/httpd/conf.d/ca.key
</VirtualHost>
Reivew:
httpd -S
Restart:
service httpd restart
Check for errors:
tail /var/log/httpd/ssl_error_log

Install node.js on AWS CentOs

[ec2-user@ip-0-0-0-0 ~]$ sudo su
[root@ip-0-0-0-0 ec2-user]# curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -
[root@ip-0-0-0-0 ec2-user]# yum install -y install nodejs


From: https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora

Sunday, February 28, 2016

JQuery Search Filter Plugins

This is an interesting piece about UI design for a rule builder:
It lead me to find these jQuery projects related to structured filtering and search:
And some others ideas related to search:

Sunday, December 6, 2015

PDF to Images and Text

For a while now I have extracted text from financial statements and imported it into Excel for further accounting. The statements are PDF documents and until recently it was relatively easy to use the Adobe Reader "Save as Text..." feature to save the text content.  For my latest statement this didn't work. It appears the PDF documents no longer contain "text", but rather vector paths are to render the text instead. I have no idea why they decided to change the format?!

Anyway, to deal with this new format I had to change my approach for getting the data into Excel. With the help of this page Tutorial: Command-line OCR on a Mac I was able to build a process to do the following:
  1. Use pdftk to burst the multi-page PDF into single-page files.
  2. Use inkscape to convert each page into a PNG file.
  3. Use Tesseract to OCR these image files into text.
  4. Extract and format the text files for import into Excel.
Note that at the time of writing there are some issues running pdftk the latest version of OS X. Fortunately this has been fixed as detailed in this post: PDFtk Server on OS X 10.11.

Saturday, November 21, 2015

GPS Maps from Windows to Mac

GPS maps may come as windows ".exe" file that can be used to install the maps on a Windows OS. Once installed it's quite easy to convert them to the ".gmapi" format needed for Mac OS.

So, here is how I converted the ".exe" maps to ".gmapi" file for Mac OS:

- Using a Virtual Box with a Windows XP image, run the maps.exe file to install the BaseCamp/MapSource maps. Note that MapSource/BaseCamp don't actually need to be installed.

- Download and install the Garmin MapConverter from: http://www8.garmin.com/support/download_details.jsp?id=3897. Note that to run the MapConverter, I also needed to install MS Visual C++ from: http://www.microsoft.com/en-us/download/details.aspx?id=5638

- Run MapConverter to generate the maps.gmapi file/folder. Copy the folder to the Mac and double click to open it in MapManager and install the maps.

The maps should now be accessible in  BaseCamp and available to MapManager. This is especially useful when you want to load and SD card with a specific set of maps.

Note that  GPS maps often come as a single Garmin ".img" file that is intended to be loaded directly onto a GPS device. While BaseCamp can read these files from a mounted SD card, disk image, or GPS device, only maps that you have "installed" on your computer will show up in MapManager and be accessible to MapInstall. I have found no easy way to convert or load ".img" files to "installed" maps.

Friday, November 20, 2015

Raspberry Pi Camera Commands

Useful commands to get started:

To take a photo:

raspistill -o cam.jpg

From the documentation.

To save a 5 second raw h264 encoded video file:

raspivid -o vid.h264

From RASPICAM Commands.

To wrap it in an mp4 from easier playback:

sudo apt-get install gpac MP4Box -add vid.h264 vid.mp4 

From this post.

Sunday, November 1, 2015

Raspberry Pi SD Card Not Booting

If you connect the power and the red power light turns on, but the green activity light does not flash it means the SD card isn't booting. If the card if setup correctly, it maybe a bad connection between the card and the holder. Try applying pressure to the card while reconnecting the power to see if the activity light flashes green.

If your SD card is loose, try applying a few layers of tape to the top of the card and carefully reinserting it into the slot. The tape may add enough pressure to improve the SD card connection.

Saturday, July 25, 2015

Mac Color Syntax in Vi

Add the following to your ~/.vimrc file:

type plugin indent on 
syntax on 
 
Next time you open a file using vi, syntax colors will be used.

 

Thursday, May 7, 2015

Search bash History for All Users

To search bash history for all users, for a given command:

find /home/ -name .bash_history -type f -exec grep -H $cmd {} \; | more 

Thursday, April 9, 2015

Firefox Console XPath Query

To find a page element using an xpath from the Firefox (Firebug) console, use:

$x("//your/path/here")

Sunday, March 22, 2015

Windows 7 Custom Text Size

To set a Custom text size in Windows 7, open Control Panel -> Display -> Set custom text size (DPI), and drag the scale.


Sunday, March 15, 2015

CT30 Thermostat Wifi Setup

This was harder than it should be. The process that finally worked was something like this:

- Disable cellular data on iPhone
- Forget wireless network on iPhone
- Press the Menu button on thermostat, press Mate twice, ensure yellow light is flashing
- Connect to thermostat wifi network on iPhone
- Go to http://192.168.10.1/ in browser on iPhone
- Follow the 5 steps and enter requested details: wifi network, wifi password, provisioning code
- If you're lucky, the thermostat chirps and then green light flashes

It seemed like the iPhone had trouble staying on the thermostats network and the provisioning process kept timing out.

I had a lot of trouble getting the browser to connect, for more details, see this FAQ: