DynDns and no-ip alternative

Ever wanted to access your computer from anywhere? Many years ago I discovered a service called dyndns.org. Later, a friend introduced me to no-ip.org. Eventually, dyndns closed up their free services and while no-ip.org is great, they require you to login and renew it every 30 days just to keep it active.

So, I went looking for a valid alternative.  You see, there are so many services you can run once you have something pointing to your home computer. But this is the first, and most important step.

I eventually found nsupdate.info. It is a free service, no advertising, and pretty low key. You can even import your own domain name if you so choose.

  1. In order to setup your computer, go to nsupdate.info and create an account.
  2. Go to https://nsupdate.info/overview/ and choose to “add a host”. The ‘name’ field on the form will be your subdomain.
  3. After the host is added, click on the host name on the overview page. Then click “Show configuration”.  You will notice a bunch of tabs on the right, near the top. Click on the appropriate one. If you do not know, try installing DDClient. Just search how to install for your platform (Windows users use this link to search). (Ubuntu users just use apt-get).
  4. That is it. Now navigate to example.nsupdate.info and it will now go to your local computer. How about you create your own private dropbox by installing OwnCloud?

Quick Privacy Tip – Remove your records from PeopleFinders

Ever see ads for peoplefinders.com? You know, the site that gives information about relatives, etc, and then offers to provide additional info for $50?

To remove yourself from their database, go to http://www.peoplefinders.com/manage/default.aspx and enter your information. Then choose to opt out.

It is that simple.

Also, there is additional information about removing youself from search websites here: https://www.abine.com/optouts.php

Should’t your kids be in school?

My wife gets a question asked of her over and over. It seems harmless sometimes. It is often asked out of innocent ignorance.

Shouldn’t your children be in school?

You see, my children are homeschooled. They do actually have a schedule, but unlike the rigidness of public school, the time can be adjusted when something comes up.

Today, my wife received the question at the bank. It has been asked all over town. “Why are your kids not in school?” People have a hard time accepting that not all kids have such a rigid schedule.

After they get over the horrific idea that the kids are not “publicly educated,” they often (but not always) make a passive aggressive remark to my wife or my kids of some kind.  Usually it comes in the form of “so when do they start real school” or “what will they do when …”

I find this funny, because adults are often impressed by the strong social skills and intelligent conversation that our four and six year old demonstrate.

While public schools do try to serve the purpose of education, there is as much an agenda of indoctrination as there is the purpose of babysitting in these institutions.

The only reason I can fathom that somebody unrelated to my children would need so badly to criticize our decisions is because they feel personally threatened. Why? Probably because of the cult of institutional education. The people in my generation and earlier grew up with the understanding that an educated person could only exist if they were brought up by an institution.

Just to dispel a few notions about our family that some might have…

  • My wife and I are both educated and intelligent. My wife, graduated with honors in accounting, and I did the same in computer science.
  • Our children are “socialized.” Between homeschool group activities, church, etc, they have a lot of social interaction. On the other hand, they don’t spend a lot of time with manipulative children, bullies, and other bottom feeders of society that children are forced to work with in a traditional setting. Instead, they are inspired by oftentimes older role models. This propels them to maturity faster than their peers.
  • The kids in our family are challenged more so than those in public school. We base the curriculum on their level of accomplishment, so they are given more when they are in the “zone” and given less when they may have other distractions. This is important because it makes their education work like a well fit glove. It becomes the perfect tool instead of an awkward instrument.
  • Our life is more portable. If we wanted to take a vacation in the middle of February, we could literally take the school on the road. Or we could call it our spring break.
  • We are more vested in our children’s education than any institutional school parent. My wife is a teacher and a mother and takes both jobs very seriously. She understands her children’s needs better than anyone could by only participating in one side of the equation. This is not to say there are not good parents, just to say it is almost impossible to be more vested than a homeschool parent.
  • My children know technology and they know it well. It may partially come from their dad being a software engineer, but it is also how we teach our children. We embrace technology and use it heavily to assist with education. The children understand how to not only operate the computer/tablet/phone, but we are also working with them on learning why such devices work.

 

Growing greens in water (no pumps)

Some of you may have heard of hydroponics. It is a system of gardening where plants are grown in a water and nutrient solution. In my home state of Minnesota, we have a lot of winter months where it is not possible to grow outdoors. So I decided to take this as an opportunity to try some unconventional gardening techniques indoors.

For my experiment, I am growing Pok Choi in a 5 quart ice cream bucket. The bucket has black plastic around it to keep light out. It has a net pot made from a yogurt container.

The kids and I sprouted the seeds by using the paper towel method. Basically, we folded up a paper towel, got it wet, and put a few seeds inside. This paper towel went in a plastic sandwich bag and then was placed in a cabinet (dark is important) while the sprouts came up.

Now that the seeds have sprouted, we chose the best one and placed it in the yogurt cup. Our growing medium is “Better than Rocks”, which we found on clearance at a gardening store. It is sort of like Rockwool.

Since we are trying to go cheap with this, our nutrient solution was one half teaspoon of general purpose miracle grow in a gallon of water. I know it is not ideal, but it is not like we are propagating expensive plants here! The seeds cost me 80 cents and came from the clearance rack at Gerten’s.

The plant will sit on our south facing windowsill and possibly get some additional light from a full spectrum CFL Ott light.

And here was my inspiration on using the Kratky method of hydroponics…

I will have to post more later with an update if this actually worked. We cut a lot of corners, but it may work fine. Here is wishing for the best!

Here are a couple links to some good resources if you would like to give it a try yourself…

How to fix CPanel Server Error due to file permissions

I’ve run into a problem a couple times that maybe you have seen too.  After uploading a website that is maintained by a CPanel backend, you run into a “403 Forbidden” and “500 Internal Server Error” problems.

Unfortunately, a CPanel installation is not usually helpful in this matter. It turns out, the problem is usually simple to solve. Usually, these errors are caused by security settings that are default in CPanel. They ensure that other accounts on the system are not able to mess with your files.

The fix

To fix the problem, open up a terminal window and run the following code (replace your webroot directory as needed):

find /path/to/base/dir -type d -print0 | xargs -0 chmod 755 
find /path/to/base/dir -type f -print0 | xargs -0 chmod 644

That’s it. Problem solved. Go load your website and enjoy the permission error free experience.

Creating a patch file in Git

I don’t usually use patch files for their intended purpose (patching). I just don’t have the need for them in my development process. But, I do think the files themselves have another valuable purpose. They make a great way to do a quick code review of changes that were made.

So, whether you are actually applying a patch, or you just wish to review the changes between commits quickly, patch files are valuable.

If you wish to create a patch file with Git, it is a simple command…

git diff commit1 commit2 > nameOfPatch.patch

Continue reading

Terminal Window

Open in terminal menu for Ubuntu

Back when I used Windows, on e of my first modification would be to install Windows power toys and get the “Open command prompt here” right click menu working. Occasionally, I find this could be useful in Ubuntu when using Nautilus (the default file manager).

By default, a right click option for this does not exist. But like most things in Ubuntu, it is simple to add:

  1. Open your terminal and type: `sudo apt-get install nautilus-open-terminal`
  2. Close all open sessions of Nautilus by typing `nautilus -q`
  3. Open Nautilus and right click somewhere. You now have an “open in terminal” option.
JQuery - Write more, do less

Toggling table rows with JQuery

Sometimes webpages and forms grow too large to be viewed comfortably. This can confuse the user. It is kind of like a kid dumping out his toy boxes on the floor all over the house. Now he can’t find anything and the landscape becomes daunting to navigate.

A quick solution in the web world is to collapse a section. This will work for divs or tr (table rows), etc.

Using JQuery, I can select a class and tell it to collapse everything until the next class instance. This is a very quick way to enhance the usability of your tables, forms, etc. The code below collapses on table headers (th), but you can modify to be used elsewhere.

<script>
$(function() {
$(‘.subheader’).click(function(){
$(this).nextUntil(‘th.subheader’).slideToggle(500);
});
});
</script>

replace

Dealing with config files in Git

So while developing for my job, I’ve come across an interesting challenge. How does one automatically change config file values based on the branch they are currently using in Git?

Background

So for one of my projects, we have a website that is used on several domains. Due to certain constraints and history of our project, we have forked the website into two versions. Each version has its own master branch (Master and Master_ExtraFeatures).

Master_ExtraFeatures always contains all the features of master, but also contains some additional code.

When testing Master_ExtraFeatures, we have to modify the config file a little bit. Since we do not keep the config files as part of the Git repository, the config does not change when I checkout Master or Master_ExtraFeatures. I have to manually update the settings, or I have to copy in a file from elsewhere.

Solution

This is by no means the only way to do it, but it works good for me. Basically, I wanted to write a script that would hook into the git process and modify the config file every time I checkout a new branch.  Clearly, this is a good candidate for Git hooks. I created a file in my .git folder called “post-checkout”.  This will be executed every time a branch is checked out. Then I added the following code:

branch=$(git rev-parse –abbrev-ref HEAD)

if [[ $branch == *ExtraFeatures* ]]
then
sed -i ‘/EXTRA_FEATURES_ENABLED/s/FALSE/TRUE/g’ /home/me/projects/website/config.php
else
sed -i ‘/EXTRA_FEATURES_ENABLED/s/TRUE/FALSE/g’ /home/me/projects /website/config.php
fi

Explanation

branch=$(git rev-parse –abbrev-ref HEAD)

  • Gets the newly checked out branch name.

if [[ $branch == *ExtraFeatures* ]]

  • Checks if the branch name contains “ExtraFeatures”. The asterisks are to wildcard the phrase.

sed -i ‘/EXTRA_FEATURES_ENABLED/s/FALSE/TRUE/g’ /home/me/projects/website/config.php

  • This is the ‘sed’ command. It is basically used for string and file manipulation. For your purposes, the format should be similar to this:
    • sed -i ‘/[PHRASE TO LOOK FOR ON A LINE IN THE FILE]/s/[PHRASE THAT WILL BE CHANGED ON THAT LINE]/[CHANGE THE PHRASE TO THIS]/g’  [COMPLETE FILE LOCATION FOR FILE THAT WILL BE SEARCHED]
    • The -i flag in sed says that the file will be written. If you want to try it without overwriting your file, skip the -i, the changes will instead be written to standard out.

You will notice I have two lines with sed. Basically this example is a simple toggle that will change the EXTRA_FEATURES_ENABLED setting from true to false.  So my config.php file changes:

from this:

define(‘EXTRA_FEATURES_ENABLED’,FALSE);

to this:

define(‘EXTRA_FEATURES_ENABLED’,TRUE);

No additional lines are affected, which is exactly what I wanted.

Auto refresh body of page with JQuery

Ever want to refresh the body of a page, but not everything else (head section, etc)?

Here is how you do it…

First, we need to make sure we include the JQuery script in our page. This should be placed at the bottom, just before the body tag.

Next, we will include a quick script below the jquery.min.js call…

<script>
$(‘#reloadbtn’).focus();
$(‘#reloadbtn’).click(function() {
$.ajax({
url: “”,
context: document.body,
success: function(s,x){
$(this).html(s);
}
});
});
</script>

Finally, create a button with a ‘reloadbtn’ id somewhere in the body of your page…

<button id=”reloadbtn” >Refresh</button>

 

That’s it. You now can refresh just the body. Using this example, you can modify it to do some other cool refreshes as well. Please comment if you have modifications to this code!

Technology, gardening, and freedom