rc.local wont start – Ugh

So I put a command in the rc.local to run on boot on an Ubuntu server. Didn’t start. What the hell. perms OK. script runs OK. Frickin’ Systemd Dammit. I think I am done with systemd now. Just too intrusive. First – monolithic and HUGE. Second I want text log files. And I don’t want to have to google how to make rc.local run with a damn config file. WTF?

/etc/systemd/system/rc-local.service
[Unit]
 Description=/etc/rc.local Compatibility
 ConditionPathExists=/etc/rc.local

[Service]
 Type=forking
 ExecStart=/etc/rc.local start
 TimeoutSec=0
 StandardOutput=tty
 RemainAfterExit=yes
 SysVStartPriority=99

[Install]
 WantedBy=multi-user.target
sudo systemctl enable rc-local

Android Mapping

There are plenty of GPS/Mapping apps for both Android and iOS but my favorite, so far, is Oruxmaps. This app seems to offer all the features I could want including:

  • Offline mapping from online sources
  • Offline mapping in vector format downloadable to the device
  • Offline mapping in Geo-Located PDF format which is useful for Motor Vehicle Use Maps as per the National Forest Service and available from staythetrail.org

Vector maps are available from OpenAndroMaps and are easily installed to the device by clicking the  button.

A good source of Digital Elevation Model (DEM) files is archive.org

Other options include BackCountry Navigator, All Trails, Avenza and Gaia and others. Neither of these apps offer as much flexibility as Oruxmaps however.

 

 

Add Login/Logout item to top menu bar in WordPress

Add this code to your theme’s functions.php file.

add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
function add_login_logout_link($items, $args) {
        ob_start();

        wp_loginout('index.php');
        $loginoutlink = ob_get_contents();
        ob_end_clean();
        if ($args->theme_location == 'top')
                $items .= '<li>'. $loginoutlink . '</li>';
    return $items;
}

 

Auto sub content in WordPress

Adding the headings of direct children of the page to the page automatically. Just add the code below to the end of the content-page.php file in your theme directory.

<?php
        $mypages = get_pages( array( 'parent' => $post->ID, 
            'sort_column' => 'post_date', 
            'sort_order' => 'desc' ) ); 
        foreach( $mypages as $page ) {
                $content = $page->post_content;
                if ( ! $content ) // Check for empty page                
                continue;
                $content = apply_filters( 'the_content', $content );
?>
                <h2><a href="<?php echo get_page_link( $page->ID );?>"> <?php echo $page->post_title; ?></a></h2>
                <div class="entry">
                        <?php// echo $content; ?>
                </div>
<?php
}
?>

 

Experiments in Web Publishing

After creating the desired router and configuration, it was time to move on to the Web Server. In the past Drupal was the Web Server of choice but it was time to look at other options and compare. WordPress came out on top. This became a lesson in installing and configuring WordPress

OpenWRT

Last week there was a need for a new feature on the main office router. This feature was not available. It seemed time to explore new options. The end result was an journey through the maze of the Open Source WiFi firmware world. The center of the maze turned out to be OpenWRT or LEDE.

Installation of OpenWRT went surprising well and configuration fairly easy. Options used included USB storage, sftp server and sqm (QoS). There will be a project page on this.