Past Entries...

100 posts since April, 2016!
posted this in: General, Software, Technology
182 Words

We have a new look for the blog! I hope you all like it 🙂

For those that are curious, below is how things used to look (not too long ago!)…

How my blog originally looked

I’ve been using a theme called Independent Publisher now for about 7 years or so. And while I am indeed retired; I didn’t want to let my technical skills (as little as they are) go to waste nowadays. So I updated the look to both jtiong.dev, and jtiong.blog to match similarly in branding now 🙂

It’s been more than a moment since I last touched a WordPress Theme, and so I’ve no doubt that there’s bugs and issues with the new theme you see now (built from scratch lovingly over a day or so, as you’ll be able to see from the Commits on jtiong.dev!). But this change will give me plenty of things to do to fix and maintain for the future with this blog.

And now finally after most of a day’s work, my domains are starting to be a little bit more on-brand! ♥

posted this in: Software, Technology
310 Words

I previously posted about jtiong.dev – keeping my commit logs going and making things presentable for future collaborators and colleagues, as well as my own little bit of self promotion on the internet.

With my recent break in work and taking the time to both sharpen and upskill myself – I thought I’d bring this into the new future with the site pulling from my Github account instead of a now defunct GitLab installation.

In the current “1.0” version:

  • Commits are automatically fed through via CURL request
  • There’s no censorship for any potentially sensitive information
  • There’s no authentication for management of commits/repos
  • There’s no filtering you can do
  • The date/commit times are inconsistent

Not to mention it’s GitLab powered and as I’m currently working through some property changes – I’m bouncing between two properties and the server hardware hosting GitLab is currently turned off.

Queue, my move to using Planetscale as my core DB service for my personal online stuff, and moving my code to Github where possible (because it’s where everyone else is).

For version 1.1 which upgrades this, I’d like to add:

  • A system with Auth that lets me hide a repo, or a given commit hash for any potentially sensitive info from being revealed
  • A filtering system by repo so you can see, per repo, the commits to that repository
  • More accurate representation of the commits/date/timeline

Implementation Logic

Just a couple of loops to go through Repos → Commits is all I really need for my personal scale. Below is a very simplified diagram:

This’ll all be included into some cron tasks that run maybe hourly or so to avoid spamming GitHub.

It’s just simple little pleasurable busywork to be honest, but after about 6 months of not really touching any code and taking my time with stuff, it’s nice to get back into the groove!

405 Words

Recently with my career, health has become a thing I’ve been a lot more conscious of. Physical, mental, etc. So I’ve made the decision to move to 3 days per week, leaving Thursday and Friday available to me for health care and rest.

I’d like to eventually transition to a career in which I can work more independently as well, and the career options are pretty simple:

  • Come up with a product – build and sell it (SaaS, etc.)
  • Come up with a service – promote and sell said services (Contracting, etc.)

I have a couple of projects and things that I do which fall into the second category – I do some web hosting and consulting on the side, which produce some income for me. So I feel like I could certainly return to pushing those paths a bit more if need be.

Games are a passion project…

– me, now.

However, I’ve always wanted to build a game. Since I was a kid playing Super Mario Bros. on the NES back in the 90s, all the way through my adult life – I’ve always been a gamer.

In my mind, games aren’t something you build to make money – sure there’s that one in a million opportunity to build a Minecraft, or the next World of Warcraft. But that’s both extremely rare, and extremely difficult to achieve. Games are a passion project, and if you’re lucky, you get a financial reward if you find something that strikes a chord with the gamers who try your game out.

I’m at a stage in my career where I can afford one last hurrah at a passion project beyond the gaming events and marketing adventures of yesteryear.

Time to give it a go!

Do you have a plan?

I’m not quite sure about the games I’d like to make yet. But I think the plan is to build:

  • Some basic indie games to learn games development, and;
  • learn some basic art creation (2D – Aseprite, 3D – Blender) to flesh out said games, and;

In terms of sound creation and audio design – I may just leave to 3rd parties, if I’m honest – Audio is always and will forever be a dark magic for me

Okay…

So why am I blogging here about something I haven’t even started?

To keep myself publicly accountable. I’ve already told my mates on Discord, now I have to just execute 😂

posted this in: General, Software, Technology
113 Words

This blog entry is more of a personal reminder – and now it’s somewhere on the internet in theory it shouldn’t ever disappear.

I do a lot of PHP related coding in my day-to-day. Be it website projects all the way through to browser-based applications, both professionally and personally – I think I’ve hit a point where VS Code – my editor of choice, is finally covering almost all my use cases.

The extensions in question:

  • Alignment by annsk
  • Diff by Fabio Spampinato
  • Docker by Microsoft
  • Format HTML in PHP by rifi2k
  • GitLens by Eric Amodio
  • PHP DocBlocker by Neil Brayfield
  • PHP Symbols by lin yang
  • phpcs by Ioannis Kappas
  • Prettify JSON by Mohsen Azimi
  • TabOut by Albert Romkes
posted this in: General, Servers, Software, Technology
863 Words

This is mostly a personal note on how to setup a workflow with my Web Development (PHP/MySQL & Docker based) projects. Usually, with pretty much any project, the workflow goes as follows:

file

Figure: My workflow prior to this article



To host my own repositories of codes per project, I actually use GOGS which is short for Go Git Service – it’s written of course, in google Go, and is essentially a self-hosted Github clone. It’s by one of the devs from the Gitlab team, and it’s far more lightweight and easier to use in a personal scope, than Gitlab (Gitlab is still wonderful, but I think it’s better suited to teams of 2 or more people).

Git hooks are amazing!

The above workflow diagram though, is missing one really critical stage – getting the code to production – a.k.a. deployment. Typically on any deployment, after the above workflow, I’d either remote in, or set up a cron job to pull from master. There’s some problems with this method of doing things:

  1. I’m doing a git pull which is based on merges, and can really cause some shit if there’s a conflict (there shouldn’t be, but just in case)
  2. I’m remoting into the server each time I have to pull for some commits, this takes up time. I’m a serial commit/push-as-save person
  3. It’s completely against the ethos of a developer. If I’m doing something repeatedly, I should find a way to automate it!

So, enter stage – Git hooks. Git hooks are amazing! They’re actually natively supported by Git (powered by Git) and I only really just started learning about using them. I vaguely recall encountering them earlier in my growth as a dev, but I must’ve shelved it at some point and given up trying to learn hooks (probably around the same time I cracked it at Drone CI, and Jenkins CI/CD).

Anyway, the overall concept of using a Git Hook is that I reach the final stage of the workflow I drew at the start of this article Git push to remote repository – the idea is that the Git repo then registers this push in something called a post-receive hook. It then performs some functions and essentialy plonks a pull of the latest code of my repo, into the production environment.

At first, I started off with something super simple, from my jtiong.com (this website!) repository as an example:

#!/bin/sh
ssh [email protected] 'cd /var/www/jtiong.com && git fetch && git reset --hard origin/master'

Unfortunately, this didn’t seem to work. I kept getting remote: Gogs internal error messages, and figured out it was something to do with my SSH keys not working in the authorized_keys and known_hosts files of the docker container to server shell and vice versa. After a lot of Google-fu and tinkering around, I eventually came up with the following which worked (note, it’s been edited to be a generic solution).

#!/bin/bash
ssh -o StrictHostKeyChecking=no [email protected] -p 22 -i /home/git/.ssh/id_rsa 'cd /project/folder/path && git fetch && git reset --hard origin/master'

It’s not entirely necessary, but I used the -p and -i options to specify both the SSH port and identity file used with the SSH connection (just for greater control, you should be able to remove them, your results may vary). The key section of the above command that I want to highlight is the -o StrictHostKeyChecking=no option that I’ve set. This got rid of any Host Key issues between the docker container and the host server for me. So if you’re encountering issues with your Host Key Verification or similar, this might fix your problems!

With the git command now, I used git fetch && git reset --hard origin/master instead of just doing a git pull. Why? Because git pull uses merge methods and can result in some conflicts with code, and issues that are just messy and a bad experience to untangle. Using git reset, moves the code’s pointer to a different commit without merging anything. It just overwrites it, making it slightly safer for deployment!

But of course… Why do things in just a simple way? This particular hook configuration is great for something like my personal site where I don’t mind if I’m pushing breaking bugs to production (within reason). However, when I’m doing work for clients, I need to be a little bit more careful – and I use a more typical productionstagingdevelopment branching method with my Gitflow.

Here’s what I use now:

And wonderfully – this lets me have separate branches, as required and updates the appropriate (sub)domain as needed! The wonder of Git Hooks has now streamlined how I develop projects, and deploy them in a much more pain-free manner! And so I dramatically take another step in my journey and growth as a developer haha 😛

posted this in: Servers, Technology
240 Words

So, I’ve started dabbling in games development with a few game ideas I’ve got bouncing around in my head. And whilst I wanted to make wonderful, amazing, visual feasts of games – I also wanted to start a bit slower and ease myself into what is essentially the most difficult discipline of software engineering around.

Cue, LÖVE – an engine dedicated to 2D games (there are 3D libraries available for it). It uses LUA, and pretty much encourages diving straight into the code and learning how to make a game, as opposed to learning the tools and figuring out how to use a suite of (albeit amazingly powerful) tools.

I worked on some basic tutorials last night, and I’m enjoying learning both LUA and the engine right away. It’s quite logical from what I can tell so far and I found a few tutorials especially helpful in understanding what’s going on:

I’ll probably start blogging a little bit about my upcoming game idea and my adventures in tinkering around with the LOVE 2D engine. So stay tuned!

374 Words

Remote Desktop more than covers my use of productivity on JT-NXS, my laptop system that’s based at the office. So far, I’ve been fortunate in the last 10 days or so since moving towards ‘Cloud Citizen’ status, that I’ve been at my desktop, JT-DXS and not needed to use JT-NXS as much for productivity.

The experiment so far has been a wonderful successespecially when it comes to Media Consumption – it’s been awesome being able to access a personal collection of media that some close friends and family are also able to access.

Gaming has been great, for anything that’s not on a pressured level (ie. competitive play like Overwatch, or CS:GO – even then, they’re fine, but I just feel more comfortable not leaning on the internet connection so much to remain competitive with other human players). Co-op games are a revelation with it, Parsec.tv have really outdone themselves in their compression algorithms and gaming performance over the net.

I think, if when I pass probation at my workplace, I’ll commit to buying a mini-ITX system to accommodate a spare GTX 1070 graphics card I have, and allow for a bit more storage space too (dual 4TB drives + 3TB existing storage)

I’ve got plans at least, to rearrange my equipment at home; to minimise waste, and reduce the soaring temperatures in my bedroom, too. Even in the dead of winter it’s still a warm toasty room that can get quite uncomfortably stuffy as well.

Anyway, 10 days in and I’ve started rolling out some productivity tools onto JT-NXS in anticipation of using the system for more work-related and project-related situations.

I’ve got:

  • Git, with Git Bash as my terminal
  • Adobe Creative Cloud
  • Visual Studio Code
  • Office365

For the most part, I actually already use Google Docs/Spreadsheets almost obsessively to manage my documentation, and I’ve got my own personal BookStack that I use as a personal Wiki and Knowledge Repository.

All in all, I’m slowly training myself to wean off my attachment to my desktop, and to be able to start working from anywhere on a laptop (an old Microsoft Surface Pro 1 – although I plan to use JT-NXS in 3 months time) or tablet (iPad Pro).

posted this in: Software, Technology
892 Words

So, as you read in my last post – I recently got a new Gigabyte Laptop to start using as my all-in-one gaming and development device. This has recently meant that I’ve returned to the Windows ecosystem after developing and coding in Unix/OS X for the last 2.5 years professionally.

It’s a helluva change…!

My previous working arrangement was:

  • Sublime Text 3 as my primary text editor for coding
  • The built-in Terminal application to handle my SSH shenanigans
  • Filezilla FTP for any GUI based file transactions needed

Admittedly, the above covered about 99% of everything I needed to do. Over the last few days or so, I made do with an almost similar compromise in Windows:

  • Sublime Text 3 works just as well in Windows for coding and development!
  • Git Bash — which comes with Git for Windows is pretty darn great too! It’s a very nice alternative to the Windows Command Prompt, and works much like a Linux terminal.
  • WinSCP – solves my need for GUI file transactions; it’s less bloated than Filezilla FTP (in my opinion anyway)

This essentially matched everything I needed to do; but I’ve now also made the jump to Atom – the free editor/pseudo-IDE from the Github team. When I first tried Atom it had a lot of small, tiny little issues that kept me from using it as my primary coding editor. They all appear to be fixed now; and it has the equivalent plugins that I use in Sublime. I suppose in theory, this list is a lot more for my own personal use, than for any sort of public disclosure:

atom-beautify – lets me implement PHPCBF (part of the PHP Code Sniffer package) to automatically ensure my coding is to PSR-2 standards; it’s not 100% perfect, but it saves a lot of time with what it can fix.

atom-alignment – this is both for aesthetics and sanity. It basically lines up repetitive lines of code, such as array assignments, etc. So that it’s a lot more readable, and quicker to understand. For example:file

emmet – I was always a bit hesitant to use Emmet when I first started out using Sublime Text; I figured, another bunch of shortcut keys to learn isn’t going to be as productive for me as just using raw power and speed to bash out whatever code was needed. Boy was I wrong. The shortcuts are really actually just one shortcut, and the syntax is logical and smooth. Definitely thrilled that this is available for both Atom and Sublime Text.

git-control – Atom’s native git tweaks and this package are what tipped the balance and made me decide to switch from Sublime Text. Git-Control is still heavily in development, but it provides a basic UI for you to do some quick git operations. It’s not as rapid as opening up the command palette and punching in ‘commit’ or ‘push’, but it does let me easily select files to commit in specific pushes, etc. As eLeague.gg’s platform gets more and more complicated; I find myself grouping my commits a little more for better coherence when I’m reviewing code and what I need to do. This certainly beats doing everything via the Sublime command line.

It really needs to be noted though, that for git-control to use your existing SSH agent and SSH key settings; you’d best install the Microsoft Git Credential Manager for Windows. It’ll automagically work whenever you use git across anything, and it solved what could have been hours of tinkering for myself. I had discovered it early on while trying to tinker around and getting my environment working… huge sigh of relief!

Things I’ve installed but they’re kinda optional…?

gitKraken – learning more about the Electron platform for building desktop Apps (it’s what’s behind the Atom Editor); I came across gitKraken. It’s a very attractive git GUI that does have its benefits (like managing merges, and conflict resolution) – but being the solo developer on the project so far, I haven’t had many issues with this, and it’s minimised even further now by my moving to a single computer for development… We’ll see how it goes?

Composer – I normally use composer as an autoloading assistant in many projects of mine (in fact, every project I have right now!) – and I wasn’t so sure about installing it on Windows; thankfully recent updates by the Composer team have made that ridiculously easy. It automagically adds it to the environment path, and system variables; and it extremely simplified the PHPCBF (PHP Code Sniffer package) installation for me.

mRemote-NG – I can easily use Git Bash to SSH into servers, but that would involve managing multiple windows, and remembering all the credentials (whenever there’s no SSH key available). mRemote offers me a centralised area for doing all that, in tabbed windows. It hasn’t gotten that much mileage from me yet, as most of the time my development is all local now, and deployment is mostly automated. But, it’s still very handy to have!

That pretty much sums up everything…

There’s one more app I installed, but it’s more focused on my transition from deploying to a world-accessible development domain, to a local development environment.

posted this in: Gaming, Software, Technology
614 Words

eLeague.gg is rapidly growing behind the scenes, and this is especially true in regards to the tech development team behind the scenes.

Our current development team consists entirely of one person (yours truly) and my duties involve:

  • Coding behind all the site’s actions (more on this later)
  • Designing everything visitors see on the site
  • Writing all the content on the site
  • Designing the structure of the site, processes and user flow

Not to mention all the maintenance involved…! So the obvious solution, is to bring on board more people! The exceptionally talented1 :

  • PSmith a long time LAN party regular at my events and volunteer admin both at my events, and at PAX Australia
  • SirSquidness the well known server/network/LAN guy from Respawn LAN, Melbourne (also same for PAX Aus PC Area)

So…. What’s the problem?

Well, since I started out running LAN parties, and doing gaming events – all my sites have always been bespoke, from the ground up creations. All involving myself as the sole designer, and sole developer. I’ve never had to answer to anyone and in fact, never had to consider that someone else might come in and develop on my sites/projects. Again, this is certainly horrible practice and not something any developer should really do.

And so again, as eLeague.gg started up – guess what I did? Haha…

And now? What is the solution?

Git branches. I already develop everything and store it through a personal Git repository system (I use Phabricator for my Git repo management needs).

As it currently stands, I keep:

  • A branch called staging: this is for testing, development and experimental content creation.
  • A branch called production: this is for everything that is on the live eLeague.gg website.

While this stops me from accidentally implementing broken features (sort of) it’s still not ideal for three developers working all at once on eLeague.gg’s core code. So we’ve developed a way to organise ourselves in such a way that each developer is independent, but bases their code off a singular source of truth.

This looks like:

file

What’s more important is the flow of code as signified by the arrowheads in the diagram above. Developers should in theory, only ever be pulling and pushing features in both directions from the Dev(elopment) Branch. And all features should be internally vetted within the Tech Team before being pushed to the Pre(flight) Branch, and then onto the Production Branch if all goes well with the rest of the team.

Some caveats:

  • No more than a single developer should be working on a single feature at a time. If multiple developers are needed, then one dev needs to stop working on said feature, before another dev takes over.
  • There is a degree of potential data and code entropy over time between all three branches – dev, pre and produciton. As such, only JT (me) will have access to being able to merge ‘backwards’ from Production > Pre > Dev.
  • Setting up for three developers simultaneously also means we now have a bigger delay in rolling out features as everything needs to now be spec’d, documented and planned out.

I suppose it’s a great little situation to be in that I can start working on eLeague.gg in earnest with a team, and now I should hopefully be able to focus more on not just the technical development of eLeague.gg, but the rest of it too!


1: This list of people does not use names they uses their drivers’ licenses. Our team has many people with the same given names so to help differentiate, we refer to each other by our gamer nicknames.