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.
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.
- Install Win32DiskImager from Source Forge on my Windows box
- Downloaded the Raspbian "wheezy" latest and greatest using the torrent from the RaspberryPi website
- Extracted the zip file from the torrent
- Used Win32DiskImager to Write the .img file to the MicroSD card
- Remove MicroSD card from PC, and put into RaspberyPi
- Plugged in Ethernet cable to router
- Plugged in power supply
- Booted up Ubuntu box on same network
- Determined Raspberry Pi IP address using router page
- Set a static IP for the Raspberry Pi on the router (192.168.0.128)
- ssh into Raspberry Pi from Ubuntu box using the defaults (ssh pi@192.168.0.128 and then password raspberry)
- Entered suggested command prompt sudo raspi-config
- Chose Expand File System
- Chose Change User Password
- Chose to setup the timezone
- Chose Finish
- Prompted to reboot, and kicked off SSH as a result
- Waited a bit, and then SSH'd back in
- Ran sudo su
- Ran apt-get update && apt-get --yes --force-yes upgrade
- Ran apt-get --yes --force-yes install dnsutils dnsmasq
- 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
- Ran vi /usr/local/bin/adblocks.sh
- 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
- Ran export EDITOR=vi
- Ran crontab -e
- Added @weekly /usr/local/bin/adblocks.sh to the bottom of the file and saved (ESC G o type, ESC ZZ)
- Hopped on the router and changed it's DNS server to be the RaspberryPi
0 Comments:
Post a Comment
<< Home