Upgrade that old wired printer

This is for my father, who has an old wired Brother Printer/copier.

Do you have a printer at home that works well, but you have to plug into it with a USB cable to print? Me too. My wife, Kristin, has a fantastic Brother printer from college. It’s fast and quite the workhorse. But we often print from our phones, tablets, and in our house, non-windows machines. Using an open-source program called CUPs. This can be done on almost any machine, but I chose to use my Ubuntu powered PC. There are some variations if you use Windows.

This is a smaller project, and pretty easy.

Install and setup CUPs

To begin, download and install CUPs on your computer.

sudo apt-get install cups

Now it’s time to set up CUPs

  1. Navigate to CUP server at 127.0.0.1:631 through a web browser.
  2. Navigate to Administration Tab
  3. Click “Add a Printer”
  4. Select your printer.
  5. Fill out the fields and enable “Share This Printer”. Click continue
  6. Select your print driver (this could take a few attempts). In my case for the Brother HL2140, I chose Brother HL-2140 Foomatic/hl1250

Screenshot from 2017-08-10 08-14-18

Add to Google Cloud Print

Once it’s tested open up the Google Chrome browser (or Chromium) and perform the following:

  1.  Navigate to chrome://devices/ in the Omnibar.
  2. Select “Classic printer”
  3. Add printers
  4. Manage printers
  5. Select the printer you want to add

wp-image-1211992898

Now that the printer is added, you can manage it at https://www.google.com/cloudprint/. Here you can share the printer with anyone with a Google account.

Takeaways and future thoughts

Unexpected problems:

Finding the correct Print Driver was a pain. I had to dive pretty deep into the Internet to figure out what to use, but I eventually found it!

Future Concerns:

Nothing. Just need to make sure that my PC is powered on at all times when I want to print.

Future Enhancements:

CUPs is currently installed on my PC. I may move it to a Raspberry Pi at some point. This will decrease the power required to run the print server (the Pi uses less juice than myPC), and it will allow the printer to become wireless, meaning it can be moved anywhere in my home.

Good morning, won’t you please take some time to save Net Neutrality?

What is Net Neutrality? From Battle for the Net:

“Net neutrality is the basic principle that protects our free speech on the Internet. “Title II” of the Communications Act is what provides the legal foundation for net neutrality and prevents Internet Service Providers like Comcast, Verizon, and AT&T from slowing down and blocking websites, or charging apps and sites extra fees to reach an audience (which they then pass along to consumers.)”

The Donald Trump appointed Chairman of the FCC, Ajit Pai, repeal it’s 2015 decision to reclassify broadband providers as common carriers under Title II of the Communications Act. This essentially provides ISPs (Internet Service Providers) with the ability to regulate how you use the Internet. Worst case scenarios include:

  • ISPs charging Netflix and Hulu more for people to access their sites
  • Comcast slowing all traffic to Netflix to promote their own streaming service

From NPR, “One key element at stake is the idea of paid prioritization, which would give Internet providers the ability to strike deals with content companies to give some apps and websites, or their own services, special treatment.

This is particularly a sensitive matter to Vimeo, a video service smaller than Google’s YouTube or other companies that offer video like Netflix, Amazon and now Facebook. Vimeo’s general counsel Michael Cheah says paid prioritization would “cable-ize the Internet” and hurt independent and small creators.”

If ISPs can speed up and slow down sites for money, and force small businesses with websites to pay extra fees, that’s a tax on everything. It costs all of us more, meaning we all pay more for less.

How can you help? Start by writing a letter to the FCC letting them know that you support a free and open Internet. The Electronic Frontier Foundation has created an incredibly simple tool to help you do that: https://dearfcc.org/ A more fun, but less user-friendly, the alternative is gofccyourself.com. This is a weblink that John Oliver made. Beyond that, contact your Senators and representatives in Congress.

Stand up for an open Internet, tell the FCC to protect Net Neutrality!

Mapping a Domain Name

I want to map my Domain name to my apartment’s IP address. There are a couple reasons for this. First, I think it would be fun, and it is the first step to hosting a website 100% at home, so I only rely on my ISP to provide an Internet connection.

DNS serves as the phone book of the internet.

Lets say I want to visit Mike. So, I pull out a phone book. I look up Mike, and learn he lives at 123 Main St. Now I can visit him!

DNS works in a similar fashion. I want to visit Google. I type Google.com into my web browser, and thanks to DNS, my browser knows to go to Google’s IP address! So, DNS connects a Domain to an IP Address.

Now, how can I send my domain, to my apartment’s IP address? BTW, this whole posts assumes you are using a Debian-based Linux system and that Google is your Domain Registrar.

  1. Buy a domain name
  2. Setup DNS settings
  3. Map to web server
  4. Setup Dynamic DNS

1. Buy a domain name

There are several registrars out there who you can purchase domains from. Godaddy is a large name in this industry, known for their ridiculous ads and poor treatment of women. I choose to go a more ethical route, and went with Google. This was easy enough, I started by going to domains.google.com for the domains I wanted. In this case, mikehelmers.com and helmershomestead.org. Each of these ran at $12 a pop. But you can get nearly any domain that’s available. I entered my credit card info, bought my domains. Easy.

2. Setup DNS settings

Now that I had my domains, I had to point them at my websites. Since WordPress is hosting mikehelmers.com, I need to set up that domain to use WordPress DNS servers. WordPress provided their server names, and most companies make it pretty easy. For helmershomestead.org, I kept it on the default Google provided DNS servers.

3. Map to web server

For the WordPress hosted mikehelmers.com, I’m done. They’ll take care of everything else. But for the soon to be self-hosted helmershomestead.org, there’s still quite a bit more. Under the ‘Registered Hosts’ part of the DNS Settings page, I added my IP address. I did this for both http://www.helmershomestead.org and helmershomestead.org because people might enter both URLs.

I also updated the Customer Resource records, the ‘A’ records, the ‘TXT’ record, and the ‘CNAME’ record. The A Record is the primary method that a Domain maps to an IP address. The TXT Record is added because I have my sites connected to Keybase to verify that I own them. I’ll write about Keybase at a later time. CNAME further helps with mapping subdomains (www) to the primary domain.

4. Setup Dynamic DNS (Optional for most people)

One of the issues with mapping a domain name to your homes IP address is that it is not static, meaning that it can spontaneously change. Now, is that likely? No. But it can happen, and at some point, will happen. ISP’s are loathe to give someone like me a static IP address and, generally speaking, home servers are frowned upon. But whatever, they’re shady companies. To get around this issue I am going to use Dynamic DNS(DynDNS). This technology uses software to automatically check what a devices IP Address is, and then tell the DNS server what the IP address is. At domains.google.com go to the DNS settings for your domain name. Go to the ‘Synthetic Records’ section of the page and select ‘Dynamic DNS’ from the dropdown menu. This will generate the username and password that you will use after installing DDClient.

Next, install DDclient from the command line:

sudo apt-get install ddclient

You will be asked some questions, fill them out the best you can, but it doesn’t really matter. Once installation is complete open up the ‘ddclient.conf’ file:

sudo nano /etc/ddclient.conf

Overwrite the existing text with the following lines:

protocol=dyndns2
use=web
server=domains.google.com
ssl=yes
login=Google_generated_username
password=Google_generated_password
whateveryourdomainis.com

Save and close the document and run the following command:

sudo ddclient -verbose -foreground

This will let you know if ddclient has successfully updated Google’s DNS servers with your external IP address.

There we go. now when I go to mikehelmers.com, is hosted by WordPress.com and helmershomestead.org independently in my apartment. Now if my public IP address changes for any reason, DDClient will check and update Google’s DNS servers accordingly.

Takeaways and future thoughts

Unexpected problems:

There was some hiccups with setting up the Dynamic DNS service, but it was because I mistyped some words.

Future Concerns:

Nothing

Future Enhancements:

Nothing at this time. This porject does exactly what I expected it to do.

I received a much help from the authors of the following sites:

 

ownCloud Down!!!

The other day I was updating the Raspberry Pi, and some updates got pushed out to the Pi running ownCloud. And it broke… Apparently, ownCloud itself was updated, but the update pushed the application into Maintenance Mode. I had to fix it. 

Went to /var/www/owncloud/config/config.php and changed ‘maintenance’ ==> true, to  ‘maintenance’ ==> false, and then returned to the ownCloud login page. Fortunately for me, from there it was easy. ownCloud asked if I wanted to install the update, and I said yes. Next thing you know, I was up and running.

That’s one of the cool things about these projects, new issues keep coming up. It’s good to always have an opportunity to try something new practice my troubleshooting skills.

What does my dog do all day?

My wife Kristin and I were talking about our dog, Wendy. We were wondering, what does she do all day while we’re at work?

Wendysaurus Rex
Wendy likes to stand on her hind legs.

This inspired the WendyCam. Our little pup is insanely curious, and always trying to get people food. In fact, we only recently learned that she can leap onto our kitchen table! But does she do this when we’re gone? Using a Raspberry Pi and some extra hardware, I built an always-on webcam to stream and take pictures when motion is detected.

One of the really cool things about this project was how much I learned about Linux as an OS. I learned more about how permissions work, and this was a great exercise in using Bash, as I did this entire project by logging in through SSH.

For this project I used the following:

– Raspberry Pi Zero
– USB wireless network adapter
– Raspberry Pi Camera module (You could also use a PS3 Eye Camera or any other USB camera)

Steps I followed:

  1. Prep Raspberry Pi Zero
  2. Install Motion
  3. Configure Motion
  4. Watch dog and be happy

1. Prep Raspberry Pi Zero

Wendicam on Raspberry Pi Zero
Wendycam on Raspberry Pi Zero

I choose the Pi Zero because of its small size. I want the computer to be fast so I loaded it with Raspbian Jessie Lite. This image of Raspbian does not come with a GUI, so you have to access it totally through the command line. Once the Pi was setup correctly, I connected my Pi Camera module camera. I went with this camera because of its small form factor. To use it, I had to go into the Raspberry Pi’s configuration to activate the camera. I could use almost any other USB camera. Additionally, I have tested it out with an old PS3 Eye camera I had lying around with no issues. I then plugged in a USB WiFi adapter so that the WendyCam can connect to the internet.

IMG_20170605_213310After getting Raspibian ready to go I created a case. It’s pretty fancy. I used electrical tape and a lunchmeat container.

 

 

2. Install Motion

Why Motion? Well, Motion is an open-source software that is pretty simple. It does not take many resources to run, and there is a ton of documentation out there.

sudo apt-get install motion

That installs the program. Next, I opened up a file that would allow the daemon to run on startup.

3. Configure Motion

Save the changes and open up the /etc/default/motion file and make the following changes:

sudo nano /etc/default/motion

start_motion_daemon=yes

Next, I opened up the program’s configuration file. This is what really controls the software. Starting out I edited a few things to get a higher resolution and allow streaming.

sudo nano /etc/motion/motion.conf
# Image width (pixels). Valid range: Camera dependent, default: 352
width 1920
# Image height (pixels). Valid range: Camera dependent, default: 288
height 1280

# Restrict stream connections to localhost only (default: on)
stream_localhost off

FOR PICTURES:
# Threshold for number of changed pixels in an image that
# triggers motion detection (default: 1500)
threshold 3000

# Picture frames must contain motion at least the specified number of frames
# in a row before they are detected as true motion. At the default of 1, all
# motion is detected. Valid range: 1 to thousands, recommended 1-5
minimum_motion_frames 4

# Target base directory for pictures and films
# Recommended to use absolute path. (Default: current working directory)
target_dir /var/lib/motion

After this, I forwarded port 8081 from the internet to the Wendy Pi’s internal IP address. This allows me to view the WendyCam from my phone.

4. Watch dog and be happy

To start I type:

sudo motion

And there we go! Kristin and I can watch Wendy all day long! Turns out she mostly sleeps. But, she looks adorable doing it.

Screenshot_20170526-115904

Takeaways and future thoughts

Unexpected problems:
The settings within Motion are all over the place. It took a bit of time to optimize it for the Raspberry Pi camera module. The default settings also took a ton of pictures. At least 1GB a day. Tweaking the settings slowed this down.

I also learned that I couldn’t easily delete the photos in the /var/lib/motion folder. Although this was eventually solved by changing the app permissions

sudo chown pi /var/lib/motion
sudo chmod 777 /var/lib/motion

I also stopped it from taking pictures all together so we only use it to stream now.

Future Concerns:
As always, what happens if my IP address changes?

Future Enhancements:
I need a camera case! It’s great that I have the camera up and running, but I want to protect the camera cable, and maybe mount the Wendycam on the wall.

I received a much help from the authors of the following sites:

http://www.techradar.com/how-to/computing/how-to-build-a-raspberry-pi-security-camera-1321441

https://github.com/Motion-Project

Google Phishing PSA

There was a phishing email going through Gmail earlier today, and Google​ pretty much solved the problem, but… Here’s some thoughts.

Don’t open it. It is from hhhhhhhhhhhhhhhh@mailinator.com, and looks like someone is sharing a document with you. They’re not. 

Delete it.

If you already opened it, change your password ASAP.

Also go here: https://myaccount.google.com/permissions and remove permissions for “Google Docs” if it appears there. This is a really well-done phishing attack.

Mike defines tech

Hey, there! I’ve got a brief update. I’ve added a “Tech Terms” page the website. As I write these articles, I find that I’m constantly defining some terms that I use. Now, this blog is for beginners and tinkerers alike, so I want to cater to everyone. Going forward, if you are wondering what I’m talking about, click on over to the Tech Terms page and learn something new.

In the coming weeks, I have several articles in the works, and I can’t wait to share my new projects with you!