How to Chop an Onion

Chopping an onion is not a difficult task in the kitchen, if you know the right way to do it. Watch this video where the master, Gordon Ramsay, shows us how it's done.

Practice this method and you will be chopping onions well in no time, without the crying.

AWS CloudFront SSL Install

Using the Amazon CoudFront as a CDN is a great way to accelerate your website. If you run with HTTPS enabled, you will also want to reference the files you have hosted on CloudFront over HTTPS to avoid error messages from the web browser. You can install an SSL certificate of your own onto the CloudFront edge servers very easily by following the process below.

Prerequisite: Install the AWS CLI following these instructions

  1. Upload New Certificate and CA Bundle

    [root@www2 jross.org]# aws iam upload-server-certificate --path=/cloudfront/ --server-certificate-name jross.org-20150929 --certificate-body file://jross.org-20150929.crt --certificate-chain file://jross.org-20150929.ca-bundle --private-key file://jross.org-20150929.key
    

    The AWS API will repond with a JSON blob describing the new certificate that was installed.

    "ServerCertificateMetadata": {
        "ServerCertificateId": "ASCAIAL7ABZ47NPIXXDG6",
        "ServerCertificateName": "jross.org-20150929",
        "Expiration": "2016-10-12T23:59:59Z",
        "Path": "/cloudfront/",
        "Arn": "arn:aws:iam::116215659343:server-certificate/cloudfront/jross.org-20150929",
        "UploadDate": "2015-10-09T18:03:10.749Z"
    }
    
  2. Switch CloudFront to the NEW Certificate using the WebConsole. This will take a while to take effect as the certificate needs to propagate to all AWS CloudFront edge servers.

The Never Ending Curly Bracket War

Apparently some programmers get pretty pissed off about this.

I say whatever makes your brackets curly, go with it. Just be consistent about it and don't go around changing someones code.

Remember: Last one to touch it gets blamed for all the bugs!

Clearing UNC Hard Disk Errors

One of the advantages of running a Linux RAID configuration is that it simplifies clearing of UNC errors on your hard disks. If you have such a setup, you may follow the process below to clear the UNC errors from your disk and extends it's life a bit longer. The example here is for a RAID 1 configuration, but any RAID level will do (besides RAID 0).

Determine the disk (X) with the errors using smartctl

smartctl -A /dev/sda
smartctl -A /dev/sdb

Determine the LBA where the first error was found

smartctl -a /dev/sdX

Determine the partition (Y) that contains the LBA

sfdisk -l -uS /dev/sdX

Do not continue this process if there are excessive errors (80 or more).  Replace the disk immediately.

Determine the RAID array (Z) that the partition belongs to

cat /proc/mdstat

Fail and remove the partition from the RAID

mdadm /dev/mdZ --fail /dev/sdXY
mdadm /dev/mdZ --remove /dev/sdXY

You must zero the superblocks on the partition to allow a proper remirror

mdadm --zero-superblock /dev/sdXY

Re-add the partition to the RAID to initiate the remirror

mdadm /dev/mdZ --add /dev/sdXY

Monitor the remirror progress.  When complete, review smartctl to see if the errors are gone.

  • If errors are still there, confirm you have been working with the correct partition
  • If all errors cannot be cleared, replace the disk.

When all errors are cleared, run a long SMART test to confirm disk is healthy.

smartctl -t long /dev/sdX

It should complete without any read errors.

  • If more errors are found.  Repeat the process above.
  • Do not repeat the process any more than 2 times.  The drive is unhealthy at this point and should be replaced.
  • Do not repeat the process if there are excessive errors (80 or more).

CUPS Command Reference

Show Printing System Status

lpstat -t

Show Queue Status

lpq -Plaser101

Create a PostScript Laser Printer Queue

lpadmin -p office-printer-1 -v lpd://office-printer-1/lp -m postscript.ppd.gz -E

Create a JetDirect Socket Queue

lpadmin -p office-printer-1-v socket://office-printer-1:9100 -m postscript.ppd.gz -E

Remove a Printer Queue

lpadmin -x office-printer-1

Set Default Printer Queue

lpadmin -d office-printer-1

Pause / Unpause a Printer Queue

cupsdisable office-printer-1       // disables printer
cupsenable office-printer-1        // unpause printer
reject office-printer-1            // no new jobs accepted
accept office-printer-1            // if lpstat says that no jobs are being accepted

Cancel Print Jobs

cancel 33                          // Job number 33 canceled
cancel -a office-printer-1         // All jobs for office-printer-1 are canceled
lpmove 33 office-printer-2         // Job 33 moved to office-printer-2

Redirect Printing

lpadmin -p office-printer-1 -v lpd://office-printer-2/lp

Drone Technology

The following information was gathered during the 2016 DetroitDevDay Conference held at United Shore in Troy, MI on November 12, 2016. The speaker for this topic was Godfrey Nolan of RIIS.


Current Applications

Drones are expected to become very popular in professional applications over the next five years. Some industries which are seeing rapid growth are:

  • Agriculture
  • Surveying
  • Search and Rescue

There are even companies using them to capture some really awesome footage. Check out this video of the United Shore 2016 Rally:


Some companies are using drones to make healthcare more accessible. Check out Zipline. They are using drones to deliver medicine to rural areas of Africa.



Development and Open Source

Now this was a conference for developers, so of course it was pointed out that you can hack and develop code for these devices. There are some companies out there creating great drones for $1000 (DJI) and others for even less (about $500). These cheaper drones are made by companies like Yuneec and 3DR.

What makes Yuneec and 3DR special is that their drones are built using Drone Code which is an open sourece UAV platform. This means that as a developer, you don't need to right any core flight code. This is all done for you. All you need to focus on is the front end modile app that will control the drone in some way.

Now, some security issues to keep in mind:

Everything is RF, so it can be sniffed and decoded, especially if it is WiFi. So don't hard code usernames or passwords. You could end up getting your drone hijacked.

3DR has a "hello drone" tutorial to get you started. There are also several apps out there to give you an idea about what you can do with this platform.



Restrictions

Make sure you register your drone with the FAA. You should also check HiveMapper to be sure you're not flying where you shouldn't be. This is also a great site to get an idea of the landscape before you fly. Generally, you should not fly within 5 miles of an airport. If it is a small airport, it might be OK if you call them first to ask.

HP ProCurve CLI Reference

Configurations

Show Running Configuration
    • procurve1# write terminal

Save Running Config to Startup Config
    • procurve1# write memory

Show Mac-Address, Port, and VLAN
    • procurve1(config)# show mac-address

Show Port Descriptions
    • procurve1# show name 

Show Port State & Status
    • procurve1# show interfaces brief

Show port errors and dropped packets
    • procurve1# show interfaces port

VLANs

Add Port to VLAN
    • procurve1(config)# vlan vlanID
    • procurve1(vlan-ID)# untagged port#

Remove Port from VLAN
    • procurve1(config)# vlan vlanID
    • procurve1(vlan-ID)# no untagged port#

Basic Port Commands

Disable Port
    • procurve1(config)# interface port
    • procurve1(eth-port)# disable 

Enable Port
    • procurve1(config)# interface port
    • procurve1(eth-port)# enable

Set Port Description
    • procurve1(config)# interface port
    • procurve1(eth-port)# name Laser101

Remove Port Description
    • procurve1(config)# interface port
    • procurve1(eth-port)# no name