Generate some easy to remember passwords

Do not use this for sending sensitive data! For that please use a public key encryption scheme like PGP or GnuPG. This below is suitable for things such as online logins etc.

Obtain word list

Prepare a text file with dictionary words. Here we download some word lists from Scowl.

wget "http://downloads.sourceforge.net/wordlist/scowl-2016.01.19.tar.gz" && \
tar -zxvf scowl-2016.01.19.tar.gz --wildcards --strip-components=2 scowl-2016.01.19/final/english-words.*

We grab the file english-words.10 and english-words.20 which contain a lot of popular words, filter it and remove the words we don’t want. There are other files here too which you can use as well, though they may contain less commonly used words which may be more difficult to remember.

To make a word list from english-words.10 and english-words.20 with 5 chars or more

cat english-words.10 english-words.20 | grep -v "'" | grep -e "....." | uniq | xz -9 -e > words.txt.xz

On Mac OSX, you’ll need to set LANG=C otherwise you’ll get a charset error with uniq.

Count the number of words in the list. For my current test, there is 9481 words.

xz -dc words.txt.xz | wc -l

Generate a 4 word password

Let’s random sort and create a password with 4 words. We’ll capitalise the first letter as well.

On Mac OSX, install coreutils and gnu-sed on Homebrew.

Linux

xz -dc words.txt.xz | sort -R | head -n 4 | sed 's/^\(.\)/\U\1/' | tr -d '\n'

Mac

xz -dc words.txt.xz | gsort -R | head -n 4 | gsed 's/^\(.\)/\U\1/' | tr -d '\n'

Make 10 random 4 word passwords

The above command repeated 10 times.

Linux

for i in {0..9}; do xz -dc words.txt.xz | sort -R | head -n 4 | sed 's/^\(.\)/\U\1/' | tr -d '\n'; echo ""; done

Generate 10 random 3 word passwords

Make 10 random 3 word passwords

Linux

for i in {0..9}; do xz -dc words.txt.xz | sort -R | head -n 3 | sed 's/^\(.\)/\U\1/' | tr -d '\n'; echo ""; done

Mac

for i in {0..9}; do xz -dc words.txt.xz | gsort -R | head -n 3 | gsed 's/^\(.\)/\U\1/' | tr -d '\n'; echo ""; done

How to open Gerber files in AutoCAD with free open source tools

Here is a method for how you can import a Gerber RS-274X file into AutoCAD. There are many commercial software solutions to perform this, but this is how you can do it for free using open source tools!

You’ll need to install and configure (if needed) the following software.

  • gerbv – this is used to view Gerber files, and can also export to a variety of formats (but not DXF or DWG for AutoCAD)
  • pstoedit – converts Postscript files to many different other formats
  • ghostscript – needed by pstoedit

Open your Gerber files in gerbv. This process work for multiple layers as well. You should see your Gerber to make sure it is what it should be.

Export the Gerber set to PostScript. File -> Export -> Postscript…

Optionally, if you don’t need to visually check the Gerber file in gerbv, gerbv supports exporting via the command line, for example:

gerbv -x ps MYGERBER.GTL

Now convert the Postscript (.ps) file to DXF using pstoedit. This is best done on the command line.

pstoedit -f dxf foobar.ps foobar.dxf

Now you should have a .dxf file which you can open in AutoCAD.

Caveats

When working with multiple Gerber files and you export them all at once to one .ps file, and convert them to a single .dxf, all the information comes up in AutoCAD as a single layer, but the original layers can be differentiated by their colours.

However you could manually move different colours to new layers if need be (using QSELECT command in AutoCAD). This probably could be scripted, but that’s a bit beyond my means at the moment.

GLCD Library Support for PIC24H with ST7565R / ST7565P / PCD8544 (Nokia 3310 5510) LCDs

My graphic LCD library (glcd on GitHub) now supports PIC24H with the ST7565R, ST7565P and PCD8544 LCD controllers.

The code has been tested with the Newhaven display NHD-C12864A1Z-FSW-FBW-HTT and NHD-C12832A1Z-FSW-FBW-3V3. I used a Microstick II development board to test these, with demo code available below. I don’t have any PIC24F chips so I wasn’t able to test it with those chips as well (I think I have lost the chip from the Microstick II package). I would think only minor changes would be needed to make it work with PIC24F.

Sample code

Sample code for use with MPLAB X IDE.

Here are some sample projects:

Note that the glcd libraries included with the demos above are not kept up to date as further updates are made to the official glcd library. You can update the library by copying the latest glcd distribution into the existing project files. (take note of custom pin configurations, more details below)

Pin configuration

With the projects above, the pin connections to the LCD’s SPI interface are as follows:

  • SDA (serial data input) => RB14
  • SCK (serial clock) => RB15
  • SS / CS (chip select) => RB2
  • A0 (command / data write selection) => RB3
  • RESET => RA2

To add your own custom pin configuration, you can edit the file ‘devices/PIC24H.h’. You can also make a custom configuration file by creating a `glcd_user_config.h’ file outside of the glcd directory and defining a new compiler symbol ‘GLCD_USER_CONFIG’. Copy the contents of ‘PIC24H.h’ into it. This way, if you need to  update the library, you can simply overwrite the contents of the existing glcd directory without losing your custom pin configuration. Otherwise, you can just keep track yourself of custom changes made to the *.h files in the ‘devices/’ directory.

Videos

Footage of Newhaven Display NHD-C12864A1Z-FSW-FBW-HTT in action, running the sample code:

Footage of Newhaven Display NHD-C12832A1Z-FSW-FBW-3V3 in action, running the sample code:

Shutter Actuation Count using gPhoto2

This method can be used to obtain the shutter actuation count on the following cameras:

  • Canon 1D Mark II
  • Canon 50D
  • Canon 5D Mark II
  • Canon 5D Mark III
  • Canon 7D
  • Canon T2i

There may be a few other compatible cameras too. Let me know if you have confirmed another model which works using this method.

Jump to instructions for: Mac | Linux | Windows

Mac OS X

gPhoto2 can be installed using MacPorts or Homebrew. This is how to do it using MacPorts. You’ll need to be connected to the internet while you do this.

  1. Install XCode Developer Tools for your version of OS X from the Apple Developer web site. Skip this if you already have it installed.
  2. Visit the MacPorts web site and download the .pkg installer. Run the installer and follow the instructions and install it to your computer.
  3. Open the Terminal.
  4. Update macports if needed, by running the command sudo port -v selfupdate
  5. Install the gphoto2 package by running the command sudo port install gphoto2
  6. Test whether gphoto2 is properly installed by typing gphoto2 --version
  7. Connect your camera to the USB port, using a USB cable
  8. Wait a few seconds after connecting your camera, and type killall PTPCamera – every time you replug your camera to the computer, you’ll need to type this before using gphoto2. This is needed, to kill any running processes connected to the USB device.
  9. To check the number of actuations, on the attached camera, type gphoto2 --get-config /main/status/shuttercounter
  10. If your camera is compatible, the shutter actuation count will be displayed.

Linux

Install gPhoto2 using package manager of our distribution.

For Centos, RHEL and other distributions which use the yum package manager:

yum install gphoto2

For Debian, Ubuntu and other distributions which use the apt package manager:

apt-get install gphoto2

Some Linux distributions may not have gphoto2 as precompiled package in which case you’ll need to download and compile it from source.

Windows

Using a LiveCD

This is the simplest way for non tech heads. Download the live CD, I have created and write it to a CD or DVD. You can do this by right clicking on the ISO file in Windows Explorer and selecting “Burn disc image”.

Reboot your computer boot from the CD. To boot your computer from a CD, there is usually key you can press to change the boot device (e.g F12). This usually flashes up on the monitor when it boots up.

Alternatively, you can enter the BIOS settings and change the boot order, and set the CD/DVD drive as the first device.

Once you have rebooted, it should start up in Debian (on the live CD), and a command prompt will be shown along with a message.

live_cdPlug the camera into the computer using a USB cord, some messages may be displayed on scren as you do this. You can check whether the computer has detected the camera by typing dmesg.

To check shutter count, type shuttercounter, to read camera information, you can type camerainfo, this will display information such as the camera’s serial number. These commands shortcuts to the gphoto2 program. You can also run all other gphoto2 commands if needed. See the full features by typing man gphoto2.

Using a Virtual Machine

If you have experience using virtualisation software such as Virtualbox or VMWare Workstation, then another way is to install or use an existing virtual Linux installation of your choice. Install gphoto2 from inside the virtual machine.