Skip to main content

Posts

Showing posts from May, 2020

WSL and Windows Terminal

I've been back on Windows now for awhile, and WSL has made it quite an easy adjustment. You still get the occasional "WTF Windows" moment, especially after a big update - but I'm pretty happy with it. At the time I just couldn't justify splashing out for a pricy macbook with no escape key and a stupid "hotbar" thing... Anyways, if you're used to working in the LAMP stack and haven't tried out the combo of WSL and windows terminal, give it a try! Or at least try WSL if you don't use command line much. WSL (Windows Subsystem for Linux) basically lets you run linux inside windows. I use it to then run MySQL and Apache/PHP - and I'm good to go. Most of my work happens inside a Windows Terminal window, which has become a pretty slick, configurable terminal. I have a 'projects' directory set up, in which each of my various projects reside. When I want to work on one, all I have to do is edit the apache config to use that particular

Security Tips - Passwords and Logins

Passwords are something we all have to live with. There are other authentication methods slowly coming into use (i.e. two-factor) but it's hard to see passwords going away anytime soon. I assume everyone knows the basics - use "good" passwords, don't share them between sites, don't write them on a sticky note on your desk, don't save them in a file named "passwords.txt" on your computer, etc etc. That's all well and good, but there's so much more you can do! Good Passwords A "good" password is hard to guess, is what we're told. I think most people are unclear about what exactly "guess" means. These days, it means that it needs to be resistant to password cracking attacks that are getting ever more fast and sophisticated. Just making sure that you have numbers, characters, upper/lower case, etc isn't enough. The gold standard most important thing about a password is that it is long . The longer the better.

Security Tips - Incognito Window

A lot of people know what incognito mode (or private mode) is at some basic level. They should use it when they want to do something "private" on the web. But I think most people don't actually understand what it means and how/why to use it. Perhaps this will help. Before we start - cookies are little bits of data used to track you between page loads. Think of it like a fingerprint. They're extremely important for session handling, so that a site can remember who you are from one page to the next. But they're also really handy for things like advertising services to track your activity on the web. When you open a new incognito window (and don't have one open already) - you're starting a new session in your web browser that doesn't have any of the cookies or caching that your "normal" browser window has. In practical terms, this means that when you visit a site, they won't have any history of you (mostly) and you may need to relogin,

Setting up SEO-friendly URLs in htaccess/PHP

This is something I feel like I've done dozens of times over the years, and always have to waste some time googling before I figure it out. Maybe next time I'll remember to look here? So, you're writing a custom site, and you need to be able to handle SEO-friendly URLs. You know, the kind where instead of something like "category=my_category&page=233" you the URLs to look more like "/my_category/my_page" Those are called SEO Friendly URLs and really they're also just plain friendlier for people too. They're really kind of a leftover from when a lot static HTML sites were really organized with subdirectories full of HTML files - and Apache will still work like that "out of the box" My usual approach to this has two parts. First, there's a custom .htaccess file in the main site directory, that redirects all requests (that are not for actual files/directories) to index.php Then, in the index.php there's a bit of code