Revisiting old posts

At the beginning of 2014 (like.. last week) I decided to re-launch my personal site. I thought this would be a simple process but as I look at old posts, I realize how quick technology changes and it angers me. Also, how awful some of my previous posts were written up.

“Who cares? It is what it is! Move on with your life!”

“Just import all your old posts. Update them as you can. It’s fine.”

“NO! These are awful. You really need to go through them one by one and totally redo everything to be perfect or it will just nag you incessantly. I WILL nag you incessantly.”

So I finally stopped arguing with myself — it was weird and upsetting those around me — and decided I was going to go through each one at different levels of re-writing. Some I’m just fixing some formatting and they’re going up… Others, oh man.. so much has changed!? How did I ever think I knew what I was talking about?! How did I not realize the futility of attempting to be cutting edge and make a post about it on the internet?!

Install and Run Linux Malware Detect (maldetect, maldet)

Linux System Administration – Basics Series!

Linux Malware Detect (or just Maldetect / Maldet) is a great anti-malware tool that any Linux SysAdmin should be aware of. Works great with ClamAV installed as it utilizes the ClamAV engine.

Official project page here: https://www.rfxn.com/projects/linux-malware-detect/

Download & Install Maldetect

 Update Maldetect

The following commands will update the actual program and the malware definitions.

Run Maldetect

Personally, I would run this in a screen session so you can go on your merry way and come back to it later.

When scan is complete you can view the report by entering the command listed at the end of the scan:

or you can view the report file directly. they are located in

You can quarantine the files easily.

 

Admin + Apache + NGiNX accessible when using DSO php handler.

So you want your WordPress or Jooma or (insert other CMS with web dashboard here) to work but you also want to upload things via FTP and it keeps messing up permissions?

Most likely you’re (a) not on a shared host nor (b) using something like cPanel with suPHP as your PHP handler. In fact, you’re most likely running your own setup with the default DSO php handler.

Now you could just give everything 777 permissions (stand by for a post on why this isn’t as bad as people have lead you to believe but I still recommend against it!) or you could do the smart thing and make a group!

I’m going to show you how I typically work around this problem for my clients and myself, with a group!

Remove ACLs that could interfere

I find a lot of weird things on servers where people have been “playing” around with permissions that work. You can ignore this if you have never used setfacl before. This will clear whats there. -R being recursive and -b being to wipe

Change directories and files to be group readable / writable

Another common issue I find is that by the time I’ve been asked to help, my client has given up and made everything 777 but then got freaked out when they heard 777 is WORLD WRITABLE (AHHHH!! OMG!! Okay thats true but the ‘world’ ends at the server level). I always set folders and files back to 775 and 664.

775 and 664 vs 755 and 644 because we’re giving “group” some elevated permissions rather than just the user.

Setup the group and set permissions

Then I create a “www” group. You’ll also often see “www-data” or on shared hosts, some group related to your account number. This group holds all the users that need access to your files, in this example “admin” (as my ftp user) and “apache” as my Apache web server user.

Also, at the end, I grant group +s
+s gives it sticky permissions. This means the group retains the owner of its parent so regardless if “admin” edits the file or created a new file in the folder or “apache” edits the file or creates a new file in the folder, the group will always remain “www”.

If you’re using WordPress…

Almost everything I post is centered around WordPress. I do a lot of work directly related to WordPress so its fitting I have handy instructions for such a scenario!

WordPress doesn’t check to see if it can actually write. It just checks to see if the USER is the same as the webserver user then degrades down to a prompt asking for FTP credentials so it can make the change.

The following lines has wordpress actually check the filesystem and see if it has the ability to manage the file (which it will through group permissions) and it will maintain permissions of 775 and 664 for folders and files, respectively. (Default for WordPress is 755 and 644).

 

New site!

It’s January 2nd. I wanted a change. So I rebooted my personal site.

Feels good. Clean. Empty. Modern.

Maybe I should import the old content. yawn. Another day.

Zoe’s cupcake cookies

I LOVE Zoe’s cupcake cookies — they’re perfect for any party but especially winter holiday’s (as are all cookies..) — but I keep forgetting the damn recipe! So here it is. Where I can find it. Maybe I should post all my favourite recipe’s here and stop going crazy each time I need to make them, trying to remember how to do it.

Zoe’s cupcake cookies
Prep time:
Cook time:
Total time:
Ingredients
  • 1 package of yellow cake mix
  • 1/2 stick of butter
  • 1 package of cream cheese
  • 1 egg
  • 1 tsp vanilla
Instructions
  1. Mix all ingredients until well blended
  2. Refridgerate for 30 minutes
  3. Bake at 325 for 8-10 minutes