Linux

Raspberry Pi Keeps Rebooting

For a while now, I’ve had issues with my Raspberry Pi rebooting by itself. At first I thought I was drawing too much power with the items I had plugged into the USB ports. So I unplugged them both (an external hard drive and a USB WiFi dongle), but the Pi kept rebooting. Finally, I remembered that I had traded the power supply out to use as my phone charger a while back.

How to Stream Videos from a Raspberry Pi to a Smart TV

Summary: Install and configure minidlna on your Raspberry Pi and make sure it’s on the same network as your Smart TV. Your TV’s media playing application should see the Pi on the network and let you browse and play videos on the Pi. More In-Depth Guide First you need to install minidlna on your Raspberry Pi: sudo apt-get install minidlna minidlna’s configuration file is located at /etc/minidlna. We want to edit this to point to our video files:

Changing the default session in Elementary OS

I installed Elementary OS a few months ago, but moved back to Ubuntu for some reason or another. A couple days ago I decided to give Elementary OS another try. Well, tonight I finally started missing openbox too much and decided to install it and give up on Elementary’s default desktop manager. Once I installed openbox, I logged out and noticed that the greeter didn’t have a way to change the session.

Automatically Mount a Drive when Linux Boots

If you want to have a drive (more specifically, a partition) mount when a GNU/Linux distro boots, simply add it to your /etc/fstab file. The fstab for Ubuntu usually looks like this: # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed.

Adding a user to sudoers file

“username is not in the sudoers file. This incident will be reported.” Aw. Well if you have root access, here’s how to add your user to the sudoers file. This will allow you to simply use sudo instead of su and logging in as root. su echo 'username ALL=(ALL) ALL' >> /etc/sudoers The first command will ask you for the root password. The second command adds username to the sudoers file.

Check a site for 404 errors with wget

No one wants broken links on their site. Here’s an easy way to check for 404 errors among the links on your website. First, you’ll want to run this wget command: wget -o ~/output.txt -r -l 10 --spider http://yoursite.com This will run wget recursively up to ten links deep. This means it finds each link on http://yoursite.com and tests if they exist, then checks each link on the pages it just tested up to a path of 10 pages from the original.

Alternatives to the Big VPS Companies

When it comes to renting a VPS, most people have heard of and use companies like Linode, Rackspace, Amazon, or Digital Ocean. These are great and they offer some pretty cool products. I used Amazon’s free offering for a bit (the Micro instance), and I’ve used Digital Ocean’s bottom two instances: 512MB Ram, 1 CPU, 20GB SSD for $5/month - and 1GB RAM, 1 CPU, 30GB SSD for $10/month. I thought this was great, a powerful VPS with 1GB of RAM for only $10/month!

Blocking IP Addresses with Nginx

Nginx is a powerful web server program. I have discussed before the growing popularity of nginx and how to get started with it. This post will build on that and show you how to block and allow specific IP addresses with nginx. Blocking IP addresses is useful when you want only certain people to access a website. I’m sure it’s not a complete block from a security standpoint (throw some kind of authentication in play if you want to be sure), but it works pretty well.

Using a USB drive as OS root on a Raspberry Pi

This is how you change your root file system to use a USB drive on a Raspberry Pi. First, let's make sure you know which partition is your root file system right now. Enter this command in a terminal on your Raspberry Pi: df -h It should say something like this: treddell@penelope ~ $ df -h Filesystem Size Used Avail Use% Mounted on rootfs 15G 1.9G 13G 14% / /dev/mmcblk0p2 15G 1.

Checking the CPU Temperature of a Raspberry Pi

There a couple ways to look at the CPU temperature of a Raspberry Pi. One is using this command: cat /sys/class/thermal/thermal_zone0/temp. This will return the temperature in millicentigrade, with quick conversions to centigrade being something like (in your language of choice) value / 1000.0 and to Fahrenheit value / 1000.0 * 9/5 + 32. Check out more posts about the Raspberry Pi here: Raspberry Pi Posts