Thursday, December 23, 2021

Razor Dirt Bike modding for weight savings and speed featuring Hart drill batteries

I recently purchased a Razor dirt bike to mess around with.  They are under 500 bucks on Amazon and I figured I could make it fun with a bit more investment and using what I had on hand via the easiest means possible.  Part 3 went off the rails, but that's ok.  It was worth it.

Here are 3 videos I posted on its progress.

It is a beast now.

Part 1:


 

Part 2:


Part 3: 

 

Part 4:




Friday, October 29, 2021

Install Docker and Portainer

Install Docker and Portainer

This is a quick and dirty install onto an Ubuntu Server 20.04 install.

Docker:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt install docker-ce
sudo systemctl status docker
sudo usermod -aG docker ${USER}
su - ${USER}
groups

Install Portainer:
cd ~/
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
http://server_name:9000

Add Application Templates from Reddit Github:
Go to Settings | App Template and enter:
https://raw.githubusercontent.com/SelfhostedPro/selfhosted_templates/master/Template/portainer-v2.json

Default App Templates:
https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json

Sunday, November 22, 2020

Free or cheap - No Internet Access travel Plex server and client setup Go Box

 

Road trips suck, and so does staying in a location that has poor internet bandwidth for streaming. There are a few options for consuming content while traveling with no internet connection like preloading media to a device. 

Scenario:
You are road tripping to the inlaws house 12 hours away in the family mini van.  You have two kids and two guest kids and all are in need of entertainment for at least some of the trip.  The inlaws live in the sticks and they have terrible internet service through a local mom and pop shop.  You need something flexible and easy for anyone to use - and that can work in the vehicle as well as the inlaws house.  All while consuming no internet bandwidth.


Solution:
Bring your own Plex server and streaming clients for use while on the road and also while you are at your destination. Emphasis on cheap, power efficient and small. This solution could also be free if you have all of the parts on hand already, cheap if you just need a couple of items.

 


Pictured above is my setup: Khadas Vim2 SBC, 1TB SSD, and a GL.iNet GL-AR750S-Ext Travel Router, and Monoprice travel box.

 

1.  Server:
Use a Pi single board computer as your server. You can use a Pi that has Wifi builtin and set it up as a Wifi hotspot for one stop shopping, or save some hassle and purchase a travel router to handle your wifi connection.  I suggest going with the wifi router.  It is what I did and is fairly cheap and will be much easier to get set up initially.

How to set a Raspberry Pi up as a wifi hotspot:
https://thepi.io/how-to-use-your-raspberry-pi-as-a-wireless-access-point/

In my setup, I had a Khadas Vim2 on hand and decided to use this for my Plex server.  Any recent Pi device should do it for you, but I suggest getting one with a gigabit NIC if you are using the wifi router below.  The server will not need to transcode media since your clients will be direct playing.

 

2. Wifi Access Point:
There are a few solid and affordable travel routers.  I suggest getting one with firmware that can be upgraded.  I chose one with OpenWRT firmware and Gigabit network switch:
https://www.amazon.com/gp/product/B07GBXMBQF

 

3. Power:
Both the Pi and the router are powered via USB, so this makes them totally flexible.  In the car, power from a 12 volt outlet with a USB adapter or from a power bank.  Otherwise they can be powered via cell phone charger while indoors.


4. Media Storage:
I suggest a portable USB drive for this with as much capacity as you think you need to store media for your trip.  A Portable USB SSD drive would be best for low power draw, no noise and quick access speeds.  Hopefully you have one of these on hand, as they can be pricey.  Be sure to plug it in to the fastest USB port available on your Pi device.
I also suggest attaching this drive to the Pi server with a rubber band or something similar to keep things together and tidy.

5. Plex clients:
Any phone or tablet that you have on hand will work.  I suggest storing in your go box a media streaming stick to connect to the TV when you get where you are going.
If you need a cheap small tablet for use in the car:
Walmart has an Onn brand tablet available for $28 that runs Plex fine (also with a headphone jack or Bluetooth for audio) and does quite a bit of normal tablet work if you are a bit patient with it.
https://www.walmart.com/ip/onn-7-Tablet/930669857
(Bummer, the price for these is now 50 bucks, but expect it to go back down for the holidays.)

 

Once you get this setup up and running, you will want to set your Plex Server to run offline:
https://www.howtogeek.com/303282/how-to-use-plex-media-server-without-internet-access/

 

6. Weather resistant travel Box to keep everything tidy while in use as well as store it when not in use:
https://www.amazon.com/gp/product/B013Z74LNQ

 

Summary:
I like this solution because it is an interesting project to construct and it is 'set it and forget it.'  Load your media ahead of time and then you are all set.  Nothing to revisit.  While packing for a trip, just grab your go box and you know you have your media needs taken care of.

Also: Be sure to do a test run with your clients while offline to avoid issues and complaining once you set off on your trip. :)

 

Here are a few more pictures of my setup:



Side view.  I am going to try a less bulky USB to SATA adapter soon as well.

2.5 inch drive for scale.  This is a small setup.

 


 

An alternative solution for this problem could also be a WD Passport Pro Wireless that can run a Plex server. 
I did some looking around at how well this is working for others, and the result is that it is working really bad.  WD puts out updates for the Plex server software, so they are not on time and probably won't do this for long, if at all.  Probably a good idea to avoid this option altogether.

 

Friday, August 21, 2020

Geforce Now game changer for legit (cheap and free) top shelf Linux gaming on your Jalopy computer!

Nvidia Geforce Now has been around for a little while, but never had a client for Linux.  Geforce Now is awesome because it allows you to play games on non-gaming capable computers.  So that jalopy that you have had for years that does everything else fine, can acceptably play the latest games now too.

Nvidia just recently announced that Geforce Now can be run on a Chrome computer device (Chromebook typically) which are outfitted with very basic hardware.

Chrome devices are just modified Linux systems, so this is interesting.  Soon after the announcement of Geforce Now on Chrome devices, we have details on how to run it within Linux and I have tried it on my Linux Mint machine and it works perfect and pretty awesome.

Check out the details here:

https://www.androidpolice.com/2020/08/20/how-to-play-geforce-now-in-your-chrome-browser-without-installing-anything-on-your-pc-or-linux-machine/

Even if you don't have a Linux computer, you could run this on your Mac or Windows computer and avoid installing the Geforce client.

One interesting thing here is that (even paying for the service) you could play the latest and greatest games and save a ton of money over constantly chasing the hardware requirements of the latest games.

Geforce Now doesn't work with all games, so check their list to know what you can and can't play.

Saturday, August 15, 2020

Exclude a single (or many) device from PiHole ad blocking quick and easy

Exclude a single (or many) device from PiHole ad blocking quick and easy.

 

I had to do this for my Arlo cameras.  PiHole was not blocking anything with relation to them, however they were not functioning properly while the PiHole was enabled.

The cameras were not recording movement and the Arlo web interface was telling me that my base station could not communicate with the internet after login and about a minute of login time.  If I disabled the PiHole for 5 minutes, the Arlo cameras and web interface would work fine.

There appears to be no way to set a static IP address and static DNS servers on the Arlo, so no way to set a different DNS server just for Arlo and bypass the PiHole.

Here is how I fixed it.

Using a typical router for DHCP for all clients
Configure router so that the client you want to have no PiHole interference on is  getting a static IP
Create a new group in PiHole in group management
Find the client (ip) in group management clients and add it to the above
created group
Create a regex white filter for all, e.g. .+
Add that filter to the above created group only under Group Management | Domains

That's it.  It will take effect immediately.

Sunday, March 8, 2020

Ghetto fix for Bose QC35 headphones that won't pair Bluetooth

I noticed like others have that my original Bose model QC35 headphones would not pair.  I beat on the switch all I want, but no ready to pair voice.
I took it apart following youtube instructions and did the rubbing alcohol fix.  That seemed to work while the headphones were apart, but once I put the back plate back on, no go.
So now, I take the back plate on and off and the consistent problem is that it will pair all day with the cover plate off, but never while the cover was on.
Eureka!  We have a switch throw problem.
So I took out my drill and a sharp bit and proceeded to mangle the cover to test this theory.  Note that I didn't do a good job following the angle of the switch, but it is functional.
You could do a much better job, but faced with the death of a nice older set of otherwise functioning headphones, I didn't take much care and mangled away.  A good thing to do from here would be to use a black sharpie to color in the edge so that it is not as noticeable.
I hope this gets out there and helps somebody with the same issue.


Update June 10, 2020:
This fix worked for me for a bit, but the switch was rotating inside the headphone assembly.  I decided to remove the plastic power switch that is normally used entirely.  This leaves a tiny power switch that is not handy to get to inside the headphone.  I am now accessing it through the enlarged hole and using a pen to reach it and power the headphones on and pair bluetooth that way.  It is not ideal, but it is working fine for me.

Monday, May 13, 2019

Plex Hardware Transcoding performance on a $35 Atomic Pi


Background: The Atomic Pi is a $35 single board computer with an Intel Atom Z8350 quad core processor.  This processor comes with a graphics core that doesn't specify Intel Quick Sync, but based on the video processor details I thought it was a feature that was available.

Wanna know more about this board?  Head over to the Atomic Pi subreddit. Or have a specific question?

I set out to run Plex on the Atomic Pi to see if it would do hardware transcoding of videos.  Plex transcodes out of the box with no modifications if you are using an Intel CPU with the Quick Sync feature.

I don't expect the Atomic Pi to be a world beating Plex server option, but for $35 if it can manage a couple of transcoded streams it would be very impressive.

Test Details:
-Wiped the Atomic Pi's onboard storage and installed Ubuntu Server 18.04.2 LTS with all patches up to date as of 5-13-19.
One thing worth noting, you will want to use a powered USB hub if you are installing Ubuntu from a USB DVD drive.  I cracked my head on this one for a bit because the Bios would see the DVDROM but the board would not boot from it.  I eventually just installed Ubuntu Server from a USB flash drive with the install files on it since I didn't have a powered USB hub handy.

-Installed Plex Server quickly and simply by running the command:
sudo snap install plexmediaserver

-Configured the Plex server via its web interface and be sure to tick the box under the transcoding section to do hardware transcoding and I left the transcoder quality setting to the default of auto.

-Downloaded the Big Buck Bunny 1080p Surround .avi file to test with and copied it to the Atomic Pi local storage.


Here are the results: (click any image for a larger view)


I was able to run 4 transcodes of various qualities before things started maxing out.  You can see the (hw) was activated on each streaming session.  I would say that 4 is the max for this video and 3 would be ideal.  It could probably manage some non transcoded direct streams as well here since they don't impact the device much at all.  Depending on your user load, you could actually use this as your primary Plex server.  
If you have 2 direct streams and 2 transcodes happening at the same time and depending on the video it might just be able to do it. It could certainly do it with this video.

 
Reported CPU and bandwidth usage data from Plex during 4 transcode session.


You definately should click this image for a better view of the data.....

Here's the result from the python utility: s-tui running on the Atomic Pi during the 4 transcode session.  You can see  that it was putting in work, but the graph is similar to what Plex saw also.  Some spikes to 100% CPU, but it was by no means fully saturated.  It also shows the frequency of the CPU, and thanks to that monster heatsink, the CPU was not throttling due to overheating.

Well, that's it.  I hope this helps you understand the kick ass deal that these boards are for the capability that they are capable of being capable doing.  :)




Bonus Content:
I figured someone might wonder what transcoding looks like on this board without the hardware box checked in Plex and just done via software against the CPU.

Here are the graphs.  It is possible, but only a single stream.


The CPU is pegged and stays pegged during this single software transcode stream. 


Linux utility agrees.  It is flat out, but is actually making less heat and consuming less power.  The hardware video processor onboard does take some power to do its work during hardware transcodes apparently.  Seems logical.

 


Monday, November 26, 2018

Synology DS1817+ Benchmarks of Spinning SATA, Spinning SATA with PCIe mSATA Cache, and 2.5 inch SSD drives

I am running a Synology DS 1817+ NAS device, and was curious what the impact was of the different drive types in my homelab scenario.  I want to know what the bottleneck is and if I am really just a damn idiot for not running multiple NIC ESXi hosts and a smart switch with multiple LAG ports, etc. as people love to recommend based on no real data in the real world of a small homelab.

I fully admit that my homelab is not ideal, nor fully optimized for speed, nor is this a scientific test of multiple VMs merking the storage in some worst case scenario.  This is just a baseline.  If you want to see more data, run the benchmark on your gear under your scenario, or publish your own data based on your methods.

Here are the specifics of my homelab:

1. I am not using Jumbo frames
2. I am virtualized using 6th Gen I3 based Intel NUC ESXi hosts with single gigabit NICs.  No additional NICs are being used.  Are they my bottleneck??
3. I am running a dumb, unmanaged 8 port Dlink gigabit switch.  Is this a problem?
4. I am running from a single network interface on my Synology device.
5. I do not care to run faster infrastructure or ESXi host gear, as my stuff is plenty fast and I would like to expose the goons that think they have to have gear that is more complicated and power hungry than mine just so that their VMs can run slower than mine.
6. I am running ESXi 6.5 and connecting to the synology via iSCSi.

I want to diffuse any assumptions based on theory rather than fact that a proper home lab 'needs' enterprise grade gear.  Enterprise grade gear is great to learn on, but most management interfaces are available for learning in virtual environments via virtual appliances if you google around to find them, so the 'need' for true enterprise gear in your home is typically minimal.

I want to see the value in running either PCIe SSD based cache or SSD SATA drives.  Which is best?

This is an incredibly simple and repeatable benchmark done in Windows with the free HDTune utility.  No settings were changed within the program.  I hit the start button and ran it three times.  Once with the VM on SATA spinning disks, once with the VM on SATA spinning disks backed by PCIe SATA cache, and once with the VM on SATA SSD drives.

In the above image, we are seeing the utility that has run against a Windows VM with updated VMware tools installed and running on 5x 7200 RPM Segate SATA drives in a RAID 6 configured with 2 drive redundancy.


In the above image, we are seeing the utility has run against a Windows VM with updated VMware tools installed and running on 5x 7200 RPM Segate SATA drives in a RAID 6 configured with 2 drive redundancy backed by a Synology M2D17 M.2 Adapter Card that has 2x Crucial MX300 275GB M.2 (2280) Internal Solid State Drive - CT275MX300SSD4 configured in a mirror array with both read and write caching enabled.


In the above image, we are seeing the utility has run against a Windows VM with updated VMware tools installed and running on 2x Mushkin REACTOR 1TB Internal Solid State Drive (SSD) 2.5 Inch SATA III 6Gb/s MLC 7mm MKNSSDRE1TB 

What can we conclude from the above data?
1. You can see that the PCIe SSD offers faster burst times and faster average times as well.  This is probably the result of the benchmark data running fully from the SSD Cache and not from the spinning disk.  However the access times are only slightly better than spinning disk and the pure SATA SSD drive wipes the floor with both of them in access time.
2. We can also conclude that the SATA interface is a bottleneck vs the PCIe cache as well.  I don't know if the bottleneck is at the Synology or the Muskin, but the SATA interface is definitely is not bottlenecking at the network since the PCIe benchmark is faster.
3. It is possible that the PCIe Cache is bottlenecking at the network.  I don't know since I cannot run it on a faster network infrastructure to see.

Now having run this, we know that the network speed is important, and probably more important as you have many VMs slamming the disk subsystem of any configuration at the same time.  This is an example of a single VM hitting the storage at a time.
Many hitting it at the same time would expose more bottlenecks in relation to the network speed.
However, this benchmark does tell us that in smaller home labs, getting away with a single gig network interface is acceptable even if your disk subsystem is really fast.


Plex Hardware Transcoding with an Intel CPU inside an Ubuntu VM on ESXi

Plex Hardware Transcoding with an Intel CPU inside an Ubuntu VM on ESXi

Required Components:
1. A reasonably current Intel CPU with Intel Quick Sync Video capabilities.
Check your processor capabilities here: https://ark.intel.com/
2. Plex Pass Subscription
3. VMware environment.  This guide is using ESXi 6.5, but 6.0 will work also.  I have not tried other versions. -A setup with the free version of ESXi installed on a standalone host would work here.

Background:
I have been running a Plex server for years and never really paid much attention to transcoding in hardware mainly because it was a feature reserved for Plex Pass Subscribers, (which I was not) and I didn't have many friends and family accessing my media.  I recently became a Plex Pass user with a lifetime subscription deal that they sent me via email.
I always run my Plex servers inside of a VM because I run a home lab and have VM resources always available and ready to do work.
My homelab consists of two I3-6100U processor 6th generation Intel NUC VMware ESXi hosts.  These NUCs are perfect for me since they were affordable, low power, quiet, extremely tiny, and easy to add to by stacking on another NUC.  Also, if you are in a situation where you are regularly moving apartments, home, dorms, etc.  You cannot beat a space optimized home lab.  Plus ESXi installs on the 5th gen NUC with no need for additional work.  My home lab, like most others is not a big consumer of CPU most of the time.

Home lab shown.  The cardboard is there to keep the drive trays from vibrating and making noise. 6x 8TB drives for media storage, 2x 1TB SSD drives for VM datastore, unmanaged 8 port gigabit switch, 2x Intel NUC6i3SYK NUCs configured with 32 gigs RAM each.


I did some reading and experimentation with transcoding because I was getting more friends and family hitting my Plex server recently.  I felt like I needed to monitor performance and make sure that I had enough resources for this additional load.  Most outside users were transcoding due to bandwidth limitations, whereas I was always doing direct play when watching at home.
I was surprised with the results of my testing.
Plex has a ton of information about transcoding.  I took a look at this page and learned how to enable hardware transcoding, the requirements and how to experiment with forcing transcoding:
https://support.plex.tv/articles/115002178853-using-hardware-accelerated-streaming/

To experiment, I began streaming a 1080p movie and watched my Plex VM by logging in and running the HTOP command. (It is an Ubuntu Server VM)

Direct Play didn't hit the CPU much at all.  I then changed to a transcoding resolution and my Plex VM saturated all of the CPUs granted to it (2) for quite some time.  The video played just fine, but I needed to avoid this saturation if possible.  After the initial CPU spike for upwards of 1 minute, it calmed down a bit to about 60% usage during the video playback.
I tried giving the VM 4 virtual CPUs since my I3 has two physical CPU and two hyperthreaded virtual cores.  As you can imagine, this didn't do much.
So now that I knew this was happening, I needed to enable hardware transcoding at all costs, but I didn't want to incur a cost. 
Plex says in the link above that hardware transcoding is not possible inside of a VM.  Damn!  But let's not take their word for it, let's try it anyways.
I went to Direct Access settings in my host, and I saw the video card available and configured it for access.








This change required a restart of the ESXi host, so I did that.
Then I shut down the Plex VM and added the direct access device.  Looking good so far.


Upon booting of my Plex VM, I got back into the Plex interface and tried watching the same movie.  I made no changes to the Plex VM.  I didn't look for drivers nor try to install anything on my Plex VM.  I am running Ubuntu Server 18.04 LTS.
Direct Play worked as expected, but then I switched to a transcoding resolution and was immediately impressed.
It switched over very fast and I saw the indicator that I was transcoding in hardware: (hw) was showing on the Plex web interface server status.  Wow.  That's it?  That was easy.

What does this mean for performance?  Huge for me, as I am running on underpowered hardware in the first place.  After the change, transcoding took nearly zero CPU resources since it was all being done by the onboard video portion of the Intel CPU.  There was just a slight hit well under 100% CPU consumption while the video started streaming, and nearly zero hit after the initial spike.

What is the drawback for the VM and general VMware functionality?  Well, this is the trade-off.
1. You can't do a live vMotion of the VM because it has direct attached hardware.
2. It requires you to reserve RAM for the VM.  Not a ton though.  I have 4 gigs RAM allocated to my Plex VM, and it is not using that much.  I could probably allocate 2 gigs and be fine.  I set a RAM reservation to 4 gigs.
3. You can't do a snapshot of the VM.
 
For me, these are acceptable trade-offs since I was considering setting up a dedicated NUC for Plex serving to take advantage of the hardware transcoding.  This avoids needing to do that and allows me to run additional VMs on this ESXi host like I already was, I just need to shut down the Plex VM if I need to do any ESXi host maintenance.


I don't know if this would also work with an AMD based CPU, but it would certainly work if you had an ESXi host with some graphics card solution installed.  You'd just need to research which graphics cards ESXi can recognize and allow direct access to.

***Followup on this.  I was curious if this will allow me to transcode 4k video.  I don't have any 4k content, so I got a sample 1 minute of Elysium from http://4ksamples.com/ 

Even with transcoding confirmed to be done in hardware now, I could not watch the 1 minute video without the video buffering twice and then crashing.  It started strong, but couldn't really make it past 30 seconds.  Oh well.....  4k aint no joke. 

Tuesday, February 9, 2016

Chuck's Solar Calculations



I finally got my 5,000 watt solar system installed and running.

See My Live System Stats Here

Let's review some figures and see if this was a good investment:

5kW kit from Go Green Solar is $7450 
(No sales tax on solar gear in Florida is the only state sponsored incentive currently.)
Add $450 for the engineered drawings
Add $800 for permitting, wiring and an electrician's help
Add $50 for some cheap beer for your buddies that are gonna help you install

Total Damage: $8750
Subtract the 30% tax incentive offered by Uncle Sam: Subtract $2625.

Actual cost to you: $6125

Lets say this will generate 800 kWh of power per month averaged over the year and your power company charges $.117 per kWh of power.
This equals $1123 of savings per year.

Now, you are looking at your investment and thinking it is a bad one because it will take 5.5 years to pay off.  This is correct, but on the 6th year, it is paying more than if you had invested $6,125 in some bank that pays 2% interest. 
(Most 5 year CDs right now are paying 2%)
$6125 invested at 2% for 6 years will be $6905
$6125 invested into solar on year 6 will be $7248
Every single year after the 6th year, you are continuing to earn.  Add to this the real possibility that your power company is gonna raise their rates.  Also, your solar panels are going to reduce in efficiency at a rate of 1% per year.  Both are a factor, but I betcha that the utility is going to raise their rates at more than 1% per year, so you will still win, but we will call it a wash and say that you will save 1123 for the duration of the system's life.

At 20 years: $1123 x 20 years = $22,460 - $6125 investment = $16,335
At 30 years: $1123 x 30 years = $33,690 - $6125 investment = $27,565

Subtract minor maintenance costs and a replacement inverter in there if you want, but you are still ahead.

So this is only worth a damn if you keep the house for 20 years right?  Heck no.  You have added value to the home that is more, or at least even to what you have into it.  So we will call that a wash.  Even if you were to sell the house a week after you install your solar, you are not going to lose money.

Solar is a winning investment in my book as long as you are willing to put in the initial outlay of money and labor.
Just don't install it in August in Florida.....

Saturday, June 20, 2015

Full cost comparision Civic vs. Leaf for 100,000 and 200,000 miles



Lets do some maths because I am curious why anyone would think driving a Leaf is a good idea.  It is like driving a normal car with 2 gallons of gas in the tank all of the time.  This is stupid right?  Well, as a second car, and for most people, this is perfect.  He has taken 1 road trip in his current Civic, otherwise it is a get to work and get home and run some in town errands car that he is ok with only charging at home via a normal 110 volt power outlet.  He could buy a 220 volt charger and have the 220 volt outlet installed at hos house.  This would charge 2 to 3 times as fast as 110 volt and cost him about 800 bucks installed.  He can get by fine with the 110 charging overnight for the forseeable future however, so this cost is optional and has not been factored below.
Wayne got his certified preowned 2013 Leaf for $13,700 out the door.  (Not sure if that includes the extended warranty he got.  Let's assume it does not.)
A comparable 2013 Civic LX with 30k miles certified preowned NADA's for $18,750 plus tax, tag and title.  Lets add $1500 for tax, tag and title.
Let's assume that the Civic calls for timing belt replacement at 75k miles at $650 bucks and there are oil changes every 5k miles at jiffy lube for a cost of $40 each.  Tires, wiper blades and other comparable items cancel each other out for these cars.
Lets assume that each car is owned for 100k miles, but also calculate for 200k miles.
Leaf Costs:  13,700 out the door.  Electricity costs $.12 per kilowatt hour.  This will go up, but probably so will gas, so let's call the fuel increase equal for both cars.
Civic Costs: 20250 out the door.  Gas costs 2.50 per gallon.  This car will average 32 MPG.
Here is a calculator to figure out the savings.  Yes it is a Nissan calculator.  Feel free to figure this out on your own if you want.
http://www.nissanusa.com/leaf-electric-car/savings-calculator-summary/417647
If calculated that Wayne will drive 32 miles a day (12,000 per year) he will save $491 per year over the Civic in fuel.
100k totals=
Civic = $20,250
20 oil changes per 100k miles = 800
1 timing belt = $650
CPO, so no risk of blowing an engine or tranny.
3,125 gallons of gas = $7812
Other dealer maintenance, repairs and inspections = $500
Total cost for 100k miles = 30012

Leaf = $13,700
Electricity = 8.8 years to get to 100k miles, so savings of $491 per year x 8.8 = 4320.  Subtract this from 7812 = $3492.
Other dealer maintenance, repairs and inspections = $500
Total cost for 100k miles = 17692. 


Let's say his battery capacity degrades to a worst case scenario, which is doubtful but why not.  It is warranted against failure 100k miles, but it will reduce in capacity over time just like a laptop battery and he wants 'like new range' at the 90k mile mark.  Replacement battery retail cost = $5500
Leaf at 100k miles total with new battery replacement = $23192

200k totals=
The Civic has has 2 catastrophic failures to the tune of a $4500 repair bill.  This is generous.  It will undoubtedly be falling apart otherwise at the same rate as the Nissan, so let's say other repairs are a wash, although electric with fewer parts ought to be ahead in reality.
Civic @ 200k miles= $14262  (oil changes, timing belt, fuel and repairs)
Leaf cost @ 200k miles without another new battery = 3992.  Maybe add a battery in there, maybe not.  The car is getting old and reaching the end of its useful life.  Also, there are probably people rebuilding the battery packs for significant savings.  Lets assume the battery still works, but at reduced capacity.  Wayne lives with it because he is ready for a new car.  He will be around 55 year old at this point, maybe a nice new caddy or something.

Wednesday, March 25, 2015

Prius goes into Neutral, but won't go into Park or Drive

I just recently came across this issue with a 2006 Prius that I was doing work on.
I had disconnected and taken out the hybrid battery and after putting it back in and reconnecting it, the car would not go into either Reverse nor Drive.
I did a bunch of googling, and couldn't find the fix.  The car drove fine before I took the hybrid battery out.....

The problem was the hybrid battery disconnect wasn't properly inserted by me.  This is an orange plastic piece that goes in and locks in place.  Well, I thought that I knew how to do it.  Turns out, you have to slide it in and lock it and then press it down to make the connection.  The pressing down was the step that I was missing....

So, to help get this information out there on google for the next dummy like me, I am adding this to my blog.

Here is a youtube video about what I am speaking.  Fast forward to 1:00 to see the press down portion of the operation that I skipped.

https://www.youtube.com/watch?v=YNpFm7D2bLQ

Friday, March 6, 2015

Guide for installing IPFire on a Banana Pi





I have previously posted instructions for running IPFire on a Raspberry Pi here.
You should check out that post if you would like more details on what IPFire can do for you and why this type of hardware will work great for home firewall/router tasks.

Since then, the developer of IPFire has released an update that will allow it to run on the more capable, but still small and power efficient hardware that is similar to Raspberry Pi called the Banana Pi.

The IPFire on the RPi was cool, and got the job done.  I ran it for several months successfully and without any failures, but only after a good bit of tweaking to optimize and not overload it.  I was satisfied with its abilities, but it was lacking in the pure throughput and snappiness of the web interface that it needed.  The installation was pretty easy though.

Enter the Banana Pi.  Still cheap and substantially faster with a dual core Arm CPU, 1 gig of RAM, gigabit NIC and more performance optimized hardware design overall.

This one is not quite as easy to install IPFire on however, thus it needs a separate blog entry with instructions.



First off, lets list the stuff you will need:
Banana Pi
SD Card.  This is the one I am using It is probably overkill.
A 2amp capable USB charger is recommended for BPi.  I chose this one.

Purchase a USB to serial interface cable here
USB Network card.  Here are compatible USB Nics.

Download the IPFire version for Arm that has the serial console enabled here.


Ok now that we have everything together, LET'S DO IT.
Get IPFire copied to your SD card with these instructions

Now here is where it gets a little different.  The IPFire distro does not have the capability to output to the HDMI port on the BPi device.  To do the initial configuration, we need to see the BPi screen.  We must connect to the BPi serial output pins with our USB serial adapter.
This is less than ideal, but the only option with the current IPFire build.

Here are instructions for connecting the cable you bought to your BPi's serial pins.  Not too bad.Look closely at the picture to connect it to the right pins though.  I did this wrong the first time and was pulling my hair out.

The serial interface via Putty kind of sucks though, so you are going to need to feel your way through the installation menus.  Once you have it where you want (or close) your IPFire is booted, you can enable SSH via the web interface and connect to SSH with an SSH client like Putty and run setup again to verify that the settings are the way you want them.
After a day or two and your BPi install is stable, you can disconnect the USB serial cable and stash it.

As with the RPi setup, set your USB Nic as the Red Nic because it will handle your incoming internet connection and unless you have over 100 megabits coming in to your house, you will not hit its 100 megabit bandwidth limit.
Use the onboard 1 gig Nic for the green interface.

Also, as with the RPi, be aware of the delicate SSD drive you are using as a hard drive and see the configs I recommend for RPi in my RPi blog post above.

Now that you have some sweet speeds, DO NOT feel tempted to turn on the Intrusion Detection.  It will render your IPFire dead.  Not sure why, but it causes a kernel panic that rebooting does not solve.  I had to reload my BPi after enabling this.  Oops.

See my blog post for working with big Blacklists on RPi/BPi here.

You are going to want to get some black fingernail polish for those super bright BPi status LEDs as well.  Trust me.



Sunday, January 18, 2015

IPfire feature filled Linux firewall router on Raspberry Pi B or B+ install and config guide

Today we are going to discuss the excellent IPfire Linux router/firewall and how to run it incredibly cheaply and effectively on a Raspberry Pi B series device.

I have had my Pi B model for awhile now and it has been a neat experiment that I have done a few things with, but it hasn't really found a workload that I feel it is suited to at my house yet.  XBMC was possible, but a let down and I am not a coder nor do I want to learn to code on my Pi.  I wanted it to do work for me in a way I hadn't found yet.



Enter IPFire.  They released an Arm port that runs on Pi and I knew I needed to try it out, as I have been running IPfire for years on typical x86 computers.  It is excellent, feature filled, and stable.

Below is my completed Pi/IPfire setup.  Yes it is a cabling mess.
See more info about what I do with my wall mounted setup here:
http://chuckscoolreviews.blogspot.com/2014/03/affordable-wall-mount-esx-5.html



To run IPfire on your Raspberry Pi, you will need:
-IPFire distro for Arm Processors: (free)
http://downloads.ipfire.org/latest  (Choose Arm without serial console)

-A Raspberry Pi B or B+

-8 or more gigs SD card.  I used 16 gig for mine.  Get something as fast as you can afford.  Sacrifice space for speed.  Also consider whether you will be caching update files via Update Accelerator.  This will take some space.  Mine is eating 11 gigs now after some months in use.

-SD card reader for deploying the ipfire image

-IPfire supported USB Network interface card.  See supported USB Nics here:
http://wiki.ipfire.org/en/hardware/networking

You might be asking yourself, self- why would I ever run a USB Nic?  They are slow and I like fast.  You might also be asking if the Pi is powerful enough to run your internet connection with as much speed as you think you need.
Let's discuss.
Yes USB Nics suck for LAN connections, but we are going to use it for your incoming WAN connection from your router.  It just needs to be fast enough to manage your incoming internet speed.  For most, this is 50 down/10 up megabits or less.  USB2 will do 480 megabits of theoretical bandwidth, so it will not typically be your bottleneck.  Now added to the fun is that the Pi saves money by running everything off of the USB bus.  So the other built in Nic runs off of the same 480 megabits as your USB Nic.  So let's say that halves your speeds, so each Nic gets 240 megabits from the Pi's USB bus.  This is still faster than your provided internet, so your Network Interfaces will not be your bottleneck.

So now after the talk of theory, lets discuss how it handles in the real world with this config.  Short answer: With a Raspberry Pi b+ providing my routing on a 50 megabit connection, the max download throughput I have seen is 25 megabits per second.
It IS the bottleneck.  I find this to be acceptable mostly because I am invested into this solution and I like it.  I don't really have need to go any faster than 25 megabits.  The fact of the matter is that Cox has no speed offering that is right for me.  It is either 5 megabits per second down or 50 megabits per second down.  If they had something in between, this is where I would like to be.  As it is,  I have run the 5 megabits down and been satisfied with it.

Now you might be asking yourself, why go through all of the trouble of running your router on a Pi when your existing router is getting the job done?
Well, there are tons of interesting features that IPfire offers above and beyond what you can do on a typical router device, even one with Tomato or DDWRT firmware.
Take a look at the details page for IPfire and the addons to see them all, but my personal favorites are built in:
Transparent proxy with caching
URL Filter that works with whatever blacklist you want
Update Accelerator for caching updates for Windows, Linux, Antivirus Updates, and many other apps locally on the IPfire device saving you time and bandwidth. (also customizable to cache any type of file you want in addition to the defaults)
Nice web interface and good bandwidth usage stats so that you know if you are going over your monthly data cap limit due to Netflix binge watching and the like.

Ok so I have you talked into looking into this further and you have the parts needed.
Download the IPFire and copy get it onto your SD card.
These are the instructions I used:
http://xathrya.web.id/blog/2013/05/14/installing-ipfire-on-raspberry-pi/

Attach USB Nic to your Pi and Pi to an HDMI device.  (To not disrupt my computer stuff, I hooked mine up temporarily to my TV.)

Boot and configure the IPfire from the interface provided via keyboard.  No mouse needed.  I set red network to USB Nic and Green network to built in NIC.

Boom, done with initial configuration.  Now you need to hook the Pi to your network and see it go.  No need for HDMI any more, you should be able to pull up the web interface once it boots.  (Give it a couple of minutes to boot.)

Find it at:
https://green-ip-you-set:444/


Configuration of your IPfire and considerations for Pi:
Please note that I am going to cover items that I have enabled and changed as a result of running IPfire on a Pi device, but you can see full explanations of every setting on this IPfire wiki if you aren't sure or want more information about a setting or what does what.
http://wiki.ipfire.org/en/configuration/start


I like to go to pakfire section and install nano and htop.  Nano is an easier way to edit txt files on the IPfire.  (You should never have to do this though, but if you do this is easier than vi.) and htop is a much more informative process, cpu and ram monitor than the standard top application.  There are tons of other items you can choose, most of which you probably shouldn't be running on your firewall/router, but nice that you CAN if you want to.

You will see that most spots for logging are already turned off.  This is to save your SD card.  SD cards are not as robust as hard drives, so limiting reads and writes where not necessary for troubleshooting is desired.
I also set mine to send syslog data to a VM I have running Linux and Splunk.  Splunk is free for home use and for up to 500 megs of log files to process per day.  I don't generate any where near 500 megs of log files across all of my devices that send logs to it.  Splunk is an amazing log searching and archiving application that you need.

I enable Webproxy and set if for transparent on green.  You can note port and other stuff, but since it is working transparently, there is no need configure your workstations for proxy.
Leave filter process set to default of 10 and note check boxes for URL Filter and Update Accelerator.  The +17 for URL Filter and other value here can be ignored.  They are suggestions for additional processes when enabling these features.  These will bring your Pi to its knees if you add these additional processes above the 10 I recommend for the Pi.

Now under Cache Management, you will see it is not enabled.  You should enable this and make some selections here.  Again, we want the best performance and least wear and tear on our SD card.  SSHing into your IPfire and running htop right now tells us that your IPfire is using about 50 megs of the 512 megs installed RAM at this point in its operation, so you have RAM to donate to the cause.
I set mine to:
Enable Cache Management
Leave Default descriptors
Memory Cache: 30 megs  =Fastest Option
Hard Disk Cache: 0 megs  =Save that SD card from reads and writes!
Everything else in this section set to defaults include min object size 0 and max object size 4096.
See my config image below:



*When you make any changes on this page, choose save and restart button.
Be patient with the Pi.  You won't be in here making tons of changes once you have yours configured, but when you do, they will take a few moments to apply.  This is ok.  As long as it is routing and firewalling effectively, who cares if the web interface that you should rarely use is a little slow.  There has to be some Pi tradeoffs.....

The next item to configure is the URL filter.
This section is VERY important to not get nuttso on and enable all kinds of blacklists and stuff.  This section is the spot that will murder your Pi !!!!1!
You can block based on URL categories and have a party in here blocking shadiness on the web.
I recommend checking out this blog page where I discuss nothing but this section and blacklists.  Again, these are very important to understand and configure smartly.

http://chuckscoolreviews.blogspot.com/2015/01/clear-blacklist-in-ipfire-firewall.html

Next we need to configure Update Accelerator:
I like to set the following here:
Lower CPU Priority for downloads
Enable Automatic Source Check up Weekly
Replace Outdated Files during check up.

Also one checkbox worth mentioning:
Do not Check - Enable passive mode unless you want your Update Accelerator to pause functioning.  That is what this box means.  It stops caching and serving data if you check this box.

Now that you have all three items configured, go back to Webproxy and check the boxes to enable URLfilter and Update Accelerator.  Choose save and restart.  If you have enabled a bunch of blacklist stuff, expect that this will take a while to start.  Be very cautious about enabling big blacklists!  If you gotta have them all enabled, use something other than a Raspberry Pi for your router.  (I am just blocking ads and virus infected categories at the moment on mine.) Porn and other shadiness, I block with a free OpenDNS.com account configured as such.)

Another item I like to enable and configure on my IPFire devices is weekly reboots.  I also do this on any hardware routers where I have Tomato installed.  I just think that this is a bit of preventive maintenance.  Linux is stable and excellent, but usually the hardware that router devices and IPfire are running on are questionable.  Rebooting them is not a bad idea.....
The spot for this isn't exactly clear on the IPfire.  To make this change, go to:
Network | Connection Scheduler
In here, create a new task for rebooting at some time when no one at your house will be awake.  Choose task: Reboot.


You are done.  Enjoy your router!


Friday, January 16, 2015

Clear the Blacklist in your IPFire Firewall

I have been running a linux based firewall at work and at home for years.  Started out with Smoothwall, then IPCop, then IPFire, then Sophos UTM 9, and now back to IPFire.

http://www.ipfire.org/


Of them all, Sophos is the most feature rich, however IPFire drew me back for some interesting features that I think no one else can beat.

The first of which is that it has a built in app for caching Windows Updates, A/V updates, Linux updates, etc. called Update Accelerator.  This is a big bandwidth and time saver.  Once the first computer requests an update file, it is stored on the firewall and any other computers will get the file directly from the firewall.  This all happens behind the scenes with noting to configure manually except to enable Update Accelerator.  You can check the status of this function and see the bandwidth savings as a result of using it.
Sophos UTM 9 didn't offer this and with Sophos UTM, I could not even increase the web cache max object size.

The second killer feature is that there is a port of IPFire for Arm processors.  This is the work that my Raspberry Pi has been looking for.  I previously posted about the Pi as an XBMC media streaming device, and it is passable for this, but performance was always lacking.  It would stream fine, but the interface was sluggish.
I have since moved on to a hacked Boxee running XBMC.  This works great and the Boxee remote is of course still awesome when running XBMC.  (XBMC is what the original Boxee was based upon anyways.)
The Raspberry Pi works acceptably as an IPfire firewall, but it does struggle at times.  See my next blog entry for how to configure your Pi as an IPfire firewall.  Next for me though is to use a Banana Pi as an IPfire firewall.  It has just enough additional horsepower that it might be the real answer.  To be continued...

The third killer feature is rolling your own web blocking blacklist.  Sophos had very nice web blocking built in, but again, it was lacking the pure flexibility that IPfire offers.

Now on to the meat of this post:
Why do you want to get rid of extra blacklists?  Well, if you are dumb like me, you are always running IPFire on some scrap hardware (Previous to the Raspberry Pi, mine was installed on an old fitPC with dual NICS, an AMD Geode processor @ 500MHz and 256 megs of RAM) and you have uploaded such a big blacklist that your scraps are tapped out.  Previously, I would backup and then wipe and reload my IPFire in order to start over with a smaller blacklist. 

We will discuss getting rid of old Blacklists and how to trim big blacklists of categories that you don't need before uploading.

To get rid of your installed blacklists, enable SSH and connect to your IPFire server.
I am lazy, so I use Filezilla to connect, browse and delete files.  I can commandline, but why bother.

Browse to: /var/ipfire/urlfilter/
Here you will see a directory called blacklists
It will have folders corresponding to your categories.  You can select and delete the categories that you do not want enabled, or delete every folder here and start from scratch.
Once you have deleted the non necessary categories, you are all set.  Save and restart URL Filter from the web interface and you are done.

Now, to keep these from re-popping on their own, disable automatic blacklist downloads.
You can also manually remove the unwanted categories from your blacklist file before uploading it.
I like the blacklist file provided here:
http://urlblacklist.com/?sec=download
It is big monster and maintained with categories for lots of crap.

Once you have the file, uncompress it it and remove the directories for the categories that you do not want, save and re-compress the file and then upload it to your IPFire.  (The free open source 7zip program will facilitate this uncompressing and recompressing if you are using Windows.)
See the categories .txt file for explanations as to what each category is blocking.  This is invaluable to keep you from unnecessarily enabling a category that seems helpful, but in reality is not.
Also note that you can see the size of each category in the blacklist file.  This allows you to understand which categories are the biggest and will take the most resources on your IPfire.  You should think twice about enabling that 20 meg category on a scrappy IPFire server with limited RAM and CPU.

That is all.