Jesse Lawson

buy me a coffee ☕ / home / blog / tutorials / portfolio / contact

Old Blog

These are some of my older writings, or writings that I have decided to call “old” and archive here. If you are looking for my recent writings, go here.

Apr 23 2019 in gamedev/
Dynamic Strings in C and a Crash Course in Pointers →

Since C has no string type, we use arrays of characters to represent something like a full name, a bio, or even dynamically sized lines of text–like a JSON string. Imagine a system where we needed to dynamically create strings whose lengths we do not know at compile time. How might we go about doing that?

The answer lies in pointers, pointer-pointers, and memory allocation.

This is a crash course in pointers, memory managment, and dynamic strings in C.

Oct 8 2018 in Waystation Echo/ Unreal Engine/ devlog/
Waystation Echo DevLog 6: Animations and Items →

When you first start out it seems like a lot of what you are doing is never going to pay off. Countless times I have sat in exhaustion wondering when I will see some progress on what I am doing; everything goes by so slowly when you are a solo indie developer, that when times of great progress do come, you have to remind yourself to stop and celebrate your accomplishments.

Sep 30 2018 in unreal/
How to get PNG transparency in your material →

If you try to drop a texture containing transparency onto an object, the material that is automatically generated is going to be incorrect. The same thing will happen if you try to create the material from the texture yourself. The reason is because you have to customize the material to understand that it is supposed to account for transparency. Just trying to drop it in automatically will result in some nonsense like this:

Sep 30 2018 in unreal/
Passing an enum as a function parameter →

I’m using Unreal Engine 4.20.2. Here’s how I am successfully passing an enum to a function for use in a TArray. In my Item.h file: UENUM(BlueprintType) //"BlueprintType" is essential to include namespace EInventoryItem { enum Item { Nothing UMETA(DisplayName = "Nothing"), Battery UMETA(DisplayName = "Battery"), Thing UMETA(DisplayName = "Thing"), AnotherThing UMETA(DisplayName = "Another Thing"), RedBadge UMETA(DisplayName = "Red Badge"), BlueBadge UMETA(DisplayName = "Blue Badge") }; } In my Character.h file:

Sep 29 2018 in devlog/ Waystation Echo/
Waystation Echo DevLog 5: Some bad video and animation updates →

I tried using Open Broadcast Server to record a demo of how I am handling arm animations, and to show off a little bit of the look and feel (in alpha stage, of course) of Waystation Echo. https://www.youtube.com/watch?v=29tPZVDhl8U Some things to note in this devlog update: I am constantly learning new things in Blender. Since teaching myself how to use it about a month ago, I have been going full-speed at modeling, texturing, and animating.

Sep 29 2018 in unreal/
How to Import a Custom FBX Mesh and Skeleton from Blender into Unreal Engine →

For Waystation Echo, I am using a custom armature based off of the UE4 mannequin. Since I want to practice making FPS arm animations, I decided to abandon any delivered stuff designed for the mannequin and make my own armature. Since this is a unique skeleton, I wanted to go over how I exported it from Blender and then successfully imported it into Unreal. In Blender I’m assuming you already have a mesh that you added bones to.

Sep 23 2018 in Waystation Echo/ devlog/
Waystation Echo Devlog 4: Big Decisions, Being a Solo Dev, learning Blender, and Biting Off More than I Can Chew →

Buckle up! This one’s a big one. No more third-person TL;DR: Trying to do my own animations for a third-person game is ridiculous and one of the dumbest things I have ever done in game development. An old Gamasutra article caught my eye this morning. In it, the author discusses the differences in player immersion between first and third-person games. While primarily focusing on shooters, I think the article speaks to a psychological phenomenon that all players experience regardless of the POV: a sense of empathy for the player.

Sep 3 2018 in Waystation Echo/ devlog/
Waystation Echo Devlog 3: No really, Unreal →

Waystation Echo was always going to be prototyped in Unity, but when it comes to actually building the game, I wanted to use Unreal. Now that the prototype is finished, I’ve grabbed a new copy of Unreal Engine and have been working this weekend on getting what I had in Unity up and running in Unreal Engine. The goals for the prototype were: Can I invoke a mysterious, dark, horror-esque feel to a remote space outpost on an asteroid?

Aug 27 2018 in Waystation Echo/ devlog/
Waystation Echo Devlog 2: Environment cleanup →

It’s been a long while since I’ve posted anything about Waystation Echo, the third-person survival puzzle game I have been designing for about two years now. I started integrating ootii’s Interactable Core with my custom door and charge handling scripts to see if I could save some time designing these puzzle doors. Ootii is incredibly talented and made basically the same thing that I did, except out of the box my materials looked a little weird.

Aug 24 2018 in gamedev/
Unity vs Unreal Fees - When does it matter? →

Game developers interested in Unity and Unreal will often ask about pricing. Both engines have paid tiers, with very specific caveats–and considerations for those of us interested in comparing the two from a price perspective. Unreal Engine requires you to pay 5% of your gross revenue beyond $3,000 per quarter. That means you can make up to $3,000 in any four-month period without paying royalties, but if you exceed $3,000 before that 4-month period is over, you will pay 5% royalties on the amount above $3,000.

Aug 5 2018 in Astromos/ devlog/
Astromos DevLog 1: Look and feel and the general idea →

So my daughter has been drawing a lot of aliens recently, and at night she likes to lay in her bed and draw while I work on my own art. This month (August), I promised myself I would focus my creative energies onto ONE project–which, if you know me, is a massive challenge–and that focus is going to be on Astromos. (I need something to distract from the fact that I have 30 more days until the Austin Film Festival results are announced!

Jul 21 2018 in webdev/ JavaScript/
Easy JavaScript testing for CodePen →

Looking to do test-driven development in CodePen? Consider TaoJS! Tao is a very tiny testing tool that’s perfect for places like CodePen. Using it is as easy as 1-2-3! Add the CDN to your external scripts Put <div id="tao"></div> at the bottom of your HTML Write your tests in your JS editor! Add the CDN to your scripts Click on the gear icon next to the JS editor and add the following CDN link to your external scripts:

Jul 16 2015 in Tutorials/
Nginx - Proper 443 (HTTPS) and WWW Redirecting →

Recently I was working on a project that required an Nginx server to redirect all traffic to https://domain.com, and by all traffic I mean anything that did not start with https://domain.com needed to be rewritten to that. This included: http://www.domain.com and http://domain.com https://www.domain.com To do this, the configuation file on Nginx should look like this: server { listen 80; server_name domain.com www.domain.com; return 301 https://domain.com$request_uri; } server { listen 443 ssl; ssl on; ssl_certificate /path/to/your.

Jan 27 2015 in sysadmin/
Automatically Block Banned IPs with fail2ban, iptables, and ipset →

In this tutorial, we’ll develop a script that will get all the IP addresses blocked by fail2ban on the ssh chain and then add them to an ipset that will be automatically blocked by iptables. Talk about power traffic management! One of the most frustrating parts about running a web hosting company is the exposure to spam and bad bot traffic. At DashingWP, I often have to scrub through IP logs to determine what traffic is legitimate and what traffic should be blocked outright.

Jan 27 2015 in sysadmin/
How to Build and Install Libcurl →

For many server-side projects that are designed to work with outside resources at the command line level, curl is a tool that I often have to use. This is especially true when I am writing programs in C that are designed to be used specifically with internet resources. In this tutorial, I’ll show you how to compile, build, and install libcurl on your own machine.

Jan 24 2015 in Tutorials/ Sysadmin/
How to Install CouchDB Locally and Enable CORS →

These days I’m doing all my development work on a Chromebook. Since the majority of my projects involve Apache’s CouchDB, I need a local instance up and running. In this tutorial, I’ll walk you through how to install CouchDB from a Ubuntu command line and enable CORS manually (by editing the config file).

May 1 2014 in AngularJS/ NodeJS/ webdev/
DIY AngularJS SEO with PhantomJS (the easy way!) →

September 11, 2019: This is a super old tutorial. I don’t think you will want to use this anymore.

Setting up your AngularJS development environment needs to include SEO best practices. For JS-rendered applications, take a look at this solid solution using PhantomJS.

I’ve been tasked with recreating a website for a higher education institution and I want to capitalize on AngularJS technologies to provide a rich user experience. Unfortunately, one of the largest issues with using the SPA approach to business/corporate/education web design is search engine optimization; AngularJS, and any JS-rendered application framework, is not SEO-friendly. To get around this, we need a way to serve search engine bots a set of pre-rendered HTML pages. Our goal is to create a development environment for AngularJS SEO awesomeness. In this tutorial, we’ll walk through how to get PhantomJS up and running right alongside our app using our Yeoman AngularJS scaffolding that comes with small development server. We’ll go from having nothing to having a full development environment, complete with verifiable pre-rendered page cache for bots to eat up and enjoy.

Mar 30 2014 in Nginx/ WordPress/ sysadmin/
How to Backup WordPress on a Remote Server (and send it to Amazon S3) →

Let’s talk about backups.

When you are running your own WordPress hosting service, you need to ensure that your sites are backed up nightly. Unfortunately, the more sites you have on your server, the more processing power is required to do these backups, especially if there have been a lot of changes during the day.

The smartest way to proceed with nightly backups, then, is to offload the processing requirements to a separate, dedicated backup server, or just a secondary server that can afford to use a lot of its CPU in zipping, rsyncing, and uploading to the Amazon cloud.

Jan 25 2014 in Sysadmin/
What do malicious log entries look like? →

A good server admin will be scrubbing her logs constantly. Whether you do this automatically or by hand, there is one thing that is a sure sign of malicious behavior: the ol’ “they forgot to delete that file” trick.

Jan 9 2014 in sysadmin/
How to fix "Host key verification failed" error →

If you’ve ever rebuilt a server that you have connected to in the past, chances are you’ve received an error when trying to ssh back into it for the first time since the rebuild. If you’re getting a screen that says “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!", the workaround is actually quite simple.

Jan 8 2014 in sysadmin/
The Problem with Anti-Spam Plugins →

Installing anti-spam plugins are only the first step to mitigating garbage traffic. If we really want to tackle the issue of spam, we need to approach it from the server’s perspective and thwart garbage requests before they’re served. Is this possible? The short answer is: it depends.

Dec 20 2013 in sysadmin/ WordPress/
WP Engine Hotfix: Preventing Spam and Bad Bot Traffic, Part II →

In [Part I][1] of this WP Engine Hotfix, I discussed some of the theory behind WP Engine’s visitor calculations and how end-users of WP Engine could benefit from taking charge of their traffic themselves. In this next part, I’ll discuss ways to log your visitor traffic, scrub that traffic for blacklisted and abusive IPs (as well as employ a nifty contact form honeypot), and completely block access to your site by these harmful bots, scrapers, harvesters, and spammers that jack up your visitor count.

It’s important to note that this tutorial is not WP Engine specific. You can employ these methods on any hosting environment in which you have access to Apache. If you’re on Nginx, I’ll cover how to block unwanted traffic in a different tutorial.

Dec 18 2013 in sysadmin/ WordPress/
WP Engine Hotfix: Preventing Spam and Bad Bot Traffic, Part I →

WP Engine counts traffic from “bad” bots (like harvesters and spam bots) the same way it tracks human visitors. While some people have gone to great lengths to talk about how this has dissatisfied them to the point of leaving WP Engine, steps can be taken to take charge of your website’s defense and disallow these bots from ever making it to your pages. In this article, I discuss how to find out who is really visiting your blog (raw metrics), how to filter out the “bad” bot traffic, and (hopefully) reduce your visits in WP Engine’s algorithm.

Dec 1 2013 in webdev/ WordPress/
WordPress Asking for Local FTP Credentials on XAMPP Solved →

A few developers were asking why their localhost instances of WordPress were asking for FTP credentials when trying to install new plugins and themes. If you’re getting the dreaded “Please enter your FTP credentials” page and you’re running XAMPP for your local WP development environment, do not follow the popular StackOverflow answer that tells you to chown your wordpress folder to _www. Read more for the real fix.

Nov 30 2013 in MySQL/ sysadmin/ WordPress/
How to Find and Replace a String in MySQL →

One of the problems with moving your site from one domain to another is that the images in all your posts are still served from the old setup. In order to fix this, you need to run a simple MySQL command that will search through all your posts and replace the old URL with the new one.

Oct 28 2013 in WordPress/ sysadmin/
NGINX + WPMU + Non-WordPress Subdomains →

I’ve been trying to configure a subdomain on a WPMU install that runs on Nginx that is not part of the WPMU network and have ran into nothing but problems. In this post, I discuss some of the problems I ran into while trying to setup non-WordPress sub-domains alongside a WPMU sub-domain site and how I got both WP and non-WP sub-domains working and correctly configured in Nginx (hint: I didn’t).

Jun 24 2013 in webdev/ WordPress/
Custom Category Style in WordPress →

When I worked for an online newspaper, we put a customized header image at the top of every category page sort of like how NYTimes does it for their blog pages. These days, it’s a lot more attractive to use custom CSS styles for each category. In this tutorial, we’ll create a custom category style in WordPress so you can add your own CSS to pages belonging to a specific category.

Jun 24 2013 in webdev/ WordPress/
dropzone.js WordPress Integration Tutorial →

Over on the Hacks forum at WordPress.org, user Manwoll was looking for a way to add drag-and-drop functionality to a contact form in WordPress. Not a fan of commercial contact form products myself, I sought out a method of doing this that would most accomodate a theme developer who is working on a custom solution for a client. The solution involves using dropzone.js and some basic PHP, and the end-state is a fully-functioning drag-and-drop box on a WordPress page that uploads files straight to your WP uploads directory.

Jun 24 2013 in news/
Easy Author Image Plugin for WordPress →

Easy Author Image gives you the option do you exactly that — easily add an author image to your profile page. Once you install this plugin, you’ll have a new option in the Your Profile tab (under Users) called Profile Picture, complete with a media uploader box that allows you to upload your very own author picture.

Jun 24 2013 in webdev/
WordPress Author Box without a Plugin →

In this tutorial we’re taking the custom author image function we created and turning it into a custom About the Author box in WordPress. If you haven’t already done so, go through the [custom author image tutorial][1] and follow the steps involved in creating our custom author image function.

Jan 1 0001 in MySQL/ sysadmin/
Reset MySQL Root Password on Ubuntu →

Do you know why there are so many tutorials online about resetting the MySQL root password? Because so many people are doing it wrong. This is a down-and-dirty, super quick way to reset your root password for MySQL.

Jan 1 0001 in sysadmin/
Three Ways to Increase Security against Bad Bots and Spam →

DashingWP’s servers were under attack today from what appears to be a pretty nasty DDoS attack that originated in China, bounced off of Germany, and then hit really hard from the UK, Portugal, Minnesota (USA), New Jersey (USA), and parts of Utah (USA). In total, there were 26,491 IP addresses that were discovered to be part of the attack, and we’re not entirely sure whether or not it was a roving attack or if something targeted us specifically.

After defeating this problem, I thought about some of the things people could be doing better in order to help prevent their susceptibility to DDoS attacks and spam/bad bots in general. While we’ll never be able to fully prevent a DDoS attack from happening, we can go out of our way to strengthen our infrastructures defenses against spammy and malicious bots that lurk out there, and in doing so, lessen the likelihood of irreparable damage if and when we fall victim to a DDoS attack. In this article, I’ll share with you three preventive controls that you should be implementing in order to lessen your vulnerability and harden both your server and your sites.