[{"content":"I am a big fan of HomeKit and Apple\u0026rsquo;s effort to have one central app to control smart home devices. While it has its flaws and limitations, the main value for my household is simply that all of my smart home accessories are centralized in Apple\u0026rsquo;s Home app. I don\u0026rsquo;t need to install anything on family members\u0026rsquo; phones, and it minimizes tech support from me.\nThe one thing that was not natively available through HomeKit was my garage door opener. I used meross with HomeKit for a few months, but I was having reliability issues with flaky wifi, and it required using a door sensor, which was also unreliable when wind would move the gate just enough to trip the sensor. A better option would have been ratgdo, but I really wanted a wired network connection. That\u0026rsquo;s when I settled on the LiftMaster 828LM internet gateway.\nFor a while, I was content using the 828LM with the homebridge-myq plugin, but it has since been deprecated due to myQ locking down its API. That forced me to use the myQ mobile app, which is really just a canvas to shove ads into. It\u0026rsquo;s pretty slow to load and can\u0026rsquo;t do any automation with HomeKit.\nHardware The 828LM is a simple appliance that connects to the network over Ethernet and communicates with compatible garage-door and gate operators over RF in the 900 MHz band using the myQ protocol. The MCU is a PIC18F67J60 with 128 KiB of program flash and 3,808 bytes of RAM. It handles the network stack and controls a Si4432 radio for RF communication. For storage, there is a 32 Kbit (4 KiB) 25AA320A EEPROM chip and a 4 Mbit (512 KiB) SST25VF040B flash chip on the reverse side.\nLiftMaster 828LM Internet Gateway\nBoard with visible chips: center PIC18F67J60 MCU, left center EEPROM, and left Si4432 radio\nMy first attempt was to talk to the device directly over the network, but there were no open ports to do anything useful. Capturing TCP packets also yielded little value since the connection is over TLS.\nDumping the firmware The board\u0026rsquo;s J2 header block can be used for programming the MCU. I soldered pin headers to make this more accessible. After tracing the pins to the MCU legs, I needed a programmer to read it. One option is Microchip\u0026rsquo;s PICkit 5 programmer, but I didn\u0026rsquo;t want to spend any money on new hardware, so instead I spent orders of magnitude more on tokens to build a Flipper Zero app that can read and write the PIC18F67J60, using the datasheet as a reference.\nJ2 header pins connected to the Flipper\u0026rsquo;s GPIO\nDumping the firmware was straightforward, though I expected it to be blocked by the chip\u0026rsquo;s code protection. To my surprise, the code protection was not enabled, and the firmware was successfully dumped intact.\nFailed reverse engineering attempts My initial goal was to decompile and reverse engineer the firmware so that I could enable LAN access directly, eliminate the need for myQ\u0026rsquo;s cloud service, never have to see another myQ ad, and keep my data private. Reverse engineering binary dumps is way easier now with LLMs, but this 8-bit MCU with a Harvard architecture proved to be especially tricky.\nThe plan was to rewrite the network stack to interface with my own server and keep the RF stack and behavior identical to the stock firmware. I was able to get a basic HTTP server up and running, but the RF stack turned out to be a dead end, mostly due to my complete lack of expertise with RF, which made me a blind guide for Opus 4.8 (the best model at the time).\nAfter several attempts at reconstructing the C code, I eventually changed the strategy to leave the firmware as is and instead write my own MQTT service to talk to the 828LM. The device uses TLS with a pre-shared key, which is baked into the firmware. The previous work with trying to reconstruct source code uncovered the PSK, letting me decrypt and inspect the traffic and giving me a path forward to building a minimal MQTT server and bypassing the cloud service altogether.\nHomebridge plugin With the goal of HomeKit compatibility, I went down the path of building a Homebridge plugin. The plugin serves as the minimal MQTT server for the 828LM, translates HomeKit commands into gateway commands, and reports state changes back to HomeKit.\nWhat I used:\n828LM stock firmware PSK extracted from the binary dump Local DNS override for the 828LM\u0026rsquo;s cloud hostname (connect-0.cloud.myqdevice.com) to resolve to my Homebridge server on my LAN MQTT service The gateway uses MQTT 3.1.1 over TLS 1.2 on port 8883. The plugin implements the server behavior the gateway expects, including connection acknowledgment, subscriptions, keepalives, and the application messages carried in MQTT publications.\nThe gateway initiates its usual connection, but reaches out to my local Homebridge server instead of the cloud service.\nTo reverse engineer the 828LM MQTT protocol, I built a quick and dirty debug panel so I can see the messages passed back and forth between the plugin and the 828LM gateway. It was invaluable to have an explainer for the binary payloads as I learned more about the protocol. The ratgdo project was my primary reference for much of the payload decoding. The wired and RF protocols share enough Security+ 2.0 concepts and payload structure for it to be valuable.\nDebug panel in Codex green showing traffic between the plugin and the gateway. Identifiers replaced for privacy.\nCommands to the gateway use topics under G/{gateway_id}/…; reports from it use S/01/{gateway_id}/…. For example:\nPurpose Topic Payload Query paired operators G/{gateway_id}/013/0008 Empty Return paired operators S/01/{gateway_id}/014/0008 Consecutive six-byte operator IDs Send a command G/{gateway_id}/011/0000 Operator ID followed by command bytes Report opener status S/01/{gateway_id}/011/0000 Operator ID followed by status bytes Other observations The PIC18F MCU is cheap and limited in capabilities. The application payloads use compact binary data instead of JSON, which is quite elegant at the expense of human readability.\nAll of the myQ enabled openers I experimented with broadcast a heartbeat over RF every 5 minutes. The status report includes a 3-byte status field: door state, light state, obstruction sensor state, remote lockout state, and learn mode state. This helps keep the door state current in the Home app in case an initial open/close message gets missed.\nSince all network calls are done locally on my network, the plugin feels much faster than the original homebridge-myq plugin, which relied on the reverse-engineered web APIs. Tapping open/close on my garage door in the Home app feels instant (1-2 seconds), not quite as fast as using the garage door remote, but pretty darn close.\nPlugin current state The project has reached a useful point for my personal use as a local Homebridge integration around the existing 828LM firmware. I have not published the plugin in the official Homebridge plugin directory, but may pick this up again if there is any interest.\nMy goal of eliminating the need for the myQ app was successful. The plugin supports opening and closing, and reports sensor and door obstruction conditions to HomeKit. The clunkier bits are in new device onboarding where pairing a garage door with the gateway needs to be done through the debug panel.\nFuture work It would be awesome to have standalone HomeKit support directly on the 828LM, but the MCU\u0026rsquo;s limited RAM and program storage, along with the lack of dedicated crypto support, would make that a difficult if not impossible fit. Realistically, a custom board with a more capable MCU would probably be necessary. A nice hardware project for another time.\n","permalink":"https://bciuca.com/blog/homekit-enabled-myq-gateway/","summary":"\u003cp\u003eI am a big fan of HomeKit and Apple\u0026rsquo;s effort to have one central app to control smart home devices. While it has its flaws and limitations, the main value for my household is simply that all of my smart home accessories are centralized in Apple\u0026rsquo;s Home app. I don\u0026rsquo;t need to install anything on family members\u0026rsquo; phones, and it minimizes tech support from me.\u003c/p\u003e\n\u003cp\u003eThe one thing that was not natively available through HomeKit was my garage door opener. I used \u003ca href=\"https://www.amazon.com/dp/B084Z5QZR2\"\u003emeross\u003c/a\u003e with HomeKit for a few months, but I was having reliability issues with flaky wifi, and it required using a door sensor, which was also unreliable when wind would move the gate just enough to trip the sensor. A better option would have been \u003ca href=\"https://github.com/ratgdo\"\u003eratgdo\u003c/a\u003e, but I really wanted a wired network connection. That\u0026rsquo;s when I settled on the LiftMaster 828LM internet gateway.\u003c/p\u003e","title":"HomeKit enabled myQ Gateway"},{"content":"# Disk Backup Create a disk image of the SD card using Mac OS X.\nConnect the SD disk to the host machine and search for the disk, diskutil list.\nbubbamac:~ bubba$ diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *256.1 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_HFS OSX SSD 255.2 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *3.9 GB disk1 1: WINDOWS_FAT_32 BOOT 62.9 MB disk1s1 2: Linux 33.6 MB disk1s2 The disk to be cloned is /dev/disk1. Initialize the clone by specifying the source disk and destination file.\nsudo dd if=/dev/disk1 of=~/Desktop/2014-06-14_raspi.dmg The imaging process takes some time (about 20 min for 4GB). The command line tool does not have a progress indicator, but will display a success message when complete.\n# Writing the Disk Image Insert the destination SD card. Using diskutil list, find the destination card.\nUnmount the card.\ndiskutil unmountDisk /dev/disk1 Format the card. sudo newfs_msdos -F 16 /dev/disk1 Similar to the disk image creation, specify the source and destination for the image. sudo dd if=~/Desktop/2014-06-14_raspi.dmg of=/dev/disk1 Writing the image to the card will take a lot longer than it did to create the image. It will probably take a few hours to complete.\n","permalink":"https://bciuca.com/2014/06/14/2-raspberrypi-backup/","summary":"\u003ch1 id=\"-disk-backup\"\u003e# Disk Backup\u003c/h1\u003e\n\u003cp\u003eCreate a disk image of the SD card using Mac OS X.\u003c/p\u003e\n\u003cp\u003eConnect the SD disk to the host machine and search for the disk, \u003ccode\u003ediskutil list\u003c/code\u003e.\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003ebubbamac:~ bubba$ diskutil list\n    /dev/disk0\n       #:                       TYPE NAME                    SIZE       IDENTIFIER\n       0:      GUID_partition_scheme                        *256.1 GB   disk0\n       1:                        EFI EFI                     209.7 MB   disk0s1\n       2:                  Apple_HFS OSX SSD                 255.2 GB   disk0s2\n       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3\n    /dev/disk1\n       #:                       TYPE NAME                    SIZE       IDENTIFIER\n       0:     FDisk_partition_scheme                        *3.9 GB     disk1\n       1:                WINDOWS_FAT_32 BOOT                 62.9 MB    disk1s1\n       2:                       Linux                        33.6 MB    disk1s2\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eThe disk to be cloned is \u003ccode\u003e/dev/disk1\u003c/code\u003e. Initialize the clone by specifying the source disk and destination file.\u003c/p\u003e","title":"Raspberry Pi Backup"},{"content":"# Enable RSA Authentication For convenience and security, turn on RSA authentication in sshd.\nsudo vim /etc/ssh/sshd_config ","permalink":"https://bciuca.com/2014/06/14/3-raspberrypi-ssh/","summary":"\u003ch1 id=\"-enable-rsa-authentication\"\u003e# Enable RSA Authentication\u003c/h1\u003e\n\u003cp\u003eFor convenience and security, turn on RSA authentication in \u003ccode\u003esshd\u003c/code\u003e.\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003esudo vim /etc/ssh/sshd_config\n\u003c/code\u003e\u003c/pre\u003e","title":"Raspberry Pi SSH Configuration"},{"content":"# Installation Before beginning, make sure your device is updated.\nsudo apt-get update sudo apt-get upgrade # Verify USB Device This guide is based on the Edimax USB wireless adapter. With the Raspberry Pi turned on and booted, plug in the wireless module. Check for USB devices using lsusb.\npi@raspberrypi:~$ lsusb Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] pi@Rasputin:~$ Verify that the kernel module was loaded, lsmod. Module 8192cu should be in the list. If the USB device is not seen in theses, try unplugging the wireless adapter and plugging it back in to reinitialize it. Otherwise, try rebooting.\npi@raspberrypi:~$ lsmod Module Size Used by rfcomm 33132 0 bluetooth 225849 10 bnep,rfcomm rfkill 19567 2 bluetooth snd_bcm2835 18169 0 snd_soc_bcm2708_i2s 5486 0 regmap_mmio 2818 1 snd_soc_bcm2708_i2s snd_soc_core 128166 1 snd_soc_bcm2708_i2s regmap_spi 1913 1 snd_soc_core snd_pcm_dmaengine 5481 1 snd_soc_core snd_pcm 81518 3 snd_bcm2835,snd_soc_core,snd_pcm_dmaengine snd_page_alloc 5168 1 snd_pcm regmap_i2c 1657 1 snd_soc_core snd_compress 8136 1 snd_soc_core 8192cu 551136 0 Using the iwconfig command, check that the wireless network configuration exists. This command will be used again to verify connection to the network.\npi@raspberrypi:~$ iwconfig wlan0 unassociated Nickname:\u0026quot;\u0026lt;WIFI@REALTEK\u0026gt;\u0026quot; Mode:Managed Frequency:2.462 GHz Access Point: 02:00:00:00:02:01 Bit Rate:72.2 Mb/s Sensitivity:0/0 Retry:off RTS thr:off Fragment thr:off Power Management:off Link Quality=100/100 Signal level=67/100 Noise level=0/100 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 lo no wireless extensions. eth0 no wireless extensions. # Configuration # Network Configuration Edit the network configuration file /etc/network/interfaces (use sudo vim or another text editor).\n# local network loopback auto lo iface lo inet loopback # LAN settings auto eth0 allow-hotplug eth0 iface eth0 inet dhcp # WAN settings auto wlan0 allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp The auto wlan0 and allow-hotplug wlan0 are needed to start the wireless device on boot. It also connects to a network automatically when the USB adapter is first plugged in.\nThe configuration above used DHCP for both LAN and WAN configuration. To set a static IP replace the iface default inet dhcp setting for the adapter.\niface default inet static address 10.0.0.10 netmask 255.255.255.0 network 10.0.0.0 gateway 10.0.0.1 # Wireless Network Configuration The /etc/wpa_supplicant/wpa_supplicant.conf configuration file is used to connect to a wireless network. SSID, encryption protocol, pass key, and other settings are set here. The configuration below was used for WPA2 protocol.\nnetwork={ ssid=\u0026quot;MYSSID\u0026quot; proto=RSN key_mgmt=WPA-PSK pairwise=CCMP TKIP group=CCMP TKIP psk=\u0026quot;MYPASSKEY\u0026quot; } Restart the adapter. Most likely it will be up, so bring it down then up again. sudo ifdown wlan0 sudo ifup wlan0 There may be some error messages, which is normal. sudo ifup wlan0 ioctl[SIOCSIWAP]: Operation not permitted ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument # Checking the Connection Use the ifconfig wlan0 to check that you are connected.\npi@Rasputin:~$ ifconfig wlan0 wlan0 Link encap:Ethernet HWaddr 02:00:00:00:02:02 inet addr:10.0.0.12 Bcast:10.0.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2583 errors:0 dropped:12 overruns:0 frame:0 TX packets:714 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:428510 (418.4 KiB) TX bytes:104111 (101.6 KiB) `iwconfig` will display the wireless network configuration. pi@raspberrypi:~$ iwconfig wlan0 IEEE 802.11bgn ESSID:\u0026quot;MYSSID\u0026quot; Nickname:\u0026quot;\u0026lt;WIFI@REALTEK\u0026gt;\u0026quot; Mode:Managed Frequency:2.462 GHz Access Point: 02:00:00:00:02:01 Bit Rate:72.2 Mb/s Sensitivity:0/0 Retry:off RTS thr:off Fragment thr:off Power Management:off Link Quality=100/100 Signal level=68/100 Noise level=0/100 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 lo no wireless extensions. eth0 no wireless extensions. ","permalink":"https://bciuca.com/2014/06/14/raspberrypi-wifi/","summary":"\u003ch1 id=\"-installation\"\u003e# Installation\u003c/h1\u003e\n\u003cp\u003eBefore beginning, make sure your device is updated.\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003esudo apt-get update\nsudo apt-get upgrade\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch2 id=\"-verify-usb-device\"\u003e# Verify USB Device\u003c/h2\u003e\n\u003cp\u003eThis guide is based on the \u003ca href=\"http://amzn.to/1qPwB9B\"\u003eEdimax\u003c/a\u003e USB wireless adapter. With the Raspberry Pi turned on and booted, plug in the wireless module.\nCheck for USB devices using \u003ccode\u003elsusb\u003c/code\u003e.\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003epi@raspberrypi:~$ lsusb\nBus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.\nBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\nBus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.\nBus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]\npi@Rasputin:~$\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eVerify that the kernel module was loaded, \u003ccode\u003elsmod\u003c/code\u003e. Module \u003ccode\u003e8192cu\u003c/code\u003e should be in the list. If the USB device is not seen in theses, try unplugging the wireless adapter and plugging it back in to reinitialize it. Otherwise, try rebooting.\u003c/p\u003e","title":"Raspberry Pi Wireless Network Setup"},{"content":"# Setting up Bluetooth Plug in USB dongle and using the command lsusb to get a list of connected devices.\npi@raspberrypi:~$ lsusb Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) Install USB software:\nsudo apt-get install bluetooth bluez-utils blueman Check for bluetooth status\n/etc/init.d/bluetooth status Scan for devices\npi@raspberrypi:~$ hcitool scan Scanning ... 02:00:00:00:01:01\tMyPC Ping device to check resonse times\npi@raspberrypi:~$ sudo l2ping 02:00:00:00:01:01 Ping: 02:00:00:00:01:01 from 02:00:00:00:01:02 (data size 44) ... 44 bytes from 02:00:00:00:01:01 id 0 time 18.21ms 44 bytes from 02:00:00:00:01:01 id 1 time 73.55ms 44 bytes from 02:00:00:00:01:01 id 2 time 20.72ms 44 bytes from 02:00:00:00:01:01 id 3 time 16.76ms 44 bytes from 02:00:00:00:01:01 id 4 time 32.01ms 44 bytes from 02:00:00:00:01:01 id 5 time 17.67ms 44 bytes from 02:00:00:00:01:01 id 6 time 34.67ms 44 bytes from 02:00:00:00:01:01 id 7 time 18.65ms 44 bytes from 02:00:00:00:01:01 id 8 time 12.76ms 44 bytes from 02:00:00:00:01:01 id 9 time 12.60ms 44 bytes from 02:00:00:00:01:01 id 10 time 13.67ms Pair\nsudo bluez-simple-agent hci0 02:00:00:00:01:03 Add device to trusted list.\nsudo bluez-test-device trusted 02:00:00:00:01:03 yes Set discoverable\nsudo hciconfig hci0 piscan ","permalink":"https://bciuca.com/2014/06/10/raspberrypi-bluetooth/","summary":"\u003ch1 id=\"-setting-up-bluetooth\"\u003e# Setting up Bluetooth\u003c/h1\u003e\n\u003cp\u003ePlug in USB dongle and using the command \u003ccode\u003elsusb\u003c/code\u003e to get a list of connected devices.\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003epi@raspberrypi:~$ lsusb\nBus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.\nBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\nBus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.\nBus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eInstall USB software:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e sudo apt-get install bluetooth bluez-utils blueman\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eCheck for bluetooth status\u003c/p\u003e","title":"Raspberry Pi Bluetooth setup"},{"content":"Prerequisites Raspberry Pi (Model B) 8GB SD card (class 4) Micro USB cable USB wall charger with minimum specs of 700mA at 5V. The basics: monitor, keyboard, mouse, and wired network connection. Installing Raspberry Pi (NOOBS) Detailed setup instructions can be found here. SSH is installed by default. After initial setup, Raspberry Pi can be run in a headless configuration.\nDownload offline or online setup. Extract and copy files to FAT formatted SD card. Plug in the SD card into the Raspberry Pi. Plug in keyboard, mouse, monitor, and network. Lastly, plug in the power. OS Installation The NOOBS installation will have a few choices for OSes to install. This tutorial is based on the Rasbian flavor.\nSelect the Rasbian OS and select/click Install. After setup is complete you will configuration (raspi-config). At minimum change your password and set the date and time. To run through the configuration again, run sudo raspi-config After configuration is completed, check for updates.\nsudo apt-get upgrade sudo apt-get update Node.js Installation At the time of writing, the stable version of Node.js for Raspberry Pi is 0.10.24.\nDownload and extract Node.js binaries.\nwget http://nodejs.org/dist/v0.10.24/node-v0.10.24-linux-arm-pi.tar.gz tar -xvzf node-v0.10.24-linux-arm-pi.tar.gz Test that node works as expect: node-v0.10.2-linux-arm-pi/bin/node --version should output v0.10.24 Move installation dir: mv node-v0.10.24-linux-arm-pi /usr/local/bin/node Edit .bash_profile to add the node installation dir to the environment variables and the node bin folder to the path. Using vi, open the file vi ~/.bash_profile\nNODE_JS_HOME=/usr/local/bin/node PATH=$PATH:$NODE_JS_HOME/bin Load your saved profile . ~/.bash_profile Test to make sure settings were loaded: node --version should print the version as expected. If native binaries need to be built, install node\u0026rsquo;s native build tool, node-gyp\nnpm install -g node-gyp ","permalink":"https://bciuca.com/2014/06/09/raspberry-pi/","summary":"\u003ch2 id=\"prerequisites\"\u003ePrerequisites\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eRaspberry Pi (Model B)\u003c/li\u003e\n\u003cli\u003e8GB SD card (class 4)\u003c/li\u003e\n\u003cli\u003eMicro USB cable\u003c/li\u003e\n\u003cli\u003eUSB wall charger with minimum specs of 700mA at 5V.\u003c/li\u003e\n\u003cli\u003eThe basics: monitor, keyboard, mouse, and wired network connection.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"installing-raspberry-pi-noobs\"\u003eInstalling Raspberry Pi (NOOBS)\u003c/h2\u003e\n\u003cp\u003eDetailed setup instructions can be found \u003ca href=\"http://www.raspberrypi.org/help/noobs-setup/\"\u003ehere\u003c/a\u003e. SSH is installed by default. After initial setup, Raspberry Pi can be run in a headless configuration.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eDownload \u003ca href=\"http://downloads.raspberrypi.org/NOOBS_latest\"\u003eoffline\u003c/a\u003e or \u003ca href=\"http://downloads.raspberrypi.org/NOOBS_lite_latest\"\u003eonline\u003c/a\u003e setup.\u003c/li\u003e\n\u003cli\u003eExtract and copy files to FAT formatted SD card.\u003c/li\u003e\n\u003cli\u003ePlug in the SD card into the Raspberry Pi.\u003c/li\u003e\n\u003cli\u003ePlug in keyboard, mouse, monitor, and network.\u003c/li\u003e\n\u003cli\u003eLastly, plug in the power.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch3 id=\"os-installation\"\u003eOS Installation\u003c/h3\u003e\n\u003cp\u003eThe NOOBS installation will have a few choices for OSes to install. This tutorial is based on the Rasbian flavor.\u003c/p\u003e","title":"Raspberry Pi and Node.js"},{"content":"Some tools and common setup commands.\n# Text Editors # MouStand Simple Markdown editor with splitview editing \u0026ndash; md on the left, formatted text on the right.\n# Sublime Text 3 Basic text editor with package manager, plugins, and other rich features.\n# Enabling syntaxt highlighting in Vim Using the terminal Vim client, turn on syntax highlighting by adding the following line to ~/.vimrc\nsyntax on # Vim reference http://www.cs.swarthmore.edu/help/vim/home.html\nOpen Vim\n# Virtual Machines # VirtualBox Multiplatform virtualization by Oracle.\n# modern.IE Run various IE versions in a number of Windows flavors via virtual machine. A number of VM images are supported, including VirtualBox.\n# Mac Tools # Homebrew Homebrew is a popular package manager for Mac OS X. Running the Homebrew installation may prompt you to first install the required Xcode command line tools.\nruby -e \u0026quot;$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)\u0026quot; # BackupLoupe Time Machine inspection tool. See what exactly gets backed up with each snapshot, diagnose problems, etc.\n# SSH # Generating Keys (GitHub) ssh-keygen -t rsa -C \u0026quot;your_email@example.com\u0026quot; # SSL # Self signed certificates using OpenSSL The following steps require OpenSSL.\nbrew install openssl Generate private key and certificate signing request.\nopenssl rsa -passin pass:x -in server.pass.key -out server.key openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 Remove the server.pass.key.\nrm server.pass.key Request the certificate (you will be prompted for some values).\nopenssl req -new -key server.key -out server.csr Generate the SSL cert.\nopenssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt Converting the .crt to .pem (optional).\nopenssl x509 -in mycert.crt -out mycert.der -outform DER openssl x509 -in mycert.der -inform DER -out mycert.pem -outform PEM Self-signed certificate using Mac Keychain Access (Apple)\nOpen Keychain Access, located in the Utilities folder in the Applications folder.\nChoose Keychain Access \u0026gt; Certificate Assistant \u0026gt; “Create a Certificate.”\nEnter a name for the certificate.\nChoose an Identity type, and then choose the type of certificate.\nFor an explanation of certificate types, click Learn More.\nIf you want to manually specify the information in the certificate, such as key pairs, extensions, and encryption, click “Let me override defaults,” and then follow the instructions. If you have questions while creating your certificate, click “Learn More.”\nClick Continue.\nReview the certificate and click Done.\n","permalink":"https://bciuca.com/2014/02/24/tools/","summary":"\u003cp\u003eSome tools and common setup commands.\u003c/p\u003e\n\u003ch1 id=\"-text-editors\"\u003e# Text Editors\u003c/h1\u003e\n\u003ch3 id=\"-moustand\"\u003e# \u003ca href=\"http://moustand.com/\"\u003eMouStand\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eSimple Markdown editor with splitview editing \u0026ndash; md on the left, formatted text on the right.\u003c/p\u003e\n\u003ch3 id=\"-sublime-text-3\"\u003e# \u003ca href=\"http://www.sublimetext.com/3\"\u003eSublime Text 3\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eBasic text editor with package manager, plugins, and other rich features.\u003c/p\u003e\n\u003ch3 id=\"-enabling-syntaxt-highlighting-in-vim\"\u003e# Enabling syntaxt highlighting in Vim\u003c/h3\u003e\n\u003cp\u003eUsing the terminal Vim client, turn on syntax highlighting by adding the following line to \u003ccode\u003e~/.vimrc\u003c/code\u003e\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003esyntax on\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch3 id=\"-vim-reference\"\u003e# Vim reference\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"http://www.cs.swarthmore.edu/help/vim/home.html\"\u003ehttp://www.cs.swarthmore.edu/help/vim/home.html\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"http://www.openvim.com/index.html\"\u003eOpen Vim\u003c/a\u003e\u003c/p\u003e","title":"Tools"},{"content":"Enabling public key authentication on the EdgeMAX router is not as straight forward as manually configuring sshd_config and adding an authorized key. Running through the CLI configuration manager is the appropriate procedure in this case. Using the configure command, the ssh settings and the public key will be added to the routers configuration file, which is convenient when backing up settings and restoring configurations.\nThe setup is based on the EdgeRouter Lite (firmware v1.4.0) and the ubnt wiki.\n# Setup In steps 2 and 4, substitute the appropriate username and router IP address.\nGenerate keys on client machine SCP file to router home: scp ~/.ssh/id_rsa.pub USERNAME@ROUTERIP:~/id_rsa.pub configure loadkey USERNAME ~/id_rsa.pub set service ssh disable-password-authentication commit save exit # Undo To enable password authentication again, using an already open ssh session or through the web CLI, delete the configuration line in step 5 above.\ndelete service ssh disable-password-authentication commit save exit # Further Reading Vyatta CLI configure commands (pdf)\n","permalink":"https://bciuca.com/2014/02/08/edgemax-ssh-pubkey/","summary":"\u003cp\u003eEnabling public key authentication on the EdgeMAX router is not as straight forward as manually configuring sshd_config and adding an authorized key. Running through the CLI configuration manager is the appropriate procedure in this case. Using the configure command, the ssh settings and the public key will be added to the routers configuration file, which is convenient when backing up settings and restoring configurations.\u003c/p\u003e\n\u003cp\u003eThe setup is based on the EdgeRouter Lite (firmware v1.4.0) and the \u003ca href=\"http://wiki.ubnt.com/Access_Using_SSH\"\u003eubnt wiki\u003c/a\u003e.\u003c/p\u003e","title":"Disabling Password Login on EdgeMAX Routers"},{"content":"The Ubiquiti Networks EdgeRouter Lite is a powerful, Linux based wired router. For under $100 you get a dual-core MIPS64 CPU, hardware accelerated packet processing with encryption/decryption, 512 MB DDR2 RAM, and 2 GB flash storage. It is marketed as a sub-$100 million packet per second router. All that sounds pretty awesome, but the biggest feature I was interested in was the configurability and software features.\nI have played around in DD-WRT on an aging Linsys WRT54G but it always left more to be desired. I was even considering building a Linux based rig as a router for more flexibility and performance enhancements of my home network. After some research, the EdgeRouter Lite seemed like the perfect package \u0026ndash; small, Linux based OS, cheap, and low power consumption.\nOne of the first things I did was set up dnsmasq to block ads. The benefit of doing this at the router level is that you will block ads on all devices connected to your network. The only caveat is that the devices must be configured to point to the router as the default DNS server, which is usually the default of many network connection setups.\n# Ad Blocking The following steps and script closely mirror the steps outlined in the thread from the Ubiquiti Networks forum. These are my notes from the setup of my EdgeRouter Lite (firmware v1.4.0).\nYou will need to ssh into your router with an admin account or using sudo for most of the commands.\n# 1. The Shell Script Copy the following lines to /config/user-data/update-adblock-dnsmasq.sh\n#!/bin/bash ad_list_url=\u0026quot;http://pgl.yoyo.org/adservers/serverlist.php?hostformat=dnsmasq\u0026amp;showintro=0\u0026amp;mimetype=plaintext\u0026quot; #The IP address below should point to the IP of your router or to 0.0.0.0 pixelserv_ip=\u0026quot;0.0.0.0\u0026quot; ad_file=\u0026quot;/etc/dnsmasq.d/dnsmasq.adlist.conf\u0026quot; temp_ad_file=\u0026quot;/etc/dnsmasq.d/dnsmasq.adlist.conf.tmp\u0026quot; curl -s $ad_list_url | sed \u0026quot;s/127\\.0\\.0\\.1/$pixelserv_ip/\u0026quot; \u0026gt; $temp_ad_file if [ -f \u0026quot;$temp_ad_file\u0026quot; ] then mv $temp_ad_file $ad_file else echo \u0026quot;Error building the ad list, please try again.\u0026quot; exit fi /etc/init.d/dnsmasq force-reload If there are certain sites that you need to allow, you can add the following line for each site you need to remove from the block list. These lines should be placed directly below the \u0026ldquo;then\u0026rdquo; line. For example, to allow ads on stackoverflow, I would add the following line:\nsed -i -e '/ads\\.stackoverflow\\.com/d' $temp_ad_file # 2. Set File Permissions Mark the shell script as executable.\nchmod a+x /config/user-data/update-adblock-dnsmasq.sh # 3. Run It /config/user-data/update-adblock-dnsmasq.sh # 4. Test It Check to see that everything is working. I was not able to install dig, so I used the host command instead.\nhost measuremap.com localhost You should see something like this:\nUsing domain server: Name: localhost Address: 127.0.0.1#53 Aliases: measuremap.com has address 0.0.0.0 You can also try to ping a blocked address from a client machine\nping measuremap.com Ping should fail.\nPING measuremap.com (0.0.0.0): 56 data bytes ping: sendto: No route to host ping: sendto: No route to host Request timeout for icmp_seq 0 ping: sendto: No route to host Request timeout for icmp_seq 1 ping: sendto: No route to host Request timeout for icmp_seq 2 Note: Using a custom DNS server configuration on the client side will bypass the router\u0026rsquo;s DNS forwarder. When checking that adblock is working at the router level you will also need to check the client machine\u0026rsquo;s network configuration for the DNS server entries.\n# 5. Automatic Ad Block Updates Using cron, you can schedule the ad server list to update periodically. Open up the crontab file to add a rule.\ncrontab -e The rule will run the update at a specific interval. Cron parameters are minute hour dayOfMonth month dayOfWeek command\nYou can read more about cron here and here.\nFor example, I want to run the update at 3:00 AM every Sunday:\n0 3 * * 0 /config/user-data/update-adblock-mdns.sh ","permalink":"https://bciuca.com/2014/02/05/edgerouter-ad-block/","summary":"\u003cp\u003eThe \u003ca href=\"http://www.ubnt.com/\"\u003eUbiquiti Networks\u003c/a\u003e EdgeRouter Lite is a powerful, Linux based wired router. For under $100 you get a dual-core MIPS64 CPU, hardware accelerated packet processing with encryption/decryption, 512 MB DDR2 RAM, and 2 GB flash storage. It is marketed as a sub-$100 million packet per second router. All that sounds pretty awesome, but the biggest feature I was interested in was the configurability and software features.\u003c/p\u003e\n\u003cp\u003eI have played around in DD-WRT on an aging Linsys WRT54G but it always left more to be desired. I was even considering building a Linux based rig as a router for more flexibility and performance enhancements of my home network. After some research, the EdgeRouter Lite seemed like the perfect package \u0026ndash; small, Linux based OS, cheap, and low power consumption.\u003c/p\u003e","title":"EdgeRouter Lite Ad Blocking"},{"content":"Some notes regarding Synology NAS device setup and other tasks.\n# Services and Daemons Services reside in the system user directory. I\u0026rsquo;m not very familiar with BSD based OSes, but in Linux, I would usually go to /etc/init.d/ dir to find/restart any service or daemon needed.\nRestarting services and daemons must be done in the /usr/syno/etc.defaults/rc.d/ directory. You will need to list the directory as the service file names have an ID appended. For example, restarting SSH:\n/usr/syno/etc.defaults/rc.d/S95sshd.sh restart ","permalink":"https://bciuca.com/2014/01/24/synology-howtos/","summary":"\u003cp\u003eSome notes regarding \u003ca href=\"http://www.synology.com/en-us/\"\u003eSynology\u003c/a\u003e NAS device setup and other tasks.\u003c/p\u003e\n\u003ch1 id=\"-services-and-daemons\"\u003e# Services and Daemons\u003c/h1\u003e\n\u003cp\u003eServices reside in the system user directory. I\u0026rsquo;m not very familiar with BSD based OSes, but in Linux, I would usually go to \u003ccode\u003e/etc/init.d/\u003c/code\u003e dir to find/restart any service or daemon needed.\u003c/p\u003e\n\u003cp\u003eRestarting services and daemons must be done in the \u003ccode\u003e/usr/syno/etc.defaults/rc.d/\u003c/code\u003e directory. You will need to list the directory as the service file names have an ID appended. For example, restarting SSH:\u003c/p\u003e","title":"Synology NAS"},{"content":"These are some notes that I took when starting to develop Smart TV apps for Samsung TVs. The apps are HTML5 based, but do have some limitations and feature gaps from standard, desktop web browsers. The steps below outline how to setup the SDK and the emulator to test your apps.\n# Prereqs Installing SDK and Emulator v3.5.2 from Samsung\u0026rsquo;s download archive. The SDK requires C++ 2010 Redistributable. If you get a warning stating you have a different version, just uninstall the current version and proceed with the SDK setup. DirecX End-User Runtime - must have this installed prior to starting the SDK installation. Install the SDK and Emulator. You will be prompted to install Apache server, which you will need to serve your apps. # Launching Apps All applications are loaded from the path C:\\Program Files\\Samsung\\Samsung TV SDK(3.5.2)\\apps Place your application directories here. For example, C:\\Program Files\\Samsung\\Samsung TV SDK(3.5.2)\\apps\\myApp The myApp dir structure will contain your index.html and other sub-directories. Launch the applicable emulator (2010 - 2012), and select \u0026ldquo;Open App\u0026rdquo;. Here you will see a list of available applications. ","permalink":"https://bciuca.com/2014/01/14/samsung-sdk/","summary":"\u003cp\u003eThese are some notes that I took when starting to develop Smart TV apps for Samsung TVs. The apps are HTML5 based, but do have some limitations and feature gaps from standard, desktop web browsers. The steps below outline how to setup the SDK and the emulator to test your apps.\u003c/p\u003e\n\u003ch1 id=\"-prereqs\"\u003e# Prereqs\u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003eInstalling SDK and Emulator v3.5.2 from \u003ca href=\"http://www.samsungdforum.com/Devtools/SdkArchive\"\u003eSamsung\u0026rsquo;s download archive\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003eThe SDK requires C++ 2010 Redistributable. If you get a warning stating you have a different version, just uninstall the current version and proceed with the SDK setup.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://www.microsoft.com/en-us/download/confirmation.aspx?id=35\"\u003eDirecX End-User Runtime\u003c/a\u003e - must have this installed prior to starting the SDK installation.\u003c/li\u003e\n\u003cli\u003eInstall the SDK and Emulator. You will be prompted to install Apache server, which you will need to serve your apps.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch1 id=\"-launching-apps\"\u003e# Launching Apps\u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003eAll applications are loaded from the path \u003ccode\u003eC:\\Program Files\\Samsung\\Samsung TV SDK(3.5.2)\\apps\u003c/code\u003e\n\u003cul\u003e\n\u003cli\u003ePlace your application directories here. For example, \u003ccode\u003eC:\\Program Files\\Samsung\\Samsung TV SDK(3.5.2)\\apps\\myApp\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eThe \u003ccode\u003emyApp\u003c/code\u003e dir structure will contain your index.html and other sub-directories.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eLaunch the applicable emulator (2010 - 2012), and select \u0026ldquo;Open App\u0026rdquo;.\u003c/li\u003e\n\u003cli\u003eHere you will see a list of available applications.\u003c/li\u003e\n\u003c/ul\u003e","title":"Samsung SDK Setup"},{"content":"# TL;DR Adding a path to your PATH in Mac OS X (Mavericks as tested here).\nEdit the paths file. sudo vim /etc/paths\nAdd your path, then save the file.\nTest the path: echo $PATH\n","permalink":"https://bciuca.com/2014/01/13/mac-paths/","summary":"\u003ch1 id=\"-tldr\"\u003e# TL;DR\u003c/h1\u003e\n\u003cp\u003eAdding a path to your PATH in Mac OS X (Mavericks as tested here).\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eEdit the paths file.\n\u003ccode\u003esudo vim /etc/paths\u003c/code\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eAdd your path, then save the file.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eTest the path: \u003ccode\u003eecho $PATH\u003c/code\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e","title":"Adding to your PATH in Mac OS X"},{"content":"# TL;DR All instructions are based on Mac OS X Mavericks (10.9.1) and assumes you already have Ruby installed. See further reading for more details.\nInstall Jekyll: gem install jekyll\nSetup Jekyll-Bootstrap\nFrom scratch:\ngit clone https://github.com/plusjade/jekyll-bootstrap.git USERNAME.github.com cd USERNAME.github.com git remote set-url origin git@github.com:USERNAME/USERNAME.github.com.git git push origin master From existing Github repo:\ngit clone https://github.com/myaccount/jekyll-bootstrap.git cd jekyll-bootstrap jekyll serve --watch Test your pages before pushing any changes to Github.\ncd /mypath/jekyll-bootstrap jekyll serve --watch # Background This blog is based on Github Pages, which is a Jekyll-Bootstrap generated site. All posts and pages are written in markdown and then compiled to static web pages by jekyll.\n# Further Reading # Jekyll and Github Pages https://help.github.com/articles/using-jekyll-with-pages\nhttp://jekyllbootstrap.com\nhttp://andytaylor.me/2012/11/03/installing-ruby-and-jekyll\n# Markdown reference http://daringfireball.net/projects/markdown/\n","permalink":"https://bciuca.com/2014/01/13/jekyll/","summary":"\u003ch1 id=\"-tldr\"\u003e# TL;DR\u003c/h1\u003e\n\u003cp\u003eAll instructions are based on Mac OS X Mavericks (10.9.1) and assumes you already have Ruby installed. See further reading for more details.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003eInstall Jekyll: \u003ccode\u003egem install jekyll\u003c/code\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eSetup Jekyll-Bootstrap\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003eFrom scratch:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003egit clone https://github.com/plusjade/jekyll-bootstrap.git USERNAME.github.com\ncd USERNAME.github.com\ngit remote set-url origin git@github.com:USERNAME/USERNAME.github.com.git\ngit push origin master\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eFrom existing Github repo:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003egit clone https://github.com/myaccount/jekyll-bootstrap.git\ncd jekyll-bootstrap\njekyll serve --watch\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eTest your pages before pushing any changes to Github.\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003ecd /mypath/jekyll-bootstrap\njekyll serve --watch\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/li\u003e\n\u003c/ul\u003e","title":"Jekyll Bootstrap"},{"content":"# TL;DR Create a link to your development environment in your web server path.\nCreate the link\nsudo ln -s /Users/bciuca/dev/MyTestApp/ /Library/WebServer/Documents/testapp\nSet directory permissions\nchmod o+x ~/dev/MyTestApp\n# Background I have a webapp project that I need to run in a browser locally on my develoment machine. My options to test the webapp is to either set my apache config to point to my development dir, or make a build sctipt to copy and paste the code to a test path in my existing web server root.\n# Symbolic Links In this example, I am testing everything locally with no need for minification or other build steps before hosting the code. For simplicity, a symbolic link in the web server root will point to my development directory, /Users/bciuca/dev/MyTestApp.\nThe ln -s command will create the symbolic link, given a source and destination path (sudo is needed to write the symlink).\nsudo ln -s /Users/bciuca/dev/MyTestApp/ /Library/WebServer/Documents/testapp\nSo the URL http://localhost/testapp is now serving files from /Users/bciuca/dev/MyTestApp/.\nFurther reading on symbolic and hard links in OS X.\nIn order for Apache to serve the files, you must set the correct file permissions listed above in the Procedure step 2.\n","permalink":"https://bciuca.com/2014/01/02/mac_apache/","summary":"\u003ch1 id=\"-tldr\"\u003e# TL;DR\u003c/h1\u003e\n\u003cp\u003eCreate a link to your development environment in your web server path.\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eCreate the link\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003esudo ln -s /Users/bciuca/dev/MyTestApp/ /Library/WebServer/Documents/testapp\u003c/code\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eSet directory permissions\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003echmod o+x ~/dev/MyTestApp\u003c/code\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 id=\"-background\"\u003e# Background\u003c/h2\u003e\n\u003cp\u003eI have a webapp project that I need to run in a browser locally on my develoment machine. My options to test the webapp is to either set my apache config to point to my development dir, or make a build sctipt to copy and paste the code to a test path in my existing web server root.\u003c/p\u003e","title":"Symbolic Links and Apache on OS X"},{"content":"FreeNAS Hosted AFP Share I have an older Acer netbook laying around that I wanted to turn into a NAS server to host my Time Machine backups for my Macs. I had a similar setup running on a Windows machine in VirtualBox that worked very well. My intentions with the netbook NAS were purely to decrease power consumption.\nWhen trying to recreate my Virtual Box setup on my netbook, I did run into an issue that prevented me from using the AFP FreeNAS share as a valid Time Machine drive. Even though I was able to connect to the share and write files, Time Machine did not like something about the setup.\nThe steps described below can at least get you to create a valid AFP share that you can use with your Mac machines as a network drive.\n# Creating a Bootable FreeNAS USB Drive My netbook does not have an optical drive so I will need to install FreeNAS via a bootable USB.\nDownload the software from FreeNAS. At the time of writing I downloaded version 8.3.1 34-bit disk image. There are 64-bit versions as well, just make sure your system supports it.\nYou will also need Keka or some other unarchiver to extract the disk image from the downloaded file.\nTo extract with Keka, right-click the FreeNAS disk image you downloaded in step 1 and select \u0026lsquo;Open With \u0026gt; Keka\u0026rsquo;. This process may take a few minutes to extract the disk image. When complete, you will have a .img file.\nOpen Terminal (from Spotlight, or also in the Applications\\Utilities directory).\nFrom the terminal, type diskutil list and you should see something like this:\ndiskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *500.1 GB disk0 1: EFI 209.7 MB disk0s1 2: Apple_HFS Mac OS X 499.2 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *1.1 GB disk1 1: DOS_FAT_32 NO NAME 1.0 GB disk1s1\nUnmount the USB drive from the command line, diskutil unmountDisk /dev/disk1. If successful, you should see the result: Unmount of all volumes on disk1 was successful\nNow it\u0026rsquo;s time to write the image to the USB drive (sudo to get elevated privileges, requires root/admin password) sudo dd if=FreeNAS-8.3.1-RELEASE-x64.img of=/dev/disk1 bs=64k. This process will take some time. Once completed, the prompt will return.\nNow you are all set and ready to boot your FreeNAS machine from the USB drive.\n# Booting into FreeNAS At the BIOS screen, press the appropriate keystroke to get the boot menu and then selecting the USB device. You can also change the default boot order in the BIOS setup. If you want to change boot order on a Mac, on boot, hold the Option key until you are presented with a list of bootable devices. The system should now boot into FreeNAS.\nAfter FreeNAS boots and loads, you should be presented with this screen (your IP will be different):\nConsole setup .\nConfigure Network Interfaces Configure Link Aggregation Configure VLAN Interface Configure Default Route Configure Static Routes Configure DNS Reset WebGUI login credentials Reset to factory defaults Shell Reboot Shutdown . You may try the following URLs to access the web user interface: . http://192.168.1.10/ . . Enter an option from 1-11: From another machine on the same network as the FreeNAS box, open up the browser and point to the URL shown. You will be able to configure the rest of the NAS from this web interface.\n# Setting up a Time Machine Volume You will first need to specify a disk to use for your Time Machine backup. The disk should have at least the same capacity as the Mac you will be backing up. In my case, I will be using a 1 TB hard drive.\nAdd the volume from Storage \u0026gt; Volumes Set the volume permissions, Storage \u0026gt; Volumes \u0026gt; /mnt/TimeMachine0 \u0026gt; Change Permissions. We will set the permissions to nobody for both user and group. The same user, \u0026rsquo;nobody\u0026rsquo;, will be used when setting up the shared volume. Create an AFP share. Sharing \u0026gt; Apple (AFP) Shares \u0026gt; Add Apple (AFP) Share The following fields were configured for the share:\nName: TimeMachine Path: /mnt/TimeMachine0 Share/Confirm Password: your password here Allow List: nobody Read-write List: nobody Disk Discovery: checked Disk discovery mode: Time Machine Database path: /mnt/TimeMachine0 Enabled .AppleDouble: checked AFP3 Unix Privs: checked for Macs with OS X 10.5 or greater Click ok to save. # Connecting to the Time Machine Share From the Finder menu, Go \u0026gt; Connect to Server\u0026hellip; Enter afp://[your free nas ip]\nYou will be asked for a password, this will be the password set for the \u0026rsquo;nobody\u0026rsquo; user.\nOnce connected, you will then be prompted for the share password you set in the AFP share above.\nIf all worked out, you should be able to connect.\nReading and writing files to the drive is fine, but I was getting error \u0026lsquo;OSStatus error 13\u0026rsquo; when trying to select the disk in Time Machine setup.\n","permalink":"https://bciuca.com/2013/04/12/freenas-timemachine/","summary":"\u003ch1 id=\"freenas-hosted-afp-share\"\u003eFreeNAS Hosted AFP Share\u003c/h1\u003e\n\u003cp\u003eI have an older Acer netbook laying around that I wanted to turn into a NAS server to host my Time Machine backups for my Macs. I had a similar setup running on a Windows machine in \u003ca href=\"https://www.virtualbox.org/\"\u003eVirtualBox\u003c/a\u003e that worked very well. My intentions with the netbook NAS were purely to decrease power consumption.\u003c/p\u003e\n\u003cp\u003eWhen trying to recreate my Virtual Box setup on my netbook, I did run into an issue that prevented me from using the AFP FreeNAS share as a valid Time Machine drive. Even though I was able to connect to the share and write files, Time Machine did not like something about the setup.\u003c/p\u003e","title":"FreeNAS AFP Share for Macs"},{"content":"Hello Mars! This is a test page. Yay.\n","permalink":"https://bciuca.com/test/2013/04/10/hello-mars/","summary":"\u003cp\u003eHello Mars! This is a test page. Yay.\u003c/p\u003e","title":"Hello Mars"},{"content":"# Why would you need more than one GitHub account? Ideally, having a single GitHub account with contributions to multiple organizations would be the simplest way. As it turns out, my current job came with a separate GitHub account. So now I have two GitHub accounts, one for personal projects and another for work. The problem I was running into was trying to keep my commits tied with the right GitHub ssh key. Luckily, git and ssh are configurable enough to get this sorted out.\nThrough some simple googling, I found Jeffery Way\u0026rsquo;s blog post. The steps I outlined below is what I did to get this setup on my Mac. More details can be found on Jeffery\u0026rsquo;s blog.\nThe following steps assume that you already have an existing key you use with one of your github accounts. For the purpose of this writeup, the default id_rsa key is associated with your personal GitHub account.\n# Creating and adding ssh keys A ssh key will be needed to use with the work GitHub account. In your ~/.ssh directory, run the following ssh command: ssh-keygen -t rsa -C \u0026quot;me@mycompany.com\u0026quot;\nRename the key to something else, for this example I went with, id_rsa_mycompany and id_rsa_mycompany.pub (private and public keys respectively).\nAdd the key to ssh: ssh-add ~/.ssh/id_rsa_mycompany\n# Setting up GitHub with your new ssh key Now add the new public key to the work GitHub account (this will be under your GitHub account settings). Open the id_rsa_mycompany.pub public key file in a text editor and copy the text. Or just copy directly from the terminal: cat ~/.ssh/id_rsa_mycompany.pub | pbcopy\n# Configuring ssh Configure ssh host names to use for work and personal. The config file is in ~/.ssh/config or you can create one if needed: touch ~/.ssh/config\nThe first host is the personal account and the second entry is for the work account. You can name the Hostname whatever you like. Host github.com Hostname github.com User git IdentityFile ~/.ssh/id_rsa Host github-mycompany Hostname github.com User git IdentityFile ~/.ssh/id_rsa_mycompany\n# Configuring git repo In the respective git repos, configure the your email address.\ngit config user.email \u0026quot;me@mycompany.com\u0026quot; # Testing it out To test that the keys were added ok, you can run the following ssh commands.\nssh -T git@github.com Hi bciuca! You've successfully authenticated, but GitHub does not provide shell access. ssh -T git@github-mycompany Hi bciuca-mycompany! You've successfully authenticated, but GitHub does not provide shell access. ","permalink":"https://bciuca.com/dev/2013/04/10/using-multiple-github-accounts/","summary":"\u003ch3 id=\"-why-would-you-need-more-than-one-github-account\"\u003e# Why would you need more than one GitHub account?\u003c/h3\u003e\n\u003cp\u003eIdeally, having a single GitHub account with contributions to multiple organizations would be the simplest way. As it turns out, my current job came with a separate GitHub account. So now I have two GitHub accounts, one for personal projects and another for work. The problem I was running into was trying to keep my commits tied with the right GitHub ssh key. Luckily, git and ssh are configurable enough to get this sorted out.\u003c/p\u003e","title":"Using Multiple GitHub Accounts"}]