Home - Archive - RSS Feed - Contact

Raspberry Pi Keeps Rebooting


2016-04-09

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. It turns out that the new power supply I was using is only rated at 550 milliamps. That's a lot less than the old supply I was using, which was 1 amp or 1,000 milliamps.

It turns out the recommended power supply should provide at least 1.8 amps for my Raspberry Pi Model B+. So 550 mA was just not going to cut it.

Even though the Pi uses micro USB for power, you can't just plug in any charger or power supply that will fit. Look for a 2 amp supply, like this one: EasyAcc 5V 2A Micro USB Charger. Or check out other options on Amazon.

My Raspberry Pi set up, for reference:

  1. Raspberry Pi Model B
  2. Toshiba 1 TB External Hard Driv
  3. Edimax WiFi Dongle

Check out more posts about the Raspberry Pi here: Raspberry Pi Posts

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


2016-02-22

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:

sudo nano /etc/minidlna

Around line 25, your media folder is set:

media_dir=/var/lib/minidlna

You can either change that to something like

media_dir=/home/username/videos

or link your video folder there with this command:

sudo ln -s /home/username/videos /var/lib/minidlna

Finally, restart the minidlna service:

sudo service minidlna restart

Now you're Smart TV's media application should be able to find your Pi if they are on the same network.

Check out more posts about the Raspberry Pi here: Raspberry Pi Posts

Remove Desktop GUI from Raspbian


2015-10-16

If you're looking to save some space on your Raspberry Pi (mine runs on a 4 GB SD card), run these commands to remove all desktop/gui-related programs:

sudo su

apt-get install deborphan -y

apt-get autoremove --purge \
libx11-.* lxde-.* raspberrypi-artwork \
xkb-data omxplayer penguinspuzzle \
sgml-base xml-core alsa-.* cifs-.* \
samba-.* fonts-.* desktop-* gnome-.* -y

apt-get autoremove --purge $(deborphan)

apt-get autoremove --purge

apt-get autoclean

That will remove the desktop programs and any orphan programs left behind.

Check out more posts about the Raspberry Pi here: Raspberry Pi Posts

The Random Information Post


2015-06-18

This is a sort of catch-all post that will house random coding/sysadmin things I don't use enough to memorize.

Network Drives

Mount a volume over SSH

sshfs -p 2345 -o IdentityFile=~/.ssh/id_rsa user@domain.com:/remote/path /target/path

SQL

Compress a mysqldump

mysqldump -u user -p -B database_name | gzip > ~/backups/backup1.gz;

Video

Merging AVI files

mencoder -noskip -oac copy -ovc copy `ls 20150203*avi` -o digest.avi

add -mc for audio sync

Renaming files using regular expressions

I had a bunch of backed up files with names like:

* 201506.pdf_2015_10_08_160622
* 201507.pdf_2015_10_08_160622

To remove the timestamp suffix, I used the rename utility. I had to install it with homebrew in Mac OS, but it works great:

rename 's/_2015_[0-9]{2}_[0-9]{2}_[0-9]{6}//' 2015*

ran in the above directory will give files named

* 201506.pdf
* 201507.pdf

Securely Wipe Drive

dd if=/dev/zero of=/dev/sdX iflag=nocache oflag=direct bs=4096

Convert all mkv files to mp4 in folder

for f in *.mkv; do avconv -i "$f" -codec copy "${f%.mkv}.mp4"; done

How to Fix the "VT-x is not available" in VirtualBox


2014-09-07

I recently ran across this error when moving a VM to a different machine. To fix it:

  • Close VirtualBox
  • Go into the VM folder (usually inside a folder like VirtualBox VMs) and open the text file ending in .vbox.
  • Look for a line like <HardwareVirtEx enabled="true"/> and change it to <HardwareVirtEx enabled="false"/>.

That should fix the "VT-x is not available" error.