Posts by Nick Nguyen

Tracking DMV wait times

PROJECT on-hold due to COVID-19

THIS PROJECT IS CURRENTLY NOT COLLECTING DATA BECAUSE THE DMV IS NOT OPERATING DUE TO THE COVID 19 PANDEMIC. CHECK OUT MY OC COVID TRACKER MEANWHILE.

So I was required to visit one of our favorite state agencies, the DMV. Its been a while, and when i showed up the line was wrapping around the building.  So i went home to spare my day, and figure out a better way to accomplish this civic duty.

With some general knowledge of the existing public data, I attempted to track the wait times for all my local DMV's. and figure out where and when a good time to go to the DMV would be.

Going to the DMV website I found some interesting stats

This data provides a  general overview but not the specifics im looking for. After a little more digging I wass able to find "some what" real time wait time on the DMW website:So i proceeded to scrape those wait times into a MYSQL database every 15 minutes for each location.  Making use of that much data can be difficult, so i need to make a way to visualize the data, so i employed google charts.   If your interested in seeing the ongoing results of this project click here

  I was able to figure out the best time and location, which i will publish online after I finish my dealings with the DMV. So be sure to check back or subscribe to my site for an update.

Orange County CA Sea level Rise Threat Assessment

According to Bloomberg and the Florida State University:

To put in context 225,700 people is more than double (just under x3) the entire population of Newport Beach.

Here is what the threat assessment according to the NOAA Sea Level Rise Map

Areas Effected By Sea Level Rise according to Bloomberg scenario

Areas threaten by High Tide Flooding:

Southern Orange County appears to be physically unaffected by rising water, possibly due to elevation, but it is vulnerable to social impact, even at the present seal levels

Why using Frameworks is a MUST

A coders example of why frameworks are a MUST in application development.

    • Frameworks reduce the amount of code required to complete a task.
    • It reduces the overhead cost and time (learning curve) of bringing onboard new developers to an existing project
    • Helps keep your code clean and organized as your project grows
    • The more displined you are in adhering to MVC pattern, means less time and less cost in future development

CodeIgniter is right for you if:

  • You want a framework with a small footprint.
  • You need exceptional performance.
  • You need broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.
  • You want a framework that requires nearly zero configuration.
  • You want a framework that does not require you to use the command line.
  • You want a framework that does not require you to adhere to restrictive coding rules.
  • You are not interested in large-scale monolithic libraries like PEAR.
  • You do not want to be forced to learn a templating language (although a template parser is optionally available if you desire one).
  • You eschew complexity, favoring simple solutions.
  • You need clear, thorough documentation.

 

Now for the good stuff…

Querying Data from SQL

CodeIgniter (4 Lines of code)


$query = $this->db->get('table_name');
foreach ($query->result() as $row)
{
echo $row->title;
}

VS

PHP (LOTS OF LINES OF CODE) Using Codeigniter all the configuartion settings are automatically loaded and avaliable EVERYWHERE and ANYWHERE

$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT id, firstname, lastname FROM MyGuests";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
}
} else {
echo "0 results";
}
$conn->close();

This is just one example, to learn more about working with SQL via codeigniter

HELPERS

Toolbox of useful Code aka Collection of Functions that help simply coding such as
Dealing with Dates, Arrays, HTML, Forms, Cookies, Sessions, etc

Example Dates HELPER


//Makes all Date Helper Functions readily avaliable
$this->load->helper('name');

$bad_date = '199605';
// Should Produce: 1996-05-01
$better_date = nice_date($bad_date, 'Y-m-d');

For a complete list of CI helpers available

 

Libraries (Object Oriented Library of Common Tools)

Example of sending complex emails


//Load Library
$this->load->library('email');

$this->email->from('your@example.com', 'Your Name');
$this->email->to('someone@example.com');
$this->email->cc('another@another-example.com');
$this->email->bcc('them@their-example.com');

$this->email->subject('Email Test');
$this->email->message('Testing the email class.');

$this->email->send();

Without Framework you would have to add third party files SUCH as PHPMailer and add Includes on top of each page, coding alot more method calls

PAGINATION LIBRARY Codeigniter


$this->load->library('pagination');

$config['base_url'] = 'http://example.com/index.php/test/page/';
$config['total_rows'] = 200;
$config['per_page'] = 20;

$this->pagination->initialize($config);

echo $this->pagination->create_links();

Check out the list of libraries for almost everything you could possibly need 

Black Fly Aircraft coming in 2019

1-2



Possible game changer in personal aviation

This aircraft will be available for sale this year.  Here's why I think this aircraft stands out and could possible be a game changer for personal aviation

-Affordable (Cost of an SUV)

-No Pilots license required (Ultra Light Class)

-Vertical Take off and Landing

-Propiertary Engine, designed fail proof via redundancy (Parachute included)

-Small engine and propeller, so no large heavy parts falling from the sky.

-Developed in adherence to US regulatory laws (it'll be legal)

Currently the only thing holding this back from possibly being the next Tesla, is the current regulatory restrictions and civil ordinance, just like self driving cars, that will take a bit of time, but flight in our lifetime may now be possible.

My personal voice activated security system and more

 

Based off of AIY Google Voice Hat for $10 on Amazon I control my home security camera via wifi. I add 5 streaming radio channels, I add youtube voice search and google search and checking my gmail email. On top of Google Assistant API so as to include all the Google Home features.

Using machine learning/ artificial intelligence we control a security system thru voice commands

Download the code below:
code repository downloadProject was written using Python on Raspberry PI 3 with Voice Hat 

 

 

 

 

RoboBouncer

robobouncer demo

In this case study we bring our internet skills to traditional telecommunications, in a project we dubbed the RoboBouncer. RoboBouncer is a bot that screens your phone voice phone calls by asking for the user to speak there name, it then calls you plays the recording and provides you with an option to accept or reject the call.

 

With full programmatic control of call handling, the possibilities the internet brings to traditional calling are endless.  We have set up phone IVR systems (Company Directories), Lead Transfer Systems to High Volume outbound calling.

To test out the RoboBouncer you can call our phone number (949)446-1716

After popular demand we made a commercial version that automates the deployment of a RoboBouncer. Click here to create your own RoboBouncer

For the technically inclined we have posted the code and info at BitBucket 

 

 

Creating a telephone call screening service using Twilio

The Call Flow

-Caller calls your Twilio Number. The agent will ask the caller to speak there name and record it. Then place the caller in enquene (Inbound Call) -Using Twilio REST API initiate an (outbound call), from your Twilio Number to your personal phone number. Plays the recording, and presents you with the following options:

Press 1 (DTMF) or Say Accept (SpeechResult) -connects the call to Caller using Dial Queue Verbs -OR- Press 2 (DTMF) or say Reject (SpeechResult) ->Using REST API we notify the caller and end the call enqueue and hang up our call

Uses TWIML API and Twilio Voice API PHP SDK

Uses Queue https://www.twilio.com/docs/voice/api/queue-resource and EnQueue to place caller on hold. Could use Conference verb as well instead of Enqueue, just replace Enqueue with Conference for more options

Follow this wonderful guide to set up your free twilio account, get a phone number and your API SID and Token https://www.twilio.com/docs/voice/quickstart/php

Dont forget to assign the webhook step1.xml (or if you use TWIMLBIN select the twimlbin URL) to your twilio phone number

Setting up a webserver isnt necessary. Use Twilios TWIMLBin for the XML files and "Functions" for the PHP files (convert logic to Javascript the IVR Menu example is a good starting blueprint) -I would suggest loading the XML files into TWIMLBIN let Twilio host the files so you dont have too, and if your capable Twilio Functions for the server side Code

Robo-Bouncer code in my BitBucket
Check out my commercial version here

Controlled Prescription Medication Device

For the past few years my partner (Mark Harrington) along with the contribution from Vision Miner (Robert Lent and Patrick Smith) for the 3D Printer and Geared For Speed (Lenny Detaranto) for his genius. Have been working on an inexpensive solution to secure medication access, a device that only allows access to medication every 24 hours, the only other way to access medication would be to break the device. The device was originally created to help people beat withdrawls from addiction by helping addicts taper off. But we have also found interest from pharmacutical companies as a way to safely distribute pain medication.

Initial Design for casing Medical Device

Initial Design of internals of Medical Device

Analyzing journalism today

Original Article Posted on INFORUM.com

Is it just me, or is the authors hatred  expressed in this article greatly concerning.   This seems to be a common pattern I see in publishing these days generally from the anti-trump crowds on both sides of the political divide.

 

Letter: Fox News is the real “fake news”

Every morning and evening I watch and read the news. And every day I am so very thankful to the news media for getting the truth out to the public. They investigate and report the truth.

However, there is one exception: Fox News. There is your “fake news,” and Trump relishes in it.

 

Cognitive Bias: This is favoring information that conforms to your existing beliefs and discounting evidence that does not conform. The author

Trump relishes in Fox news because it supports him, just like you support every other news outlet because they don’t support

 

Just lately, I was able to watch Fox News since I don’t have cable. I was shocked at their reporting such garbage.

Our Founding Fathers formed the greatest free democracy, which included freedom of speech. Trump is trying to erode that, among other rights, by lying and conniving every way he can. There is a great saying, “Behind smoke is fire.”

Trump admires a dictatorship. He would like to see our government that way. He admires Putin the way he governs.

 

If trump was really a dictator, you wouldn’t be able to perpetuate such baseless lies publicly against an individual you clearly know nothing about.  I hope you see this Joan Kieffer because maybe now you’ll know what it feels like to have a stranger publishing negative things about you, feels like.  Luckily for you, I will do so objectively off your own words, supported by legitimate references.

Our Founding Fathers fled from tyranny to form our beautiful nation.

Wake up, people. You want to live under communism?

 I hope the founding fathers wake up, and educate you on what communism really is.  If communism is your biggest fear, then you should be happy Republicans believe in small government, the left believes in big government.  Communism needs a large government presence.

Trump America is not a dictatorship. The sooner he’s out of office, the better.

Look up facism in the dictionary: authoritarian, militaristic system of government. Not America!

Please look up the definition of Communism too! So where is Trump leading us to fascism or communism? I’m not a political science major, but I’m pretty sure it cant be both:

Communism: International theory or system of social organization based on the holding of all property in common, with actual ownership ascribed to the community or state. Rejection of free markets and extreme distrust of Capitalism in any form.

Facism: An extremely nationalistic, authoritarian state usually led by one person at the head of one party. No democratic election of representatives. No free market. No individualism or individual glory. The State controls of the press and all other media.

 

Articles such as this are greatly concerning to me, there is no room for logical debate with these types of people, as they are driven entirely by emotions (strong hatred) , and its like a fast moving cancer that is infecting the public discourse, that will inevitably spawn into violence and civil unrest and possibly civil war.  Its a distraction, the real enemy is both republican and democrat, the true enemy to our country is the “deep state” and  lobbyist/corporations/banks.

 

Get $10 Google AIY Version 1 working

So I bought this $10 Google Assistant from Amazon Prime.  Only to find out it doesnt work as easily as advertised.   It comes with a modified Raspian distro.  Here are the latest steps I did to get mine to work.  I spent a half a day muddling through commands,  so im not sure if previous steps might have led to it working but hope this helps someone…Note the audio volume in the navigation is disabled, but the google voice does work (when I did get the audio driver working, the google voice via python was not)

cd ~/AIY-projects-python

sudo scripts/install-alsa-config.sh

Outputted:

Renaming /home/pi/.asoundrc to /home/pi/.asoundrc.bak…
Renaming /etc/asound.conf to /etc/asound.conf.bak…
Installed voiceHAT ALSA config at /etc/asound.conf
Installed voiceHAT ALSA config at /home/pi/.asoundrc

I tried:  python checkpoints/check_audio.py

Outputted:

ImportError: No module named aiy.audio

python3 checkpoints/check_audio.py

Worked…Playing test sound….

So the module only works when you declare the Python3…..

before this i did compile the drivers by going to the /home/pi/drivers-raspi folder, and ran

sudo ./build.sh

the script appears to compile the drivers and created a boot/config.txt file….I believe the parameters in the config.txt file are run when the image boots up…here is a copy of mine in case anyone else may need to compare:

I added dtoverlay=googlevoicehat-soundcard to mine, I also added dtparam=audio=on but the driver script appears to have commented dtparam=audio=on  out to #dtparam=audio=on

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default “safe” mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display’s size minus
# overscan.
#framebuffer_width=512
#framebuffer_height=384

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=35

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
dtoverlay=googlevoicehat-soundcard

# Additional overlas and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
#dtparam=audio=on
# dtoverlay=dwc2
start_x=0
gpu_mem=128
#scaling_kernel=8
enable_uart=1
#dtoverlay=w1-gpio
start_x=1

 

 

Syncing a lot of data from a directory to Amazon S3 Cloud

In an attempt to upload a directory 40+ Gigabytes worth of files on t0 Amazons S3.

Typically I use the AWS Console, but I ran into issues, I believe my browser was timing out.  I tried a couple downloading and installing third party applications, the only success I got from that was possibly inheriting additional malware.

I did manage to find a solution, I tend to pass on the command line tools, but I was desperate, turns out in this instance command line is actually sooo much easier and stable, This is basically all I had to do.

Download AWS CLI  and Install it

Open your terminal and run

aws configure

youll need to provide it your AWS ID, AWS KEY, Region, and a format (I choose JSON). Then all i had to do was run the following command to start syncing

aws s3 sync C://Your_Local_Directory_To_SYNC s3://your_S3_bucket

if you want to see more options simply run. You can sync bi-directionally or from s3 bucket to bucket by interchanging the last two parameters accordingly

aws s3 help

You are now free to do whatever it is you do.

Note: If you step away from your computer for too long or your computer goes inactive, this will discontinue your transfer. If that happens rerun the command to continue.

8 Tips for picking a better domain name

 

Not only do these tips coincide with easier search engine indexing, They take into consideration human psychology, human memory is vital because if your end user doesn’t recall the proper address they are a lot less likely to reach there intended destination

1. Choose a .com extension

2. Use your brand name

3. Don’t use exact match domains. Partial match domains are okay, but a brand name is always preferred

4. Make it memorable

5. Make sure its easy to spell.

6. Avoid special characters.

7. Avoid misspelling

8 Under 14 Character, shorter the better.

5 Ways to help ensure your websites secure

These days web sites can expect to be attacked by web bots as soon as a search engine index’s there site. The more advanced web bots will launch every known attack in order to find a vulnerability to exploit, and report back to its attacker, whom can conduct various nefarious acts on your server, any of which could greatly affect your business, domain and/or clients. Recently a very common attack on businesses that does not get enough publicity is ransomware, which could basically criple a companies operations until they pay the attacker money, most times these attacks dont require more effort to accomplish, so even small businesses can fall victim. Here are some tips I think every site should implement to ensure there website is secure.

1. Run updates on your server and all your software frequently

Plugins are vitally important for keeping websites ahead of potential security breaches. Ensure the ability to create and utilize custom plugins to reinforce site security, such as those that block particular IP addresses. Equally important, developers must also practice up-to-date coding and development standards and should use modern versions of platforms such as PHP and Apache. WDG developers, for example, use only coding structures and syntax patterns that have been proven secure and effective in order to maintain industry best practices.

2. Require a strong password policy

Require a strong password policy anywhere a password on your site and throughout your organization anywhere a password is used. Attackers will often brute force your user passwords using scripts, which is akin to trying every common password for every username until one is found, such an attack takes a few minutes to conduct and is also typically automated.

3. Conduct a regular back-up of your applications and databases

Having a backup copy of your applications and database could potentially save your business from any damage and/or prevent the loss of important information such as customer or sales records due damage was done by an attacker or virus. Once the damage is identified, without some sort of backup copy could take a business website offline indefinitely. For e-commerce websites, this could destroy the entire business.

4. Obtain an SSL (Secure Socket Layer) Certificate and employ an Encryption Protocol

The information traveling from your website to your end-user can be intercepted by an unknowing third party, whom can capture sensitive information such as credit card information, username, and passwords. SSL or secure socket layer secures the information by encrypting it before it transmitted.

5. Only install plugins or code from trusted sources

Attackers will often disguise viruses in actual functioning plugins, thereby allowing an attacker access to your server. These attacks often go unnoticed until it’s too late.

These steps are implemented automatically whenever possible when I develop for my clients. From a development standpoint, implementing the tips become more costly and difficult to implement as a site grows,

Scientific Data that Proves Global Warming is another Lie

A recording of a testimony from Dr. Don Easterbrook before the United States Senate Environment & Energy Committee, for which he provides a lot of weather data and facts that contradict the global warming narrative. Dr Easterbrook states upfront he is not backed by any special interest, and his only funding for his research is from government tax funding. Some important things he points out, is that there is no correlation between Co2 emissions and global warming. CO2 emissions didnt increase until after the 1940’s during the rise of the industrial era, during which time all records show that the earth temperature was cooling, also the measurement of CO2 in the overall atmosphere is not even close to 1%, he touches on all the important points.

Thank You Dr Don Easterbrook, for giving the truth a voice, it’s refreshing to be presented with data and no BS.

Global Warming Is A blatant LIE & This video scientifically Proves it.

The cost of ignoring lies and accepting negatives for self preservation

 

These are interesting times. On one hand there are changes happening on a global scale that can’t really be ignored much longer. On the other hand the majority of the population seem to live their lives as if everything is just as it always is and always will be, locked in a tunnel vision of personal and material interest.

As long as we keep lying to ourselves based on conditioning, wishful thinking, suppression or denial and believe the lies “out there”, mistaking them for truth, nothing will change. This goes also beyond having a “positive” attitude, where hope can be merely a trap and lie to the self. Believing in lies that are “positive” in appearance (regardless how well-meaning the intent or good-hearted the person) is actually being negative and blocks one’s awareness and spiritual evolution. Being positive can mean acknowledging something negative because it is the truth, seeing it for what it is. If you believe a lie, even if it seems positive and makes you “feel good”, you give away your free will and that has spiritual implications. In these times of transition it becomes imperative to do seek truth and strive towards objectivity so we don’t take the “wrong” turn into entropy.

Hosting like the big boys…on the cheap!

Amazon is out to own the web hosting space with its new lightsail space. Lightsail offers a setup of the cloud Virtual Private Server instance, and all the trimmings that typically would require an experienced IT professional to configure to make possible. Making it possible for small businesses to have a scalable private server for as low as $5 a month, and any newbie developer should be able to set it up!! If your still using Godaddy, bluehost,hostgator and sharing one IP address and server space, among hundreds (sometimes thousands) of other websites in a “shared” hosting account (which search engines can see), it would be silly not to migrate.