Nothing to see...

A simple blog about all things in the world that is ridikulouse.

Technological steps, are man kinds greatest achievements

Not a Fighter, but a lover of Tech.

Love of the internet

The Internet is the final frontier for open connected networks, it promotes speech and advances knowledge for any mere person. The internet is fast becoming a need rather a want, and it is recognised by the UN as a necessity for the modern person.

Photography

Photography is more than just Art and expression, it is the manipulation of the light and provokes emotion and memories.

Have a look around

The articles on this blog represent my thoughts and views at the time of writing, I can always change my views through further education...please don't hold me against my views. Some of the articles have been written to assist anyone else with similar issues - it also helps me to remember. Hope you get something out of this.

Tuesday, July 9, 2019

Installing Third Party Applications on your Asuswrt-merlin router

If you have the Asuswrt-merlin router, then you have a world of possibilities unlike before.

In order to install third party applications you will need to enter the world of Entware. Entware is a software repository for devices such as routers.


To get into the world of Entware you will need to :

1. Be comfortable with using SSH
2. Have a USB flash drive/disk connected to your router.

For 1 - Turn on SSH on your router. You can enable this under Administration > System > Enable SSH. I would enable this for LAN Only at this stage. To connect to your router via SSH use a SSH client or your terminal (MACOSX, Linux), and type in "ssh admin@routerip". Enter your password and if it is your first time trust the connection.

For 2. Get a USB disk, format it to ext4 and pop it into your router. If your router doesn't mount the drive then check the system log to see what the error is. If the error is regarding features not being supporter then you might need to format the drive on the router - see my other article regarding this.

Now, step 1 is to install amtm.

1. log in to your router via ssh.
2. curl -Os https://raw.githubusercontent.com/decoderman/amtm/master/amtm && sh amtm 
3. amtm should load, goto install scripts then install Entware
4. once you have entware installed you can exit amtm, you can always come back to amtm by typing "amtm".


Looking at the available packages on entware
opkg list

Installing a package
opkg install <package_name>

Removing a package
opkg remove <package_remove>


Asuswrt-merlin mounting a USB device

So you've formatted your USB drive to ext4, stuck it into your router and your router recognises the plugged in USB device but it sez that it is unmounted. What gives ?


Well, first step is to check the system logs (see the left hand side menu options).

If the logs states something like "couldn't mount RDWR because of unsupported optional features" then most likely what's happened is that you've formatted your USB drive on your computer which is supporting features than what can be recognised by your router.

A simple way to fix this is to format it on the router - follow these steps:

1. Enable SSH on the router (Administration > System > Enable SSH - enable Lan only).
2. Open up terminal or an SSH client and fire the following command "ssh admin@yourrouterip", and enter your password. If it is your first time then it may ask you a couple of questions.
3. Run the command "mke2fs -t ext4 /dev/sda1"  asssuming that /dev/sda1 is where your drive is mounted. It will ask you whether you are sure, if you are then type "y" and it will proceed to format the drive to ext4.


At this point you can manually mount the usbdrive using mount .


Thursday, April 25, 2019

Video editing in linux

My primary desktop for development is now Linux desktop. I've got it running on my laptop's, and computers with various distros (Ubuntu being used primarily with Gnome).

Although I've been using Linux since the 90s, Windows has always existed. However, with vscode and online application like gdocs etc... I've managed to use Linux as my primary os. The question of Linux not having the software to support everyday use was finally busted. I became very adapted to using Linux, and used the alternative software such as gimp etc... For the various tasks that I needed to run.

However, today I'm finding myself repartitioning my HDD so that I can install windows. As much as I didn't want to return to windows, I'm finding that the question of adequate software has come up again and in this case the question of premium video editing software is just not available in Linux.

Sure there's kdenlive, and the Devs have done a great job with it. However, it's definately not comparable to something like Adobe's product or Apple's final cut Pro.

With Adobe dragging their heels in offering the creative suite on Linux, and Apple... Well I need to buy some over priced piece of kit just to use final cut Pro.

I looked everywhere for another alternative, such as cloud editing etc.... However nothing was available. Untill I came across DaVinci Resolve. This was the first time I have heard of it, however, a quick YouTube search shows a vast amount of videos dedicated to Resolve, which was perfect.

Resolve is offered on OSX, Windows, and Linux. Well, it's offered for CentOs and RHEL, for my use I had to run through some hoops just to get it installed on a Ubuntu machine

Looking through the videos this looked perfect for what I needed, something thats truly comparable to the premium products (nb: Resolve is a premium product with a free offering). The tutorials of effects etc ... Was perfect and looked very easy to use. Unfortunately, the videos were as close as I got to running it on my machine using Linux. Sure, the installer was converted to Deb package and I managed to install it successfully. Furthermore, I was able to launch it to get the introductory wizard. I managed to go through some of the key features and set up my keyboard layout and videos folder... And then nothing. A big fat nothing.

I was soooo close, and Im greatful that such a software is being made available for Linux and at a great price. I would like to support the company for their efforts and encourage for them to continue, and for this reason I'm installing windows so that I run resolve.




Friday, August 10, 2018

Trying out Ionic 4


Ionic 4 is now in Beta which brings breaking changes to your application - you can read about the benefits that Ionic 4 brings to the table here. This article will be a living document where I'll cover my experiences with Ionic 4, so please be prepared for new information to be added to this article and information to be removed (if it is not valid). .

Ionic 4 Documentation

Since Ionic 4 is in early beta there is very little documentation available and the official documentation is no where near as complete as what I was used to with Ionic 3. Since I mainly use Angular for my frontend development, the main change with the official documentation is the lack of angular-ish documentation. The main reason as I feel the reason behind this is because Ionic 4 is intended to be framework agnostic, allowing it to be used with a wide variety of frameworks.

Ofcourse, this means it makes my life harder. At present the documentation for Ionic 4 is in beta, however, the documentation site is badly missing search features. Which makes migration for early adopters a nightmare of manually reading through documentation. If the ionic team are reading this, I would encourage you to apply search facilities for the Ionic 4 documentation to allow a smoother transition between Ionic 3 to 4.

Installation 

To get started with Ionic 4 you simply have to get the CLI updated to v4.

npm install -g ionic

Next, to use the new templates you need to use --type=angular at the end. I.e

ionic start myapp --type=angular


Migration from v3 to v4

If you are that way inclined, you start migrating your v3 project to v4. The way that I had migrated to v4 is manual migration, instead of using tools. This allowed me to understand the breaking changes and what was changing from v3 to v4. This is where the reliance of the community, stackoverflow, and the documentation came in handy.

To do the mannual migration, you need to first copy your current project to a new directory. Next use the CLI to create a new project template :

ionic start <myapp> --type=angular

Once your template of your app has been created using Ionic 4, you can start by slowing migrating your project across. To do this I opened two copies of my IDE (in my case I use Visual Studio Code) and generate the pages/providers/services etc...

Please note... Ionic does provide a migration linter that can warn and sometimes fix the errors.

Breaking Changes


Where's the Providers

In Ionic 4 along with Angular 6, providers as knew them are now called services (as we knew them), so instead of doing :

ionic g provider <providername>

use

ionic g service <servicename>

What happened to ionic-angular import ? 

The import of NavController etc... from ionic-angular now needs to be imported from @ionic/angular. Therefore your import statement will be :

import { NavController } from '@ionic/angular';

What happened to IonicPage ?

I used IonicPage to do lazy loading in Ionic v3, this is no longer required. See navigation below.

Is NavParams still required ? 

NavParams can still be imported from @ionic/angular however, I haven't found that I have needed to use it. Instead I had rolled my own singleton service pass data between components, services, and pages.

What happened NavController ? 

NavController is still what you use to move from one page to another, however, in Ionic v3 we used .push and pop() method (push to move forward, and pop to move back). This is theoretically still the same, however, the navController has changed to .goForward() and goBackward. The changes also means that the navigation is handled using angular routing.

Check out src/app/app-routing.module.ts if you used the cli to generate the pages then a route will automatically generated within app-routing.module.ts. This will be an entire article by itself, however, for the time being to get yourself moving quicking in your migration check out what the cli and the template have generated for the routes and familiarise yourself with it.

The NavController.goForward method takes a string as a path which is the routing path.

So if you have route about  in your routes, then you would use NavController.goForward as

navController.goForward('/about');

Where is the back button in the pages ? 


In Ionic 3, the back button is automatically added to the pages. When you are manually migrating from v3 to v4 you may have noticed that the pages that you are generating doesn't have a back button. You will need to manually add these in if you want them (I'd guess you do).

My buttons don't render properly 


In Ionic 4 the html element for a button is ion-button, in v3 you may have had something like this :

<button ion-button (click)="myclick()">Click My Button </button>

this button should now be written as

<ion-button (click)="myclick()">Click My Button</ion-button>








Sunday, February 25, 2018

VisualStudio Code Hide JS Files

If you are working with Visual Studio Code and working with Typescript you'll soon notice that you are cluttered with JS files that are equivalent to your typescript file (these are the compiled/interpreted versions).

To get some order in your workflow, its often to get them out of the way and you can do this by editing the settings. To do this first open settings via File > Preferences > Settings  or use the keyboard combination CTRL + ,

Once your settings is opened simply place the following lines

"**/*.js": {"when": "$(basename).ts"},
"**/*.map": {"when": "$(basename).map"}

My whole file looks like this :

{
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/*.js": {"when": "$(basename).ts"},
"**/*.map": {"when": "$(basename).map"}
}
}


This doesn't hide all js files, only the files which have a typescript file.

Saturday, January 27, 2018

Possible solutions to getting react native app built

This document is a work in progress, I'm documenting the errors and pitfalls of developing in react native under Ubuntu. This is documented in the hope that someone finds this useful or if I need to refer to this again at some point in the future.

I am by no means an expert in this, I'm documenting what I have encountered and what had worked for me. I only advise that you can try these out at your own risk, as I cannot accept any responsibility.

Issue: Could not determine java version from '9.0.1'.


Solution :
From your project directory navigate to the directory "android/gradle/wrapper" and edit the file gradle-wrapper.properties and update the distributionUrl to the following :

distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip

Issue: Sdk location not found


Solution : From your project directory navigate to the android directory and edit the file local.properties (create it if it isn't there)

sudo nano local.properties

then enter the following line and replace <username> with your username

sdk.dir = /home/<username>/Android/Sdk

Issue : Failed to notify project evaluation listener.  javax/xml/bind/annotation/XmlSchema


Solution : Downgrade from Java 9 to Java 8

sudo apt-get remove oracle-java9-installer
sudo apt-get install oracle-java8-installer


if it comes back with an error for oracle-java7-installer then run the following command:

sudo dpkg -P oracle-java7-installer
sudo apt-get -f install 


Issue : ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-9-oracle


Solution : 

find the java location using 

readlink -f $(which java)

copy the path without the bin/java at the end and run this command and paste the path 

export JAVA_HOME="<path>"

Issue: The SDK Build Tools revision (23.0.1) is too low for project ':app'. Minimum required is 25.0.0

Solution : 

from your project file goto android directory and edit build.gradle file and insert the following :

subprojects { subproject ->
    afterEvaluate{
        if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                compileSdkVersion 25
                buildToolsVersion "25.0.1"
            }
        }
    }
}

Issue: /bin/sh: 1: adb: not found


Solution : 
Update your path to point to your platform tools


Issue: Double Tap R to reload - How? 


Soution : I used CTRL + M, and menu shade will be displayed where you can choose to reload. 



Tuesday, January 9, 2018

React Native CLI Commands

This will be updated with react-native cli commands that I come across as my reference:

Creating a project 

react-native init <project_name>

i.e react-native init helloworld

The first time you run this command it will take a little while to download all the dependencies for your project.

Run App in IOS 

Execute this in your project directory (i.e cd helloworld)

react-native run-ios

Run App in Android 

Execute this in your project directory (i.e cd helloworld)

react-native run-android



.