29.1.15

RaspberryPi Night 1

Went to Microcenter to get a table cover for my $40 Azpen 7" tablet, that was prerooted, and after a quick use of Kingo Root to install SuperSU, as well as an Unistaller, I was able to remove the bloatware/adware preinstalled, and move apps to the SD Card freeing up enough space.

While there saw the RaspberryPi kits with SD Card, Charger, Case, and B+ for ~$70. However, the B+ was only $25, charger $5, SD card $7 and optional case $9. So, I went separate.

Going to work on the step-by-by to install DNSMasq and make a local Ad-blocking DNS server.


  1. Install Win32DiskImager from Source Forge on my Windows box
  2. Downloaded the Raspbian "wheezy" latest and greatest using the torrent from the RaspberryPi website
  3. Extracted the zip file from the torrent
  4. Used Win32DiskImager to Write the .img file to the MicroSD card
  5. Remove MicroSD card from PC, and put into RaspberyPi
  6. Plugged in Ethernet cable to router
  7. Plugged in power supply
  8. Booted up Ubuntu box on same network
  9. Determined Raspberry Pi IP address using router page
  10. Set a static IP for the Raspberry Pi on the router (192.168.0.128)
  11. ssh into Raspberry Pi from Ubuntu box using the defaults (ssh pi@192.168.0.128 and then password raspberry)
  12. Entered suggested command prompt sudo raspi-config
  13. Chose Expand File System
  14. Chose Change User Password
  15. Chose to setup the timezone
  16. Chose Finish
  17. Prompted to reboot, and kicked off SSH as a result
  18. Waited a bit, and then SSH'd back in
  19. Ran sudo su
  20. Ran apt-get update && apt-get --yes --force-yes upgrade
  21. Ran apt-get --yes --force-yes install dnsutils dnsmasq
  22. Ran vi /etc/resolv.conf and added the nameserver 127.0.0.1 at the top using the O command on the top line to insert above
  23. Ran vi /usr/local/bin/adblocks.sh
  24. Saved the following commands in that file with paste ESC and ZZ to save, but did have to use ESC j to get to the top and then reinsert the wget-O using the i command first
wget -O /etc/dnsmasq.conf  "http://www.needtoknowdesigns.com/hosts.txt"
# delete lines that start with a comment line
sed -i 's/#.*//g' /etc/dnsmasq.conf
# removes windows oddities?
sed -i 's/\t//g' /etc/dnsmasq.conf
sed -i 's/\r//g' /etc/dnsmasq.conf
# removes the localhost line
sed -i '/localhost/d' /etc/dnsmasq.conf
# change 127.0.0.1 to dnsmasq format
sed -i 's/^127.0.0.1\s/address=\//g' /etc/dnsmasq.conf
#remove blank lines
sed -i '/address/!d' /etc/dnsmasq.conf
# line below failed before
#sed -i 's_$_\1/0.0.0.0_' /etc/dnsmasq.conf
# alternate line that puts in the 0.0.0.0 at the end, but on a new line
sed -i 's/$/\/0.0.0.0/' /etc/dnsmasq.conf
# removes everything...
#sed -i 's/[^ -~]//g' /etc/dnsmasq.conf
#no idea but it didn't break it
#sed -i '/address/!d' /etc/dnsmasq.conf
service dnsmasq restart

  1. Ran export EDITOR=vi
  2. Ran crontab -e
  3. Added @weekly /usr/local/bin/adblocks.sh  to the bottom of the file and saved (ESC G o type, ESC ZZ)
  4. Hopped on the router and changed it's DNS server to be the RaspberryPi 

                                            0 Comments:

                                            Post a Comment

                                            << Home