Control your garage door from your Android watch

The need (or want I should say):

I want to simplify getting into my garage when returning home on my motorcycle. It’s not fun to have to search around the garage door clicker or get off the bike and go enter the code….so why not make it so I can use my voice to open it from my Android wear watch.

What I have:

Watch: Nixon Mission (http://www.nixon.com/us/en/mens-model-mission) – I’ve used the Moto 360 as well, any Android Wear device should work
Android Phone: Samsung S7 Edge (any ANdroid phone should work)
Android Software: Tasker (https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&hl=en) & Wear Tasker (https://play.google.com/store/apps/details?id=com.cuberob.weartasker&hl=en)
Garage Controller: Zenotech beagle done cape (http://zenotec.net/)
Command Center: Home Assistant (https://home-assistant.io/)

How it comes together:

The intention of this post is not to hold ones hand through the process step-by-step, but to share the framework used to make it work. If someone does have questions on any specifics, please post them in the comments and I’ll share more specifics in that area.

Home Assistant

Configuration

https://github.com/RickB17/home-assistant/blob/master/configuration.yaml

Scripts

Script used to use the garage door sensor:

Note: You’ll want to setup certificate based authentication between your hass (Home-Assistant) server and the garage door controller

https://github.com/RickB17/home-assistant/blob/master/Garage-State.sh

Tasker

https://github.com/RickB17/home-assistant/blob/master/tasker.txt

 

NGINX Amplify Agent on Ubuntu LTS 16


mkdir ~/NGINX-Amplify
cd ~/NGINX-Amplify
curl -L -O https://github.com/nginxinc/nginx-amplify-agent/raw/master/packages/install.sh
sudo apt-get install python-software-properties python2.7
sudo API_KEY='USEYOURKEY' sh ./install.sh

The Output

--- This script will install the NGINX Amplify Agent ---

1. Checking admin user ... root, ok.
2. Checking API key ... using YOURAPIKEY
3. Checking python version ... found python 2.7
4. Checking OS compatibility ... ubuntu detected.
5. Adding public key ... done.
6. Adding repository ... added.
7. Updating repository ...

Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease
Ign:5 https://packages.amplify.nginx.com/ubuntu xenial InRelease
Get:6 https://packages.amplify.nginx.com/ubuntu xenial Release [2,526 B]
Get:7 https://packages.amplify.nginx.com/ubuntu xenial Release.gpg [287 B]
Get:8 https://packages.amplify.nginx.com/ubuntu xenial/amplify-agent amd64 Packages [1,744 B]
Get:9 https://packages.amplify.nginx.com/ubuntu xenial/amplify-agent i386 Packages [1,741 B]
Fetched 101 kB in 0s (113 kB/s)
Reading package lists... Done

7. Updating repository ... done.
8. Installing package ...

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
nginx-amplify-agent
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 3,590 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://packages.amplify.nginx.com/ubuntu xenial/amplify-agent amd64 nginx-amplify-agent amd64 0.39-2~xenial [3,590 kB]
Fetched 3,590 kB in 3s (1,026 kB/s)
Selecting previously unselected package nginx-amplify-agent.
(Reading database ... 60211 files and directories currently installed.)
Preparing to unpack .../nginx-amplify-agent_0.39-2~xenial_amd64.deb ...
Unpacking nginx-amplify-agent (0.39-2~xenial) ...
Processing triggers for systemd (229-4ubuntu8) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up nginx-amplify-agent (0.39-2~xenial) ...

8. Installing package ... done.
9. Building configuration file ... done.
10. Checking if sudo -u nginx can be used for tests ... done.
11. Checking if euid 111(nginx) can find root processes ... ok.
12. Checking if euid 111(nginx) can access I/O counters ... ok.
13. Checking connectivity to the receiver ... ok.
14. Checking system time with ntpdate(8) ... failed - no ntpdate installed!

A few checks have failed - please read the warnings above!

To start and stop the Amplify Agent type:

service amplify-agent { start | stop }

Amplify Agent log can be found here:
/var/log/amplify-agent/agent.log

After the agent is launched, it might take up to 1 minute this system to appear
in the Amplify user interface.

PLEASE CHECK THE DOCUMENTATION HERE:
https://github.com/nginxinc/nginx-amplify-doc

Launching amplify-agent ...
All done.

Google OnHub Port Forwarding Not Working

Issue: Port forwarding of external ports to internal devices using the Google OnHub router stopped working

Cause: A device supporting UPnP was recently added to the network. I was able to arrive at this hypothesis because once I swapped in a Linksys router with no static port forwarding configured, the offending device was available and responding externally.

Resolution: Disable UPnP on the offending device.

Setup GNS3 Server w/ IOU support on a remote server (CLI only)

Get a VPS to host your GNS3 Server (or use an existing server you have)

  1. Go to VPS Dime (This link gives me credit for the referral)
  2. Create an instance using Ubuntu 16.04 LTS (Xenial)

Install GNS3

  • add-apt-repository ppa:gns3/ppa
  • apt-get update
  • apt-get install python3-setuptools python3-pyqt4 python3-ws4py python3-netifaces
  • apt-get install cmake libelf-dev uuid-dev libpcap-dev software-properties-common
  • apt-get install libssl1.0.0/xenial libssl-dev/xenial openssl/xenial
  • apt-get install gns3-server
  • dpkg –add-architecture i386 (two dashes, add, dash,architecture,space,i386)
  • apt-get update
  •  apt-get install gns3-iou
  • setcap cap_net_raw+ep /usr/bin/iouyap (If you want details)

Stuff you need to figure out 🙂

  • Get your IOU images and upload them
  • Install your iou license
    • Vi ~/.iourc
    • echo ‘127.0.0.127 xml.cisco.com’ >> /etc/hosts

Start using your GNS3 server from your GNS3 client

  • Make sure your client and server versions match or it will yell at you

Now to create a docker container to run this on my Synology instead of a externally hosted VPS

 

 

Backup remote linux machines to Synology

The Purpose

I use a number of Virtual Private Servers (VPS) and wanted to make a backup of the data and applications running on them.

The first step is to make a local copy of your data to a folder on the remote machine, then you can pull these files to the Synology NAS via a scheduled task. For my applications I simply used tar to backup all the directories I can about to a single file and a mysql dump to dump all the databases in the mysql server to a single file.

Setup Authentication

generate your keys


#ssh-keygen

  • do not configure with a password

Verify sshd is configured to use key files


vi /etc/ssh/sshd_config


AuthorizedKeysFile      %h/.ssh/authorized_keys

Add the public key to ssh authorized_keys


cat key.pub >> ~/.ssh/authorized_keys

Copy the private key to the Synology

Use any method you like for this. I personally simply copied the contents of the private key, then pasted it into a file on my local machine and moved it to an existing share on the NAS.

Connect to source machine from Synology and trust the source machine


chmod 400 $AbsolutePathToPrivateKey
ssh -p 22 -i $PRIVATEKEY your-user-name@server.your-domain.com

The scheduled task

Create the scheduled task

save the script below local to the Synology and make it executable

notes:

  1. You may need to enable SSH terminal access on your NAS.
  2. If you edit the script locally on a windows machine with Notepad ++ make sure you change the EOL (End of Line) to Unix


#!/bin/bash
USER="your-user-name"
SERVER="server.your-domain.com"
PORT="22"
SSHID="/volume1/backups/scripts/certificates/server.your-domain.com.privkey.pem"
SOURCE="/backups/synology/"
TARGET="/volume1/backups/server.your-domain.com/"
LOG="/volume1/backups/server.your-domain.com/backup.log"
/usr/bin/rsync -avz --progress -e "ssh -p $PORT -i $SSHID" $USER@$SERVER:$SOURCE $TARGET >> $LOG 2>&1

Run the script and verify your data is copied

References

http://raphael.kallensee.name/journal/how-to-backup-an-external-server-with-a-synology-nas-via-rsync/

Windows computers not reporting to WSUS

Verify client configuration

Local Computer Policy

Verify Resultant Policy is correct

Verify Correct GPO’s are being applied

C:\>gpresult /scope computer

Update Group Policies

C:\>gpupdate /force

verify connectivity

ping wsus-server-01.domain.com

telenet wsus-server-01.domain.com 8530

If you are using a hosts file and having troubles with resolution, check out this post

Reset the client

wuauclt.exe /resetauthorization /detectnow

Force check in

wuauclt.exe /reportnow

Check WSUS in 10-15 minutes

If you are still having issues check out the client log file:

C:\Windows\WindowsUpdate.log

Windows hosts file not being used for resolution

windows version: Server 2003 R2 Standard x64 SP2

Verify it’s not working

ipconfig /flushdns

ipconfig /displaydns | more

Check for type-o’s!

Start with the simple solution first

Verify hosts file location

Open Registry Editor

Verify key: My Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services|Tcpip\Parameters\DataBasePath

Copy Value data and paste it into Explorer to verify you are editing the correct file

Verify file permissions (This was my issue)

If machine\users is not given Read and Read & Execute permissions, add the account.

 

JIRA : Limit which resolutions are displayed on a screen

  1. Select the workflow transition
  2. Edit the properties
  3. Add the “jira.field.resolution.include” property with values matching the resolution ID’s you want to display

 

How to identify the resolution id

  1. Administration > Issues > Issues Attributes > Resolutions
  2. Mouse over the resolution
  3. observe the ID in the URL
    1. Example: https://JIRASITE/secure/admin/EditResolution!default.jspa?id=10100

 

Verizon Samsung Galaxy S6 Edge – Data not available while on a call

 

Problem: Simultaneous voice and data wasn’t a problem on my S4, but since I picked up my S6 Edge yesterday whenever a call comes my phone tells me that data is no longer available.

Solution:

  1. Verify the “Advanced Calling 1.0” DH Voice feature is enabled on your line.
    1. you can do this yourself through the My Verizon Mobile app on the phone
    2. OR you can call *611 and have them put it on
  2. Verify the feature is enabled on the device
    1. Settings > Advanced Calling > Activate Advanced Calling (Screen shots below)
  3. Power cycle your phone

Note: It took a couple of power cycles and probably about 5-10 minutes for the setting to actually take and start working