Tuesday, October 14, 2014

Making an inexpensive Internet Kiosk for MyMathLab

So far I have a monitor I fixed by replacing the capacitors, a Raspberry Pi in an enclosure I 3D printed, a short vga cable, and an hdmi to VGA converter.  I booted using an older raspberian distro on an 8GB SD card.

This is the hdmi to VGA converter I ordered:  http://www.amazon.com/gp/product/B00APJL1XG/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1

It was just $5.34 with free shipping.  The shipping did take about a month from China.

(Images to follow this weekend.)

At first I got no video at all, the monitor would just go right to sleep.   It was as if the brand new adapter did not work.  I tried it on another system to confirm that it did work. A quick google search found the following site:


Which talked about needing to edit the config.txt file on the root file of the SD card to enable HDMI.  I uncommented one of the lines after reading the comment above the line to force the Raspi to always use the HDMI port.

After I rebooted with the changed card, the display came right back up.

Now I need to get a keyboard and mouse connected to the Raspi.  After that I can start working on configuring the SD card to only run a web browser that was locked down to just a couple of sites. :D

Saturday, September 27, 2014

Got a CP2102 usb to TTL serial adapter working with home made arduino clones.

How to fix a cp2102 usb to TTL serial adapter to automatically program a hackduino that you built yourself that is lacking an on-board USB adapter.

I was having to press the rest button on my home build arduino board in order to allow it to accept the programming from the arduino software program.  This took some timing, and is just annoying. So I finally looked up on the Google how to fix the problem.
1. Cut the trace.

2. Solder a jumper from dtr to the reset pin.
Step 2 could also replace the jumper wire with a .1 uf capacitor.  A capacitor turns a low state into jus a single pulse.

This would save the cost of having a capacitor added to each board.  I go ahead and put the capacitor on each board anyway, so no capacitor needed here.

Friday, August 1, 2014

Wood Carving again.

This was 3 hours of work today.  Drawn freehand onto a small 6x6 board and then hand carved out with a few tools. The design is based on a drawing on in a book, but I just did it by looking at the drawing and then drawing something similar on the board.  I started with a small V notch and went over the drawing, then moved to a larger V notch. and went over again. Then I dug out the field between the design and border.  Now I am shaping the stem, leaves, and acorns to get a 3D like feel to the design.

I am thinking about doing a few of these to get good at them, and then giving the next few of them to all my nieces/nephews as gifts.

Wednesday, July 16, 2014

User Authentication on ruby on rails

Devise is the ruby gem we need for this.

The official guide is here:


I additionally had to make app/controllers/application_controller.rb look like the following to get the sign in to happen:
class ApplicationController < ActionController::Base  # Prevent CSRF attacks by raising an exception.  # For APIs, you may want to use :null_session instead.  protect_from_forgery with: :exception
  before_filter :require_login
  before_filter :check_if_devise
    def check_if_devise        if params[:controller].include? "devise/registrations" and params[:action].include? "create"        end    end
    def require_login      if not current_user and not params[:controller].include? "devise"        redirect_to new_user_session_path      end    end
Then I had to make app/views/layouts/application.html.erb look like this:
<!DOCTYPE html><html><head>  <title>Universalnewsaggregator</title>  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>  <%= csrf_meta_tags %></head><body><p class="navbar-text pull-right"><% if user_signed_in? %>  Logged in as <strong><%= current_user.email %></strong>.  <%= link_to 'Edit profile', edit_user_registration_path, :class => 'navbar-link' %> |  <%= link_to "Logout", destroy_user_session_path, method: :delete, :class => 'navbar-link'  %><% else %>  <%= link_to "Sign up", new_user_registration_path, :class => 'navbar-link'  %> |  <%= link_to "Login", new_user_session_path, :class => 'navbar-link'  %><% end %><p class="notice"><%= notice %></p><p class="alert"><%= alert %></p><%= yield %>

The user auth code I got from here:

And at this point I finally get a login for the site that looks like this:

The commands that I used for this project.
Create the heroku project and copy the given command to check out the project locally.
git clone git@heroku.com:universalnewsaggregator.git -o heroku
rails new universalnewsaggregator
cd universalnewsaggregator
vi Gemfile
  # add in devise and other required gems.
bundle install
rake db:drop
  # just to get rid of the old similar database I had created before on first try.
rails generate devise:install
rails generate devise user
  # or instead of user, you could call it member, or whatever.
rake db:migrate
vi apps/views/layouts/application.html.erb 
vi app/controllers/application_controller.rb
vi app/views/layouts/application.html.erb
rails generate scaffold news
vi config/routes.rb
  # make sure it has the following:
  devise_for :users
  resources :news
  root "news#index"

# edit the database to use postgress
vi config/database.yml
  # put in the postgres sections

#finally push it back up
git add -A .
git commit -m "Basic Site with User authentication"
git push heroku master

Wednesday, July 2, 2014

The Supreme Court is wrong in the Hobby Lobby case.

In America we take a reduced wage in order to have that reduction pay for our medical insurance before taxes. This is just an accounting trick so that the worker doesn't pay taxes on that cost. The worker is paying for the insurance by working, not Hobby Lobby. 

If someone wasn't working for Hobby Lobby, they sure wouldn't be getting any insurance from the company.

The reform that we need to move to in America is just to outlaw all employer benefit packages and have them pay that benefit package in cash to any employee, and then allow a 100% pretax deduction for all medical insurance costs.

Just become a nation of contractors.

Wednesday, June 25, 2014

Working with Heroku and github for ruby on rails development

This is a little rough, but wanted to record the commands I used and why for some ruby on rails development using heroku as a server and github as the source code repository.

So, create a project on github and add it to heroku.  

Then invite yourself to it:

#Install heroku toolbelt on your local machine.

# copy and paste the invite you get from heroku:
git clone git@heroku.com:yourherokurepository.git -o heroku

#Add your public key to heroku site 

git pull
chmod 0600 /home/homedir/.netrc 
heroku logs -a yourherokurepository

#because we checked it out from heroku we have to add in the github repository as well.
git remote
  >> only says 'heroku'
git remote add origin git@github.com:githubusername/yourherokurepository.git

#after you add and commit changes, push the changes out:
git push origin master ; git push heroku master

#run a local copy of the code for testing:
rails s
:~$ vi testcommands.editme.txt 
:~$ cat testcommands.editme.txt 

#Install heroku toolbelt

git clone git@heroku.com:yourherokurepository.git -o heroku

#Add your public key to heroku site

# make sure you are upto date
git pull

chmod 0600 /home/homedir/.netrc 
heroku logs -a yourherokurepository

#because we checked it out from heroku we have to add in the github repository as well.
git remote
  >> only says 'heroku'

git remote add origin git@github.com:githubusername/yourherokurepository.git

#after you add and commit changes, push the changes out:
git push origin master ; git push heroku master

#run a local copy of the code for testing:
rails s

Monday, June 23, 2014

The Rise of the Intelligent Agent.

In the future, when all the corporations (i.e., the de facto government) are tracking our every movement with AI we are going to need our own intelligent agents that act almost like a 1950's secretary between you and the world. Back then the boss didn't do anything for themselves, the secretary did everything for them, from taking notes, to getting the dry cleaning.

When you want something on the Internet you will ask your secretary and the secretary will cloak itself in a layer of anonymity and go seek out the services and information you want, in a safe and untraceable manner, then return with it.  Of course, all info should be properly filed so that it can be accessed instantly inside "the office."  The secretary would also remind you of birthdays, and send out a newsletter to each of your friends and business associates personalized for each person.

These IA would friend each other at our command and interact directly with each other using insane levels of verification and strong crypto to schedule appointments and exchange messages .

The IA will have to be hardware based, and be able to easily perform levels of crypto that would choke a computer today.  The device should perform voice to text transformations for you, rather than using the cloud, because recording your voice to the web leaks too much info about you to a third party.  It goes without saying that you need to own this hardware device yourself and have full control over it.  It should be able to be instantly and irrevocably wiped at the touch of a button.

This device would act as a onion router and cooperate with other devices of the same type to cloak our identities and guard our actions.  You would post all your messages and social media to this device and only others that you have given access to the information would be able to see the information.  You could finally post your full contact information for your friends and family to see, without having to share the information with a corporation and their advertisers, as you must now.

Every Google search you perform should appear to be from a brand new browser that has never connected to Google before.  These searches and your links should be saved on your side so that you don't have to repeat them very often.  We may want to cycle through a list of search engines to make any patterns we are looking for more difficult to spot.

A device like the Beagle Bone Black, along with a couple of specialized programmable chips to do the crypto and voice recognition would be all we need.  Rooting our phones to put a secure OS and loading a secure OS onto something like a chromebook to operate closely with the device over a heavily encrypted wifi vpn link.

These devices should also perform some sort of private financial services between individuals using a mechanism like bitcoin to ensure that there is a free and open economy even in fascist states that try to control and track every financial exchange.