Welcome

Pacific Simplicity is the home to my tech blog of sorts, aiming to assist and provide information easily to other Linux users and Open Source hackers out there.  It contains articles on Linux, system admin hints, scripting, programming embedded systems, OpenWRT and of course Drupal . Check it out and don't forget to comment!

Posted: Thu, 08/18/2016 - 08:27

Recently went to setup a reverse SSH tunnel and had a few issues such as connections not being allowed, or otherwise. There is also a strong gotcha not documented clearly on the Internet, you can only have one connection per port on the intermediary host. If you want more than one host, you need to use multiple ports; sorry this is the way it is.

Before starting, make sure on BOTH hosts, install:

sudo apt-get install -y openssh-server

Posted: Thu, 07/21/2016 - 15:09

I recently coded this in less than 30 seconds for a student showing how you can create a simple 2D array to return sizes of structs to be used inside of buffer array function. This should be explanatory by itself... the use - its up to you.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

typedef struct type1_s {
    int data;
}type1_t;

typedef struct type2_s {
    int data;
    int data2;
}type2_t;

Posted: Mon, 07/04/2016 - 16:40

Here is a script I finally found on the web after alot of searching when OpenWRT's overlay functionality did not automatically work at boot. This was with the FriendlyARM NanoPC-T2 due to the usage of the eMMC not being quite NAND nor flash etc.. Or having a DTS file or MTD driver etc...

Posted: Sun, 06/19/2016 - 18:29

Here is my guide for a quickstart instead of reading their documentation:

Install Prerequisites

# sudo apt-get update
# sudo apt-get install -y git autoconf gcc libtool libxml2-dev libssl-dev make libncurses5-dev libssh2-1-dev openssh-server build-essentials git

Reconfigure SSHD

Edit sshd_config and under the line Port 22, add the following two lines

# sudo vi /etc/ssh/sshd_config

# What ports, IPs and protocols we listen for
Port 22
Port 830
Subsystem netconf /usr/sbin/netconf-subsystem --ncxserver-sockname=830@/tmp/ncxserver.sock

Restart SSH with the following command

sudo service ssh restart

Download, build and install OpenYuma

GIT clone, make and install the following - netconfd will run with your current user

# git clone <a href="https://github.com/OpenClovis/OpenYuma.git">https://github.com/OpenClovis/OpenYuma.git</a> openYuma
# cd openYuma
# make
# sudo make install

# sudo cp /etc/yuma/netconfd-sample.conf /etc/yuma/netconfd.conf
# /usr/sbin/netconfd --superuser=`whoami`

Connecting with yangcli

Open a second terminal and run the command:

# yangcli

Something like the following should appear - note the YOURUSERNAME and YOURPASSWORD variables which need to be replaced with something more appropriate

yangcli> connect server=localhost user=YOURUSERNAME password=YOURPASSWORD
val->res is NO_ERR.

yangcli: Starting NETCONF session for rbrash on localhost

NETCONF session established for rbrash on localhost

Client Session Id: 2
Server Session Id: 1

Server Protocol Capabilities
   base:1.0
   candidate:1.0
   confirmed-commit:1.0
   rollback-on-error:1.0
   validate:1.0
   url:1.0
   xpath:1.0
   notification:1.0
   interleave:1.0
   partial-lock:1.0
   with-defaults:1.0
   base:1.1
   validate:1.1
   confirmed-commit:1.1

Server Module Capabilities
   iana-crypt-hash@2014-04-04
      Features:
         crypt-hash-md5
         crypt-hash-sha-256
         crypt-hash-sha-512
   ietf-inet-types@2013-07-15
   ietf-netconf-acm@2012-02-22
   ietf-netconf-monitoring@2010-10-04
   ietf-netconf-partial-lock@2009-10-19
   ietf-netconf-with-defaults@2011-06-01
   ietf-system@2014-08-06
      Features:
         radius
         authentication
         local-users
         radius-authentication
         ntp
         ntp-udp-port
         timezone-name
         dns-udp-tcp-port
   ietf-yang-types@2013-07-15
   nc-notifications@2008-07-14
   notifications@2008-07-14
   yuma-app-common@2012-08-16
   yuma-arp@2012-01-13
   yuma-mysession@2010-05-10
   yuma-ncx@2012-01-13
   yuma-proc@2012-10-10
   yuma-system@2014-11-27
   yuma-time-filter@2011-08-13
   yuma-types@2012-06-01

Server Enterprise Capabilities
   None

Protocol version set to: RFC 6241 (base:1.1)
Default target set to: <candidate>
Save operation mapped to: commit
Default with-defaults behavior: explicit
Additional with-defaults behavior: trim,report-all,report-all-tagged

Checking Server Modules...

Posted: Thu, 06/16/2016 - 16:28

Upcoming will be my porting of this devices code into OpenWRT (ported and booting already) or LEDE when I decide which will be appropriate, but here is how you flash uboot and get the UART TTL to work (compared to the terrible manufacturer documentation.

Wiring setup for the UART on the board: