Tag: blogging

Resolutions: Why Have Them and How to be Successful

Resolutions

What’s Up With Resolutions?

It’s that time of year! You know, where everyone is thinking back on all of the things they wish they had actually accomplished this year and they’re convincing themselves they’ll get it done next year. It’s time to set some New Year’s resolutions!

But what’s up with that? Why does it take people a whole year to reflect on what’s going right or wrong in their life and try to change their direction? Why does it take you a year to realize your diet and exercise regime is something you couldn’t stick to and you’re no better off than you were last year? Why were you still unmotivated in your career doing the same old thing? Why didn’t you get your head in the game for school? Why did you continue to pursue toxic relationships?

Continuous Improvement

Resolutions are all about trying to get better; we’re trying to continuously improve. Often when I talk to people about “agile” software development, all that I really try to drive at is that “continuous improvement”, in my own personal opinion, is really the important part.

So to continuously try to improve, you need to analyze what’s going well and what’s going not so well, set some goals, try things out, and re-evaluate. It’s a nice iterative cycle. It’s kind of like setting mini resolutions for yourself (or in the case of software development, maybe for your team or teams).

The big difference is the amount of time between measuring whether or not your change is having an effect! Waiting an entire year to try and measure your success would be absolute insanity in a fast moving software environment… why haven’t we gotten better at realizing this for our own personal continuous improvement?

Mark Manson

I’ve been reading a ton of Mark Manson material lately because of events going on in my life and the fact that the way he writes really aligns with how I often talk to my close friends. There’s analysis, there’s some humour, but it’s often a bit blunt and to the point. It’s actually a really nice change from many leadership, self help, or similar content where everything almost feels impossibly positive. This just feels like a real person talking to you.

Mark talks about setting goals in this blog post, and it got me motivated to reflect on my own goals and even write this post. In Mark’s post, he talks about our identities being built up by a bunch of habits, and goes on to state that some research shows that often habits only take about 30 days to form. In his opinion, using a whole year to set a goal of changing, adding, or dropping a habit just allows us to procrastinate for the entire year and then ultimately we fail.

His suggestion? Shorten the time frame.

If it takes on average 30 days to make a habit, why not have a “New Month’s Resolution”? Setting resolutions this way should then allow you to establish a new habit and then at the end of the month reflect on whether or not it worked well. You have less time to procrastinate. Your iteration is much shorter. Interesting.

My Own Goals

I figured I’d wrap this up by sharing some of my own goals publicly. I have a few things I’d like to work on coming up for the year, so I’ll outline them briefly:

  • Read more:
    • I’ve definitely dropped the ball on this one. I always had the excuse for myself that I don’t have time to do it. However, I found when I read the most consistently was when I found a decent book that I could read for a few minutes before I fell asleep every night. No pressure to get through it, but the books were there if I felt intrigued or needed to relax my brain a bit.
  • Try meditation:
    • I’ve always associated meditation with being spiritual or religious. Both of these things don’t really mesh well with me, personally. Mark Manson mentioned meditation in his post that I mentioned earlier, and it gave me a different perspective. I know I get stressed easily and I used to have pretty bad anxiety problems. Maybe this is something I could try out?
  • Write more:
    • I used to blog a lot. Between this blog, my fitness blog, and my car blog, I used to write content multiple times per week. It was always a bit of a social media experiment to get a better feel for how internet traffic works and where different types of content get the best visibility, but it also let me express myself. My content production has been almost nothing over the past year, and it’s something I’d like to look at more of.
  • Try public speaking:
    • This was something my HR Director had a chat with me about as a potentially cool opportunity. We were discussing getting more involved with the community and pushing boundaries, and she proposed speaking to students at local colleges or similar. I was turned off by it at first because I don’t like public speaking. But then the more I thought about it, I don’t know what public speaking is because I’ve never really done it. So why not try it?

But those aren’t my resolutions! Those are all just ideas for things I’m interested in improving. So taking some of Manson’s advice, I’m going to take ONE of those things and try to form a habit out of it for a month. Focusing on one thing at a time allows you to really give yourself an opportunity to establish the habit without worrying about too many other things, and ultimately setting yourself up for failure.

My first resolution is going to be to try out meditation. So for the first month, I’m going to try meditating four times per week for about 10 minutes at a time. I should be able to easily do this for two days on Saturday and Sunday where I don’t really have any external commitments, and then during the week I should be able to find at least two days before work where I can give this a shot.

Small steps, but small steps still take you forward.


Raspberry Pi + WordPress => PiPress

Raspberry Pi

Background

In the past, I’ve dabbled a bit with hosting my own server on a spare outdated box that likely should have been thrown out. My least favourite thing to do is sit down and tinker with trying to get services and such configured so that they all work together… But once it’s working, it’s glorious. Enter the Raspberry Pi.

Earlier this year I decided I wanted to get a Pi. Why? I wasn’t too sure… But they’re cheap and nothing bad could come of it 🙂 Once I got the thing up and running I was reading about how people were using them. Hosting a WordPress site was definitely one of the uses, so I figured I’d try my hand at that. There are other guides on The Internet about how to do this, but this is what got me up and running.

Disclaimer: A *lot* of this is taken from IQ Jar where there’s been an absolutely amazing outline posted. Although I am repeating a lot of the same steps here, I wanted to post what I felt was a complete install guide. I found myself going back and forth between a few resources, so hopefully this will reduce that issue for you. I do very highly recommend you have a look at IQ Jar though.

Raspberry Pi: What & Where To Buy?

This part is pretty open ended. Let’s start with the “what” portion of things.

The Raspberry Pi is just the board. If you’re totally content with buying a board without a case that you can’t even power up, then you’re all set. Although, if that’s the case, you probably don’t need to read anymore of this! It’s common to pick up the following to get your Raspberry Pi working:

  • Raspberry Pi
  • Case
  • Power Adapter
  • SD Card

But once you’ve got those things, you still can’t do too much with your Raspberry Pi aside from powering it up. Some other things you’ll likely want:

  • USB Wireless Adapter
  • USB Keyboard
  • HDMI Cable

NOTE: Pay special attention to what wireless adapters and SD cards can be used with a Pi out of the box. You’ll want to save yourself the headache if others have confirmed the parts you’re looking at purchasing are compatible.

So now that you have an idea what things you’ll need to pickup, where do you get them? If you search The Googles for where to buy any of this stuff, you’ll probably get a ton of hits. Maybe that’s not totally useful for you. I’d suggest the following sites:

  • Amazon: I got everything I needed off of Amazon in one fell swoop. You can even find some combo deals that include the Raspberry Pi and a case. Heck, some even come with the SD card too!
  • ModMyPi: A great resource… There’s tons of options on this site and it’s specifically for the Pi. Probably can’t go wrong by looking here.
  • Ebay: Ol’ Faithful. Lots of options here too, just like Amazon. Bound to find something that fits the bill.
  • Newark: There are a great deal of product offerings and resources on Newark. Check them out for full packages, accessories, and additional guides/walk-throughs.

The Walkthrough

First thing: there are a million ways to do this. I’m not going to explore all the options here because I’m not an expert and because I want to provide you with my own steps that worked for me. As soon as I deviate from that… Things will get messy and complicated 🙂

  1. Download a Raspbian “Wheezy” image from the Raspberry Pi website. This is the image of the operating system your Pi will use.
  2. Download Win32 Disk Imager. You’ll need this to get the image of the operating system onto your SD card.
  3. Once both downloads have completed, run Win32 Disk Imager and use it to write the image to your SD card. You’ll need a card reader/writer in your computer, but this is pretty standard these days.
  4. Take your card out of your computer and pop it into your Pi. You should have your Pi all setup now with power, USB keyboard, USB WIFI adapter, and an HDMI cable plugged into your TV/monitor.
  5. When you power up your Pi, you should be taken to an initialization/configuration menu. If it ain’t working, there are a million and one trouble shooting guides.
  6. Some things I suggest you get going while you’re here:
    • Reduce graphics memory to the minimum (16). Should help with performance.
    • Give yourself a modest overclock. Not sure what’s deemed safe, but I went somewhere in the middle.
    • Enable SSH. Later on you’ll never even need to be near your Pi. I can actually control my Pi from my phone with this sweet app.
  7. Once you’ve got things how you want, expand the file system and reboot your Pi.
  8. When the Raspberry Pi is back up and running, you need to login to your credentials and then type “startx” and press enter. This will get you into the GUI portion of things.

Anyone well versed in *nix may not need or want to do this, but I found it easiest this way. At this point, get your wifi and everything setup. Your blog won’t be very useful if your Pi isn’t on the internet. Having the GUI portion of Raspbian will also let you quickly search the net and pull up articles if you’re running into any oddities with the components you bought. Anyway, now that your Raspberry Pi is working with all the parts you purchased, on with the rest of it:

  1. Open up a terminal. You’re going to need it for basically everything else in this guide. We’re going to start by turning your Raspberry Pi into a LAMP server.
  2. Type “sudo apt-get update” to update the various packages on your Pi.
  3. sudo apt-get install apache2” to download and install the Apache web server. You’ll want to say yes when it asks for confirmation (and same whenever this happens for the other packages we need to install).
  4. sudo nano /etc/apache2/apache2.conf” to open up the apache configuration. You’ll want to stick “ServerName localhost” at the very end of this file and then save and exit the editor. This will get rid of warnings about determining the server’s domain name.
  5. Restart apache by using “sudo service apache2 restart“. Amazing. You now have a web server.
  6. You’ll need to take care of any port forwarding to make sure your router does it’s job to get to your Pi.
  7. Next is installing PHP: “sudo apt-get install php5
  8. Type “ls /usr/lib/php5/” and take not of the entry that looks like “20100525+lfs“. Yours might be slightly different.
  9. sudo nano /etc/php5/apache2/php.ini” to open up the PHP configuration. Find the line that starts with “extension_dir” and change it so it looks like: extension_dir = “/usr/lib/php5/20100525+lfs/” (except with the name of the entry you have if it was different!)
  10. sudo nano /etc/apache2/apache2.conf” to open up the apache configuration. You want to verify you have this line in there: Include conf.d/*.conf
  11. Next up, you’re going to need to make a config file for Apache. This can be done by typing: “sudo nano /etc/apache2/conf.d/php.conf” and then putting the following text inside of the file:
    # PHP is an HTML-embedded scripting language which attempts to make
    # it easy for developers to write dynamically generated webpages.
    LoadModule php5_module modules/libphp5.so
    #
    # Cause the PHP interpreter to handle files with a .php extension.
    AddHandler php5-script .php
    AddType text/html .php
    #
    # Add index.php to the list of files that will be served as
    # directory indexes.
    DirectoryIndex index.phpSave and close nano when you’ve finished.
  12. To improve the performance of PHP, install APC by typing “sudo apt-get install php-apc
  13. Now that you’ve finished that, restart Apache: sudo service apache2 restart

Next we need to get MySQL up and running. This is going to serve as the backend for your WordPress installation.

  1. sudo apt-get install mysql-server mysql-client
  2. Follow up with the MySQL plugin for PHP: “sudo apt-get install php5-mysql
  3. Now that you’ve finished that, restart Apache: sudo service apache2 restart

Next we’re actually going to install wordpress!

  1. In your terminal: “sudo wget http://wordpress.org/latest.tar.gz
  2. Then extract the whole thing: “sudo tar -zxvf latest.tar.gz
  3. From here, you can either follow along with the official WordPress Setup instructions, or just do what I did. If you want to do what I did, just keep following here!
  4. We need to make a user in MySQL:
    1. In the terminal: “mysql -u <YOUR_ADMIN_USERNAME> -p” and hit enter.
    2. (Obviously where it says <YOUR_ADMIN_USERNAME> you should replace with the database admin username you picked)
    3. Enter your password as the prompt suggests and press enter.
    4. Next up: “CREATE DATABASE wordpress” to make the database named wordpress.
    5. And now we set privileges: “GRANT ALL PRIVILEGES ON wordpress.* TO “wordpress”@”localhost” IDENTIFIED BY “<YOUR_PASSWORD>”;” and press enter.
    6. (Again, it’s hopefully obvious to replace <YOUR_PASSWORD> with your password)
    7. FLUSH PRIVILEGES
    8. And then finally “EXIT
  5. For my install, I put WordPress right at the root of my website. To do this, we need to copy the contents of the wordpress directory to your /var/www/ directory, but we’re *NOT* copying the wordpress directory itself there: “cp -a wordpress/. /var/www/
  6. And now, we run the install script! Since we installed WordPress to the root of the website, we go to http://127.0.0.1/wp-admin/install.php in a browser. Follow the few simple steps there and you should be up and running!
  7. Remember to check the troubleshooting section on the WordPress site if something seemed to go wrong!

That’s it! You should be up and running.

What’s Next?

You might find your site is a little slow. That’s somewhat expected on your little Rapsberry Pi. Don’t fret. There are lot’s of methods for optimizing your site.

  • Check out WP Super Cache, or specifically, the guide over at IQ Jar for more information on tweaking this (it’s near the bottom of the post).
  • There’s minifying plugins for javascript and CSS files. This can do a nice job compressing the files and reducing how much data has to be transferred.
  • You can look at something like Smush.it to help with compressing your images that you serve. Again, smaller means faster.
  • Finally, you might want to test your site on GTmetrix to see if it can recommend any other optimizations to you.

Summary

To wrap up, I hope you found this guide informative. I thought a Raspberry Pi was a great way to start a little DIY project at home and it was fun to get a blog up and running on it.

References

I’m sure I consulted a million and one guides on the Internet, but the following that stick out to me (and I highly recommend you look into them):

  • IQ Jar: Crucial for getting me up and running. Specifically, these two guides here and here.
  • WordPress.com: The detailed guide here for installing WordPress once you have all the prerequisites was definitely necessary.
  • GTmetrix:  Serving content was relatively new to me. Once I was analyzing my page with this site, I was lead down a rabbit hole of different things to try and optimize. I highly recommend it!

  • Nick Cosentino

    Nick Cosentino

    I work as a team lead of software engineering at Magnet Forensics (http://www.magnetforensics.com). I'm into powerlifting, bodybuilding, and blogging about leadership/development topics over at http://www.devleader.ca.

    Verified Services

    View Full Profile →

  • Copyright © 1996-2010 Dev Leader. All rights reserved.
    Jarrah theme by Templates Next | Powered by WordPress