<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://slades.dev/feed.xml" rel="self" type="application/atom+xml"/><link href="https://slades.dev/" rel="alternate" type="text/html" hreflang="en"/><updated>2026-05-20T20:16:12+00:00</updated><id>https://slades.dev/feed.xml</id><title type="html">blank</title><subtitle>Associate Professor of Computer Science at BYU - Hawaii </subtitle><entry><title type="html">Fish Shell Setup</title><link href="https://slades.dev/blog/2023/switching-to-fish/" rel="alternate" type="text/html" title="Fish Shell Setup"/><published>2023-06-21T00:00:00+00:00</published><updated>2023-06-21T00:00:00+00:00</updated><id>https://slades.dev/blog/2023/switching-to-fish</id><content type="html" xml:base="https://slades.dev/blog/2023/switching-to-fish/"><![CDATA[<p>The auto completions on my zsh setup were bugging me a little bit. It seemed to go through my history and suggest commands that didn’t work. I didn’t remember this when I used fish from before. Since switching between shells is easy, I decided to try fish and see if I could get it to run. Everything worked and less than 20 minutes later I was using fish.</p> <p>Here is what I did:</p> <ol> <li>Install fish with homebrew.</li> <li>On a new install you would want to install and set up starship prompt, but since I already did that with zsh, I didn’t have to do anything. Just use the same setup and config file from the previous post.</li> <li>To enable starship prompt on fish add <code class="language-plaintext highlighter-rouge">fish_add_path "/opt/homebrew/bin/"</code> to the <code class="language-plaintext highlighter-rouge">~/.config/fish/config.fish</code> file. And add <code class="language-plaintext highlighter-rouge">starship init fish | source</code> to enable starship.</li> <li>I also set the default editor in the config file: <code class="language-plaintext highlighter-rouge">set -gx EDITOR vim</code>.</li> <li>Install exa for a better ls: <code class="language-plaintext highlighter-rouge">brew install exa</code>, and set the alias in the config file: <code class="language-plaintext highlighter-rouge">alias ls='exa -lag --header'</code>.</li> <li>Install <a href="https://github.com/jorgebucaran/fisher">fisher</a> to install plugins.</li> <li>Install plugin for rbenv <a href="https://github.com/rbenv/fish-rbenv">fish-rbenv</a>.</li> <li>Install plugin for sdkman <a href="https://github.com/reitzig/sdkman-for-fish">fish-sdkman</a>.</li> </ol> <p>If I ever need to switch back to zsh, I just need to change the default shell.</p>]]></content><author><name>Christopher Slade</name></author><category term="technology"/><category term="terminal"/><summary type="html"><![CDATA[I switched to fish shell and I wanted to document how I set it up.]]></summary></entry><entry><title type="html">Terminal and Rails Setup Guide</title><link href="https://slades.dev/blog/2023/rails-setup-guide/" rel="alternate" type="text/html" title="Terminal and Rails Setup Guide"/><published>2023-01-28T00:00:00+00:00</published><updated>2023-01-28T00:00:00+00:00</updated><id>https://slades.dev/blog/2023/rails-setup-guide</id><content type="html" xml:base="https://slades.dev/blog/2023/rails-setup-guide/"><![CDATA[<p>I wanted to document how I install and set up things on my development machine because I often forget how I set everything up and I don’t want to start from square one every time. I decided to record it here so I can find it when I need it.</p> <p>Previously, I was using <a href="https://ohmyz.sh">oh-my-zsh</a> as my shell prompt. I liked all of the plugins and that I could theme it how I wanted. Then, I started using spaceship as the prompt. Then, as I upgraded, I found that spaceship was upgraded to <a href="https://starship.rs">starship</a>. That lead me to find the <a href="https://fishshell.com">fish shell</a>.</p> <p>I liked the fish shell, but it was hard to integrate all of my other software to work with it, especially <a href="https://github.com/puma/puma-dev">puma-dev</a> which allows me to use a test domain for all of my different apps. So, I wanted to stick with zsh and starship.</p> <p>To set it up, you need to install the following items.</p> <ol> <li>Install <a href="https://ohmyz.sh">oh-my-zsh</a> following the instructions on the website.</li> <li>Install starship with homebrew.</li> <li>Install <a href="https://github.com/zsh-users/zsh-autosuggestions">zsh-autosuggestions</a> and <a href="https://github.com/zsh-users/zsh-syntax-highlighting">zsh-syntax-highlighting</a> with homebrew. Make sure to copy down the instructions brew prints out at the end of the installation (for both packages). You will need to copy them into your .zshrc file.</li> </ol> <p>After you have installed it all you need to edit your .zshrc file.</p> <p>First, comment out the default theme <code class="language-plaintext highlighter-rouge">ZSH_THEME="robbyrussell"</code> because we will use starship for that.</p> <p>Then add the Starship prompt initialization to the bottom of your .zshrc file.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#Starship Prompt
eval "$(starship init zsh)" 
</code></pre></div></div> <p>Then you can customize your prompt by adding a configuration file at <code class="language-plaintext highlighter-rouge">~./config/starship.toml</code>. I found a good <a href="https://www.youtube.com/watch?v=VgTu1_92U0U">guide on YouTube</a>. It is super easy to customize. Here is my final configuration.</p> <script src="https://gist.github.com/crslade/2e23f91f8d531aee5b5b6b5b4e38a458.js"></script> <p>You can add the initialization of the zsh-autosuggetions and zsh-syntaz-highlighting below the starship prompt. zsh-syntax-highlighting should go at the very end of the .zshrc file. I recommend following the instructions that homebrew gives after you install the packages. But, here is what I needed to add to my file:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#Auto Suggestions
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh

#Syntax highlighting
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
</code></pre></div></div> <p>Then you can add oh-my-zsh plugins. You will find a line in your .zshrc file that says <code class="language-plaintext highlighter-rouge">plugins=(git)</code>. I added git, bundler, ruby, and rails.</p> <p>Then to install ruby I use rbenv and ruby-build. Install both of those with homebrew. You need to put the rbenv initialization in your <code class="language-plaintext highlighter-rouge">.zshrc</code> file. I also use homebrew to install postgresql and puma-dev. Puma-dev needs you to run two commands (one with sudo and one without).</p> <p>I did try <a href="https://www.warp.dev">warp</a>, but for some reason, I couldn’t get starship to work with it, even though it says it does. It seems like warp shows a lot of promise but I am not sure I like the idea of having to have an account that could track my shell activity.</p>]]></content><author><name>Christopher Slade</name></author><category term="technology"/><category term="rails"/><category term="terminal"/><summary type="html"><![CDATA[I wanted to document how I install and set up things on my development machine because I often forget how I set everything up and I don't want to start from square one every time. I decided to record it here so I can find it when I need it.]]></summary></entry><entry><title type="html">Switching to Github with Jekyll</title><link href="https://slades.dev/blog/2022/switching-to-github-with-jekyll/" rel="alternate" type="text/html" title="Switching to Github with Jekyll"/><published>2022-08-19T00:00:00+00:00</published><updated>2022-08-19T00:00:00+00:00</updated><id>https://slades.dev/blog/2022/switching-to-github-with-jekyll</id><content type="html" xml:base="https://slades.dev/blog/2022/switching-to-github-with-jekyll/"><![CDATA[<p>It seems like there has been a downfall for blogs as people have decided to use Twitter, Facebook, and LinkedIn to host their thoughts and ideas. However, I think it is really important to own your own data. I don’t blog a lot (as you can probably tell). I also don’t share a lot online. I haven’t posted to Twitter in a long time, and I hardly ever log in to Facebook or any other social media site.</p> <p>I wanted to change this site to more of a portfolio than just a blog. So, Blogger (even though it supports pages) didn’t seem like the best solution for a portfolio site. I always knew about GitHub pages and even considered using it when I switched from Wordpress to Blogger.</p> <p>I made the switch to GitHub Pages. I won’t do a big how-to post. I will just tell you to search for “Jekyll GitHub Pages”. There are plenty of guides. Since I am in academics, I decided to use the <a href="https://github.com/alshedivat/al-folio">Al-Folio</a> theme. You can also look into the <a href="https://academicpages.github.io">Academic Pages</a> theme.</p> <p>I didn’t find a good solution to importing all of my old blog posts from Blogger. So, I just went to my old blog and copied and pasted the content into a markdown file (.md). It took me some time to get all of the links back, but I didn’t have to do much to edit the markdown. I just needed to find the headings and make them headings again by putting hashtags in (#).</p> <p>As for the comments, I only have a few and they don’t add a lot to the content. So, this isn’t a good solution for people with large blogs with a lot of posts and comments. However, I am sure there is a way to export comments from Blogger and import them into whatever you decide to use for your comment engine.</p> <p>For now, I will not have comments. I don’t want to use discourse, disqus or any other outside provider for comments. I will look into <a href="https://staticman.net">Staticman</a> when I get the chance. Sorry to anyone who commented on my previous blog. If you feel like your comment needs to be preserved, let me know. I can either add it to the bottom, or add it if I get Staticman installed.</p>]]></content><author><name>Christopher Slade</name></author><category term="technology"/><category term="web hosting"/><summary type="html"><![CDATA[It seems like there has been a downfall for blogs as people have decided to use Twitter, Facebook, and LinkedIn to host their thoughts and ideas. However, I think it is really important to own your own data.]]></summary></entry><entry><title type="html">Ruby on Rails Tutorial Series</title><link href="https://slades.dev/blog/2022/ruby-on-rails-7-tutorial/" rel="alternate" type="text/html" title="Ruby on Rails Tutorial Series"/><published>2022-08-19T00:00:00+00:00</published><updated>2022-08-19T00:00:00+00:00</updated><id>https://slades.dev/blog/2022/ruby-on-rails-7-tutorial</id><content type="html" xml:base="https://slades.dev/blog/2022/ruby-on-rails-7-tutorial/"><![CDATA[<p>In my Ruby on Rails class, I created a <a href="https://www.youtube.com/playlist?list=PLmz7pZjxnS1XAnpk7lLyCRLbtCYaSNkpE">tutorial series</a> to help students learn Rails. I know there are a lot of tutorials out there, but a lot of them are done in older versions of Rails. There are quite a few breaking changes (like using rails db:migrage instead of rake db:migrate), and when you are learning something new this can be really frustrating.</p> <p>I created a <a href="https://www.youtube.com/playlist?list=PLmz7pZjxnS1VlA-k5qpji6aYDYys0MbIA">Rails 6 tutorial series</a> a few years ago when Rails 6 was released. I recently just redid the tutorial in Rails 7. All of the videos are posted on my <a href="https://www.youtube.com/channel/UCk415givMQzyhe4Lmxg8o9w">YouTube channel</a>. I do not post the code because then students just copy and paste my code, which usually bypasses the learning process.</p>]]></content><author><name>Christopher Slade</name></author><category term="technology"/><category term="rails"/><category term="tutorials"/><summary type="html"><![CDATA[In my Ruby on Rails class, I created a tutorial series to help students to follow to learn Rails.]]></summary></entry><entry><title type="html">Be Bored Challenge</title><link href="https://slades.dev/blog/2018/be-bored-challenge/" rel="alternate" type="text/html" title="Be Bored Challenge"/><published>2018-09-01T21:34:00+00:00</published><updated>2018-09-01T21:34:00+00:00</updated><id>https://slades.dev/blog/2018/be-bored-challenge</id><content type="html" xml:base="https://slades.dev/blog/2018/be-bored-challenge/"><![CDATA[<p>One of the best ways to help us become happier is by creating:</p> <iframe width="560" height="315" src="https://www.youtube.com/embed/RhLlnq5yY7k" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe> <h1 id="creativity-requires-passive-thinking-time">Creativity Requires Passive Thinking Time</h1> <p>If we want to create something no one else has created before, we need to think of things that no one has thought of before. Thinking of things that no one has thought of before requires thinking time. It would be nice if we can just schedule an hour to invent our new idea, then sit down during that hour and accomplish it. However, our best ideas do not come on a schedule.</p> <p>Our best ideas usually come during, what I call, passive thinking time. Passive thinking occurs almost subconsciously. We can’t plan passive thinking time. It occurs as we let our minds wander, while we are driving, walking, and doing “mundane” tasks like the dishes, showering, etc. It is during this time that our minds can explore new ideas that we haven’t thought about before. Then, later, when we get time to work on our project, we can implement the ideas we have created.</p> <p>In order to be creative, we need this passive thinking time. Most people make a few additions or revisions to a project they are working on, then take a break, and come back to add some more. What most successful problem solvers do while taking a break is passively think about the next problem they need to solve.</p> <h1 id="distractions">Distractions</h1> <p>However, if our break time only consists of looking at a screen, we won’t spend a lot of time thinking about the next task we need to accomplish. Instead, our efforts will be distracted. If we find something that interests us on social media, news sites, or TV shows, our “subconscious” will focus on solving problems we can do little about. Instead of inventing our next step, we will focus on the distraction and put our passive problem-solving effort toward the distraction.</p> <p>For example, if we read a political news story that upsets us, we will try to come up with a counterargument. If we find a sad story on social media, we will try to come up with a way to fix it. If we see a cool picture of someone’s vacation, we will try to figure out how we can go on that vacation.</p> <p>Now, I am not suggesting that successful problem solvers always think about their projects. But I am saying that a large portion of our efforts needs to be focused on our problems and not on distractions. What we need is undistracted time set aside when we can let our creative, subconscious minds work for what we want most.</p> <p>We also need passive thinking time to hear the whisperings of the spirit, which can help guide us to better solutions. <a href="https://www.churchofjesuschrist.org/study/general-conference/2018/04/precious-gifts-from-god?lang=eng">Elder Ballard</a> said (in April 2018), “If we do not find time to unplug, we may miss opportunities to hear the voice of Him who said, “Be still, and know that I am God.” (Palms 46:10) Now, there is nothing wrong with taking advantage of the advances in the technologies inspired by the Lord, but we must be wise in their use.” Our challenge is to retain our creativity with these devices.</p> <h1 id="intent-driven-device-usage">Intent Driven Device Usage</h1> <p>We need is to be in charge of how we use our devices, and not let our devices control us. In order to achieve maximum effectiveness we need two things:</p> <ol> <li>When it is time to work, we need to make sure that our devices will not distract us from the task at hand.</li> <li>We need passive thinking time. We need to be bored so our minds can passively solve the problems we are focusing on.</li> </ol> <p>What that means is that we need to be wise in how we use our devices, as stated by Elder Ballard (above). So here is my <strong>“Be Bored Challenge”</strong>.</p> <h1 id="the-challenge">The Challenge</h1> <ul> <li>Set a time limit on how much time you want to spend on social media, news sites, and other distractions. Decide when the best time is to visit these sites, and make rules about not visiting these sites outside of those times. Use apps and settings to enforce these rules if you cannot keep them by yourself.</li> <li>Turn off all notifications that are not urgent so that you will not be pulled into a distraction.</li> <li>Make sure you have plenty of passive thinking time.</li> <li>Don’t use your device during meals, bathroom trips, while walking to places, etc.</li> <li>Don’t use your device while in a conversation with other people.</li> <li>Have defined unplugged time every day.</li> <li>Don’t check your device for the first 30 minutes to 1 hour after you have woken up. That way you can passively solve the problems you feel are most important to you.</li> <li>Make sure you find healthy ways to replace the “excitement” (or dopamine) you used to get from your device. Exercise, talk with others, and most importantly - create something.</li> </ul> <h1 id="tools-to-help">Tools to Help</h1> <ul> <li>iOS 12 will come with a new feature that will allow you to set time limits on apps and plan for distraction-free time. For Android devices, search for an app that can do the same thing.</li> <li><a href="http://www.bumblebeesystems.com/wastenotime/">WasteNoTime</a> is a browser extension that works in Chrome and Safari and allows you to set time limits on websites you visit.</li> </ul> <p>Leave other tools you find in the comments.</p>]]></content><author><name>Christopher Slade</name></author><category term="screentime"/><category term="studying"/><summary type="html"><![CDATA[One of the best ways to help us become happier is by creating. If we want to create something no one else has created before, we need to think of things that no one has thought of before. Thinking of things that no one has thought of before requires thinking time. It would be nice if we can just schedule an hour to invent our new idea, then sit down during that hour and accomplish it. However, our best ideas do not come on a schedule.]]></summary></entry><entry><title type="html">AWS Lambda Functions with DynamoDB and APIGateway</title><link href="https://slades.dev/blog/2017/aws-lambda-functions-with-dynamodb-and/" rel="alternate" type="text/html" title="AWS Lambda Functions with DynamoDB and APIGateway"/><published>2017-09-28T21:31:00+00:00</published><updated>2017-09-28T21:31:00+00:00</updated><id>https://slades.dev/blog/2017/aws-lambda-functions-with-dynamodb-and</id><content type="html" xml:base="https://slades.dev/blog/2017/aws-lambda-functions-with-dynamodb-and/"><![CDATA[<p>I had a hard time gathering all the information that I needed to be able to deploy a simple API to AWS. I didn’t just want to create things in the AWS console because I cannot script it. Scripting allows me to redeploy my work with very little effort.</p> <p>So, to automate deployment, I can see 2 options. One option is to create a Python script using the Boto3 library. The script would create the DynamoDBs, the lambda functions, and setup the API Gateway. The other option was using CloudFormation. CloudFormation allows an organization to automate its deployment. However, CloudFormation is a lot of work and takes a lot of time to learn.</p> <p>So, I was told about <a href="http://handel.readthedocs.io/">handel</a>. Handel runs on top of CloudFormation and simplifies the deployment setup. All you need to do is setup an handel.yml file that will generate the CloudFormation template. Of course, since handel is less complex, you do lose some of the functionality of CloudFormation.</p> <p>You can see all of the setup in this GitHub <a href="https://github.com/crslade/FirstDynamo">repository</a></p> <p>It get it to work, I just installed node.js on my machine. Then install handel using npm (according to the handel docs). I also had to setup an account configuration file. The docs say it is hard to configure, but you should be able to find all of the values you need in the console. You can find the account id in the IAM, and the VPC information in the VPC area. Just look in the sidebar for Your VPCs, and subnets. Once you click on them you should see ids (vpc-XXXX, subnet-XXXXXX). Add them to your config file. For the subnets add all of your subnets into the public, private and data subnets. You can find the ssh_bastion_sq in security groups. You don’t need the last 2 lines.</p> <p>After that I wrote the handel.yml file. This is where I described DynamoDB I wanted to create and connected it to an API Gateway. I described the API Gateway using a swagger.yml file. (I suggest YAML over JSON because it is easier to type.) The swagger file will contain all of your paths, and link each path up to a lambda function. You can also describe your API parameters and responses. Check out the swagger.yml file for an example.</p> <p>Then you can deploy it by running the command handel -c <path to="" account="" config=""> -e dev -v 1.</path></p> <p>If you notice, I added security to my API, so that I can limit who calls my API. Without security, anyone can call your API, (and rake up your bill). I went with simple API_KEYS. I didn’t find a way for handel to set that up, so I had to do it in the AWS console. Under API gateway, on the sidebar, you can find API_KEYS. Create a key. Then you have to create a usage plan. I limited API calls to 1/second while testing. I can’t imagine being able to send more than one request per second. Finally, you have to add the plan to your API stage.</p> <p>You will see that the swagger documents puts security on the API paths, with a security definition section below.</p> <p>To test it, use curl:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl -H "x-api-key: generated-api-key" -d '{"device": "curl", "lat":"1.1", "lon":"2.2"}' https://eeohj10ccd.execute-api.us-west-2.amazonaws.com/dev/location
</code></pre></div></div> <p>Another thing that took me some time was errors. I started to play with API Gateway integrations. However, since you have a lambda function, it can return what needs to be returned. Look in the python code for the error handling.</p>]]></content><author><name>Christopher Slade</name></author><category term="aws lambda"/><category term="technology"/><summary type="html"><![CDATA[I had a hard time gathering all the information that I needed to be able to deploy a simple API to AWS. I didn't just want to create things in the AWS console because I cannot script it. Scripting allows me to redeploy my work with very little effort.]]></summary></entry><entry><title type="html">Getting delayed_job to Work with Rbenv and Mongoid</title><link href="https://slades.dev/blog/2011/getting-delayedjob-to-work-with-rbenv/" rel="alternate" type="text/html" title="Getting delayed_job to Work with Rbenv and Mongoid"/><published>2011-11-04T19:13:00+00:00</published><updated>2011-11-04T19:13:00+00:00</updated><id>https://slades.dev/blog/2011/getting-delayedjob-to-work-with-rbenv</id><content type="html" xml:base="https://slades.dev/blog/2011/getting-delayedjob-to-work-with-rbenv/"><![CDATA[<p><a href="https://github.com/sstephenson/rbenv">Rbenv</a> is another option that we can use besides <a href="http://beginrescueend.com/">RVM</a> to be able to manage different Ruby versions. I have always struggled to get RVM to manage everything right, from gemsets to bundles. Since <a href="http://gembundler.com/">Bundler</a> manages your gems and dependencies for you, gemsets are just an extra layer that caused me a bunch of problems. So I switched to Rbenv for my production environment. All went well except <a href="http://blog.leetsoft.com/delayed_job/">delayed_job</a>. It would work just fine with rake jobs:work, but script/delayed_job start would start just fine, but wouldn’t pull anything from the database. I am using <a href="http://mongoid.org/">Mongoid</a>, so I assumed that the script was defaulting to the sqlite database.</p> <p>Well, I looked at the script and noticed that there was a shebang at the top mentioning ruby (#!/usr/bin/env ruby). I just changed it from ruby to ruby-local-exec and it started working again! This made the script run in the bundled environment and pick up on the fact that I am using Mongoid instead of sqlite. Hope this helps someone.</p>]]></content><author><name>Christopher Slade</name></author><category term="rails"/><category term="technology"/><summary type="html"><![CDATA[Rbenv is another option that we can use besides RVM to be able to manage different Ruby versions.]]></summary></entry><entry><title type="html">Another Rails Editor and User Authentication</title><link href="https://slades.dev/blog/2011/another-rails-editor-and-user/" rel="alternate" type="text/html" title="Another Rails Editor and User Authentication"/><published>2011-10-25T20:17:00+00:00</published><updated>2011-10-25T20:17:00+00:00</updated><id>https://slades.dev/blog/2011/another-rails-editor-and-user</id><content type="html" xml:base="https://slades.dev/blog/2011/another-rails-editor-and-user/"><![CDATA[<p>Just another update for any of my past students following along. <a href="http://redcareditor.com/">Redcar</a> seems to have won over all of the students as their favorite Rails editor.</p> <p>To install it, you just type “gem install redcar”. It looks pretty promising. The students found it on their own, and preferred it to <a href="http://www.sublimetext.com/blog/articles/sublime-text-2-beta">Sublime Text Edit</a>, mostly because it’s free and doesn’t ask you to pay for it every 10 minutes.</p> <p>Also, we have been working on developing authentication systems, and the following <a href="http://railscasts.com/">Railscasts.com</a> videos I have been using for the class:</p> <p><a href="http://railscasts.com/episodes/270-authentication-in-rails-3-1">Authentication in Rails 3.1</a> and <a href="http://railscasts.com/episodes/274-remember-me-reset-password">Remember Me and Password Reset</a></p>]]></content><author><name>Christopher Slade</name></author><category term="rails"/><category term="editors"/><summary type="html"><![CDATA[Just another update for any of my past students following along. Redcar seems to have won over all of the students as their favorite Rails editor.]]></summary></entry><entry><title type="html">Migrating from Wordpress to Blogger</title><link href="https://slades.dev/blog/2011/migrating-from-wordpress-to-blogger/" rel="alternate" type="text/html" title="Migrating from Wordpress to Blogger"/><published>2011-10-25T10:04:00+00:00</published><updated>2011-10-25T10:04:00+00:00</updated><id>https://slades.dev/blog/2011/migrating-from-wordpress-to-blogger</id><content type="html" xml:base="https://slades.dev/blog/2011/migrating-from-wordpress-to-blogger/"><![CDATA[<p>Here are some detailed instructions on how I moved my blog from WordPress to Blogger, including how to get my old WordPress links to redirect to my new blogger-style links. After the switch, I also learned that Google+ will integrate with Blogger, so that is even more of an incentive.</p> <p>This should work with a self-hosted WordPress blog and a Wordpress.com blog. If you don’t have your own domain, you can transfer your blog to Blogger, but you will not be able to preserve and redirect your old links.</p> <p>Before you begin, you might want to use <a href="https://opendns.com/">OpenDNS</a> for your DNS on your local machine. You can refresh the DNS cache at any time, so you can see your changes immediately instead of waiting up to 2 days for the DNS cache to expire. Plus using OpenDNS <a href="http://portfolio.christopherslade.com/internet-running-slow-try-opendns.html">has many benefits</a>.</p> <p>Also, if you want to redirect your old Wordpress style URL’s to your new Blogger style URL’s you will need a server somewhere that will handle the redirections. If you don’t have one, you can use <a href="https://heroku.com/">Heroku</a> for free. I will show you how to set it up, but you will need Git, and Ruby installed on your machine. Mac users already have ruby installed (they might need to install x-code from the app-store), and they can get git from here. I also recommend installing RVM to install Ruby version 1.9.2. Windows users can get Ruby and Git (and a lot of extras) from railsinstaller.org. You only need Ruby, Git, and Bundler, so you don’t have to install all of the packages. I don’t have a Windows machine to try it out, so this is just my best guess.</p> <p>We will be doing the following steps to make the transfer from Wordpress to Blogger:</p> <ol> <li>exporting the posts and data out of Wordpress and importing them into Blogger.</li> <li>Configure Blogger to meet our needs.</li> <li>Set up a redirection server that will redirect Wordpress style links to Blogger style links.</li> <li>Transfer the domain from Wordpress to Blogger.</li> <li>Install Disqus comments (if you want to use it) on Blogger and migrate all of the discussions.</li> </ol> <p>I organized the steps to reduce the amount of downtime your blog will face. You should be able to keep the blog up the full time, but your readers might not be able to comment until the DNS changes have fully propagated. Also, you will lose all of your Facebook likes and +1’s, except on your main domain. Facebook/Google will not follow your redirections and combine the old Likes/+1’s with your new ones. If this is unacceptable, then you will need to stay with WordPress.</p> <h1 id="exporting-your-posts-from-wordpress-and-importing-them-into-blogger">Exporting your posts from WordPress and importing them into Blogger.</h1> <p>To export your Wordpress post and import them into Blogger just follow <a href="http://wordpress2blogger.appspot.com">these instructions</a>. My blog was less than 1MB, but if you have a bigger blog, you will have to download the converters and run them manually. More details on that process can be found here.</p> <p>You should create a new Blogger blog, and don’t worry about the blogspot.com URL if you have your own domain. Once it is up you can change the URL to the right domain. After you import your Blogger file, you should see all of your posts and comments. They will all be drafts, and you can select them all and publish them.</p> <p>There are a few things that might be a lot of work after you complete this step. First of all, all the pictures will work, but only until you move your domain to Blogger. They are pointing to your WordPress blog, so once your domain is moved over, they will stop working. You will need to get them off of your old blog and upload them to Blogger, or somehow host them on your redirection server. I didn’t have many pictures, so I just uploaded them to Blogger, but I will describe how you can host them on the redirection server. Also, on Blogger, your urls will be missing words like “the”, “a”, and “with”. This will create a little bit more work down the road, but I’m not sure if you can do anything about that.</p> <h1 id="configure-blogger">Configure Blogger</h1> <p>You can look at all of the settings. I wouldn’t set your domain until after you have the redirections in place. You can also take the time to edit the layout and add widgets to the side. Make sure you’re happy with how it looks, so you will know if you want to continue or not. Your WordPress blog should still be up. You can also add the Facebook like buttons I described in the previous post. Don’t install Disqus until after you have your redirections in place either.</p> <p>Now is also a good time to follow these instructions to get your author’s picture in your search results. You can also see Google’s instructions as well. What I did was create an About page and link to it with a text widget (not the page’s widget) that is included on all pages in my blog. I edited the HTML to include the link with rel=”author” in it. On the About page, I have a picture, short bio, and a link to my Google+ profile with rel=”me”. Make sure the Google+ link begins or ends with a +, or is a profile button, with rel=”me” in the anchor tag (not rel=”author”).</p> <h1 id="set-up-your-redirections">Set up your redirections</h1> <p>To redirect your WordPress style URL’s to your new Blogger blog, you will need a server to handle the redirections. If you have an Apache server, you can use the rewrite mod to create the redirections. Below is a sample .htaccess file that I used to redirect my links. You will need to customize it for your domain. The redirection server needs to be a sub-domain of your domain. So if you host your blog at www.example.com or blog.example.com, your redirection server needs to be something.example.com (I used old.christopherslade.com).</p> <p>Here is the <a href="https://gist.github.com/crslade/1311803">.htaccess</a> file I used before I thought about using Heroku.</p> <script src="https://gist.github.com/crslade/1311803.js"></script> <p>The .htaccess file includes redirections for my author page, about page, categories, tags, the feed, and the posts. In Blogger, there are just labels, so both categories and tags redirect to the label pages. I also had to add in some rules to redirect posts where Blogger didn’t include words like “the” and “a” in the URL. You will need to search for these and add in those redirections as well.</p> <p>If you don’t have a server to host the redirections (I migrated to ditch the server), you can use Heroku for free. When I was trying out different blog solutions, I ran across toto and learned a little about Rack. Since I develop in Rails, I really wanted to make toto work, but I couldn’t easily migrate my posts. But I did learn enough to know that I could use Rack to redirect URL’s. I created a simple Rack app that would redirect the URL’s, and even host some static assets. You can use this app to redirect your URL’s and even host your pictures from WordPress.</p> <p>I uploaded my app onto Github. If you want to use it, just clone it and change the config.ru file. Again, you will need Git, Ruby, and Bundler installed on your machine. You can then use Heroku to host your redirection server. Here is my config.ru file that you will need to change:</p> <script src="https://gist.github.com/crslade/1311852.js"></script> <p>You should change the root to your domain, and then change the author page. You can remove my specific post redirections and add in your own.</p> <p>To pull the code to your machine, in the terminal or commad prompt type:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/crslade/wp2blogger-redirector.git
</code></pre></div></div> <p>Then you should have a wp2blogger-redirector directory. Change into the directory and edit the config.ru file. You can test it by typing in the terminal or command prompt: rackup. This will start the server on your local machine. Then in a browser goto http://localhost:9292. You should see “Nothing Here”. You can then type the Wordpress URL after the :9292 (like http://localhost:9292/2011/09/blog-post/) and you should be redirected to the right URL (http://www.youdomain.com/2011/09/blog-post.html). As you fix things, remember that your browser will cache the redirections, so you need to clear the browser cache if something goes wrong and you want to retest it. Also, every time you make a change to config.ru, you will have to kill the server and start it up again (Control-C, and then type rackup again), or install the shotgun gem (“gem install shotgun”). Then you can launch the server by typing: shotgun. It will start the server on 9393 instead of 9292, and you shouldn’t need to restart it after changing the config.ru file (but if things aren’t working you might want to try restarting it before you pull all your hair out).</p> <p>You can also add in your old pictures by copying the /wp-content/uploads directory into the public directory. You will also need to add in the /wp-content to be served statically. To do this change line 3 in the config.ru file to be:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>use Rack::Static, :urls =&gt; ['/index.html', '/favicon.ico', '/wp-content'], :root =&gt; 'public'
</code></pre></div></div> <p>You can also test to make sure the server serves your old pictures. Heroku will only let you use 100MB in disk space. So you might need to delete some pictures. Wordpress does store several sizes of pictures, and you can remove all of the sizes you don’t use on your blog.</p> <p>After you get the redirection server working locally, you can push it to Heroku.</p> <p>To commit the changes locally, type: git add -A git commit -m “some message”</p> <p>Then create an account on Heroku. You can follow these instructions to launch your server on Heroku. Don’t worry about bootstrapping your database, you don’t have one. In summary, type the following: heroku create git push heroku master</p> <p>If everything worked your redirection server should be live. Test it by typing Heroku open, and you should see it in your browser. Remember the URL, because you will need it when changing your DNS.</p> <h1 id="migrate-your-domain-to-blogger">Migrate your domain to blogger</h1> <p>Now you are ready to migrate your domain. First, create a CNAME record in your DNS to point old.domainname.com to Heroku, and follow these instructions for adding the subdomain to your Heroku app (you are probably not on the Cedar stack). You only need to add one subdomain, not your full site. While you are at it, you can now point your main domain (or a subdomain) to your new blog and edit your new blog’s settings to add your domain. It’s under Settings -&gt; Basic. You will also want to add a missing files host, and put in “old” (if you used old.domainname.com) for the name of the host. Blogger has a link with instructions on how to set your domain name to point to Blogger that should appear as your change your settings.</p> <p>If you are using OpenDNS, you can go here, and check their cache. After you check, you can request a cache refresh and it will update the DNS settings from your registrar. (It might take a couple of hours for your registrar to update its DNS servers.) You will also have to refresh your local DNS cache by rebooting your machine. Your domain should be pointing to your new blog. Remember, it takes a couple of days for the DNS changes to propagate to everyone, but with OpenDNS you can try it a lot faster. You should leave your old blog up for at least a few days, so if your readers haven’t gotten the DNS update, they will still see your old blog. You might want to disable comments because they will not migrate over to your new blog.</p> <h1 id="migrate-disqus-comments">Migrate Disqus comments</h1> <p>You can now install Disqus on your Blogger blog, by going to disqus.com, logging in, clicking on your blog, and then clicking the install tab. Click on blogger, and it will install it to your blog. You will then need to edit your layout in Blogger, to add the widget (preferably on the bottom). You should see Disqus take over for your comments, but all of your old comments will be gone. Now, back in Disqus, go to tools, and migrate threads. You can try the redirect crawler if your redirects are all set up. You can also upload a URL map. Once done, your comments should re-appear.</p> <p>Unfortunately, your likes and +1’s will be reset. You should now be up and ready to go. Hopefully, Google+ integration and a free hosting solution will make all the work worth it. If you have any questions, just leave them in the comments.</p>]]></content><author><name>Christopher Slade</name></author><category term="wordpress"/><category term="web hosting"/><category term="blogger"/><category term="technology"/><summary type="html"><![CDATA[Here are some detailed instructions on how I moved my blog from Wordpress to Blogger, including how to get my old Wordpress links to redirect to my new blogger style links. After the switch, I also learned that Google+ will integrate with Blogger, so that is even more of an incentive.]]></summary></entry><entry><title type="html">I Moved to Blogger</title><link href="https://slades.dev/blog/2011/i-moved-to-blogger/" rel="alternate" type="text/html" title="I Moved to Blogger"/><published>2011-10-23T11:44:00+00:00</published><updated>2011-10-23T11:44:00+00:00</updated><id>https://slades.dev/blog/2011/i-moved-to-blogger</id><content type="html" xml:base="https://slades.dev/blog/2011/i-moved-to-blogger/"><![CDATA[<p>Since it has been another year, it was time for me to reanalyze how I am hosting this blog. A little while ago, I read a <a href="http://www.staynalive.com/2011/05/why-as-developer-i-switched-to.html">blog post</a> by <a href="http://staynalive.com/">Jesse Stay</a> about switching to Blogger. What I remembered the most was that he has able to host his blog on Blogger for free. Since I don’t use this blog much, I don’t feel like it is worth it to pay too much for hosting. I have been hosting it with a self-hosted WordPress install, and as Jesse points out, it was too time-consuming to keep it up to date and running smoothly. Without the super cache plugin set up and configured correctly, I was getting up to 3 seconds per page load which would never survive a high-traffic day. Even with the cache setup correctly, I still even doubted that my blog would withstand a heavy traffic day.</p> <p>I could have moved my blog to Wordpress.com, but that comes with ads and additional fees that Jesse details in his blog post. Some other options I looked at were using <a href="http://pages.github.com/">Github pages</a> and using <a href="https://github.com/cloudhead/toto">toto</a> hosted by <a href="http://heroku.com/">Heroku</a>. I like the idea of having a git repository being the source for my blog, but I couldn’t format my old posts in the markdown, and none of the scripts translated things over correctly. It ended up being too much effort to transfer my old blog posts over so decided to try blogger. (I was hoping to edit my posts with a plain old text editor too.)</p> <p>In less than 5 minutes, I had all of my posts and comments transferred over to Blogger, so I was sold. It did take a little while to configure things the way I wanted, and then I had to redirect my old WordPress-style links to my new blogger links. I plan on doing a post in the near future describing the process of transferring my WordPress blog to Blogger (including how to redirect your links), so stay tuned.</p> <p>I do want to explain how I set up some features (usually supplied by a plugin) that I had on WordPress on Blogger. First of all, I have been using <a href="http://disqus.com/">Disqus</a> as my comment engine on my WordPress blog. As you post comments on a lot of different sites, there isn’t a way to aggregate all of your comments together. Disqus lets your readers create a single profile they can use to comment on every site that uses Disqus, that way all of your users’ comments can be aggregated together. It also allows users to use their Facebook or Twitter accounts to comment. Lots of sites are using it.</p> <p>Disqus installation is easy. Create an account on Disqus, then add a new site. Fill in your url and look through all the settings to make sure it’s setup the way you want. Import your current comments by going to Tools -&gt; Import/Export. Then click on the install tab and click on Blogger. It will ask you to select your blog. Once you finished with that, you will have a Disqus widget. Add it to your layout (preferably on the bottom part). You should see Disqus take over for your comments.</p> <p>The next feature is <a href="http://feedburner.com/">Feedburner</a>, which will optimize your feed for each of your subscribers. Your feed is what Google Reader and other news/feed readers use to know when your blog has been updated. Since FeedBurner is owned by Google, installation is easy. Go to Feedburner.com and create an account. Then burn your feed by putting in your URL (make sure you select your posts’ feed and not your comments’ feeds). It will also let you assign your feed a URL. Then, go to your Blogger settings, under other. You will see a “Post Feed Redirect URL” setting. Paste in your Feedburner feed URL. Now your subscribers should be getting their feeds from Feedburner. To test it go to http://yourblog.blogspot.com/feeds/posts/default (or http://yourblogaddress.com/feeds/posts/default if you have your own domain). You should be redirected to Feedburner and see your posts.</p> <p>Finally, I wanted to add a Facebook like button to my posts. By default, I already had the +1 button (Google+) and a Twitter button but no Facebook button. To get a Facebook like button follow <a href="http://www.bloggerplugins.org/2010/04/facebook-like-button-for-blogger.html">these instructions</a>. Some old instructions don’t work for the current layouts so be careful. If your like count is strangely high (around 16,000 likes), then your readers will be liking some page called post.url instead of your post!</p> <p>I hope the information is helpful.</p>]]></content><author><name>Christopher Slade</name></author><category term="wordpress"/><category term="web hosting"/><category term="blogger"/><category term="technology"/><summary type="html"><![CDATA[Since it has been another year, it was time for me to reanalyze how I am hosting this blog. A little while ago, I read a blog post by Jesse Stay about switching to Blogger. What I remembered the most was that he has able to host his blog on Blogger for free. Since I don't use this blog much, I don't feel like it is worth it to pay too much for hosting.]]></summary></entry></feed>