Monday, June 19, 2023

Why Working from Home Makes Sense

I've been working from home for over 20 years now, and I love the fact that the world is finally catching on to this phenomenon. However, I find the constant deluge of companies, and even individuals, pushing to end WFH disheartening. If you look at who wants to end it, it is the large corporations and people with huge investments in office buildings. Well, that makes sense, since they want people back in the office... it's all about power and control. This is more about their inability to be effective leaders, not employees lack of results.


What the leaders and management don't understand (or choose to ignore) is the fact that by not micromanaging people and letting them create and accomplish the tasks assigned to them in the manner they choose, they improve corporate creativity, productivity, and value. The benefits to employees, such as no commute, no childcare required, flexibility in schedules, less cost for work clothing, ability to work for anywhere, and many more, all make the work environment much more enjoyable and can improve employee retention.

For a management perspective, we as leaders need to learn to manage by task, and not by hours. Give someone a task to do, set a deadline for when you want it done, and then keep tabs on the progress. Maybe that means a daily 15-minute standup, or maybe just a weekly report. It depends on the task.

Of course all of this means that we also have to be more involved with understanding what it is that needs to be done, and better at estimating the time to do it. Getting feedback from employees and communication is key, and of course reviewing accomplishments or missed deadlines to find root causes.

It's all a matter of perspective. Although WFH is not right for every job, it is NOT going away, and corporate leaders need to accept that fact

Tuesday, May 9, 2023

Generating Content Using ChatGPT: A Real-World Proof of Concept

As artificial intelligence continues to advance at an unprecedented rate, more and more innovative applications are emerging. One particularly exciting development is the use of AI to generate high-quality, relevant content. In this article, we'll take a deep dive into a real-world proof of concept that harnesses the power of OpenAI's language model, ChatGPT, to populate a WordPress site with AI-generated content. 

The Magic of ChatGPT

ChatGPT, developed by OpenAI, is an AI language model that can create human-like text. It has been widely celebrated for its potential applications in various fields, including content generation, virtual assistance, and much more. The model generates responses by analyzing the input provided to it, creating contextually relevant replies that have the coherence and creativity of human writing.

Exploring the Proof of Concept

I developed this proof of concept project to explore and demonstrate the capabilities of ChatGPT to generate high-quality content for a WordPress website named [GeekTalk](https://geektalk.ai/). The goal of the project is to showcase the potential applications of AI in content creation and blogging, and to better understand the integrations and prompts.

GeekTalk acts as a fully automated platform, where articles are created by AI, reviewed, and then posted. It serves as an excellent example of how automation can be leveraged in the world of content creation, making the entire process more efficient.

Behind the Scenes: The Code

The backbone of this proof of concept project is the code that integrates the power of ChatGPT with WordPress. You can access the code [here](https://lnkd.in/eXV8resx) to gain an understanding of how the ChatGPT API is utilized to generate and post content on the site. 

The core principle involves invoking the ChatGPT API, obtaining the generated content, and then leveraging WordPress's REST API to create new posts and images on the site. It's a seamless integration that has been crafted with precision and scalability in mind.

This code provides an excellent opportunity for those interested in AI, machine learning, and automation to explore a real-world application. Developers and enthusiasts can take a deep dive into the code to understand how to call the ChatGPT API and how to integrate it with a popular content management system like WordPress.

Wednesday, December 6, 2017

Toptal?

I'm looking into the Toptal software developers Network for consulting projects, and I have to say it looks interesting.  With my background in Security, DevOps, Application Development, and Infrastructure, I think it will be a good place to find new projects.

So why do I think I would be a good fit for TopTal projects?

To begin with, I love working with computers and have an extensive background in that area.  My degree is in CSE, and just basic stuff like knowing Java, C/C++, JavaScript, Python, and a slew of other languages for both coding and scripting are all good points.  My continued education with AWS Certification and Certified Ethical Hacker (CEH) training also show how I like to learn new things.  And research into DevOps methodologies, artificial intelligence, and robotics is important to extending my capabilities beyond just basic computing.

We will see how it goes with TopTal.  I will keep you posted here on any relevant updates!

RingCentral Professional Sign Up Bonus: FREE rollover minutes

Tuesday, September 12, 2017

BlueBorne Bluetooth Vulberabilities

Security researchers have discovered eight vulnerabilities -- codenamed collectively as BlueBorne-- in the Bluetooth implementations used by over 5.3 billion devices. Researchers say the vulnerabilities are undetectable and unstoppable by traditional security solutions. No user interaction is needed for an attacker to use the BleuBorne flaws, nor does the attacker need to pair with a target device. They affect the Bluetooth implementations in Android, iOS, Microsoft, and Linux, impacting almost all Bluetooth device types, from smartphones to laptops, and from IoT devices to smart cars. Furthermore, the vulnerabilities can be concocted into a self-spreading BlueTooth worm that could wreak havoc inside a company's network or even across the world. "These vulnerabilities are the most serious Bluetooth vulnerabilities identified to date," an Armis spokesperson told Bleeping Computer via email. "Previously identified flaws found in Bluetooth were primarily at the protocol level," he added. "These new vulnerabilities are at the implementation level, bypassing the various authentication mechanisms, and enabling a complete takeover of the target device."

Wednesday, December 28, 2016

An Alexa Skill for Integration with Weather Underground

When using Alexa with my Echo Dot, I found that the integrated weather forecast was not that accurate for my location.  Where I live, we have a significant microclimate, and getting the accurate forecast for my location is best done through Weather Underground.  I have my own personal weather station which provides a good forecast, and I wanted to link that in to my Alexa Flash briefing.  Unfortunately, there doesn't appear to be a Skill for that at this time, so I went through the process of creating my own and wanted to share details of that here.

The basic steps to set this up are as follows:
  • Get a Weather Underground API key to get the forecast and alert data in JSON format
  • Setup an Amazon Lambda function to read the WU API and translate it into a format that Alexa can understand for the Flash Briefing
  • Create an Amazon API interface to call the Lambda function
  • Setup the Alexa Skill for a Flash Briefing item which uses the API interface just setup
  • Turn on the skill on your Amazon Echo Dot (or other Alexa device)

Get a Weather Underground API key 

Sign for weatherunderground.com if you haven't already, and login to generate an API key.  The process is simple, and free for under 500 calls per month.  Just be sure and sign up for the "Cumulus" plan to get both forecast and alerts.  Once you have the API key, you'll be using two of the API calls to get the information for Alexa.  These are:

http://api.wunderground.com/api/xxxxxxxxxxxxxxx/forecast/q/pws:KVTSTARK3.json
http://api.wunderground.com/api/xxxxxxxxxxxxxxx/alerts/q/pws:KVTSTARK3.json

where xxxxxxxxxxxxxxx will be your WU API key.  

For the actual location, you will want to replace q/pws:KVTSTARK3.json with the refined location for you via weather underground.  To get this, go to the weather underground home page and look at the full forecast for your location.  If you have a personal weather station, you can just substitute KVTSTART3 with your PWS station id.  If not, then look at the URL of the full forecast, which will be something like this:

https://www.wunderground.com/q/zmw:05487.1.99999?sp=KVTBRIST11

and then replace the part of the url including and after the q (q/zmw:05487.1.99999?sp=KVTBRIST11 in the above example) with q/pws:KVTSTARK3 where KVTSTARK3 is your PWS station id.

Test out the urls in your browser to make sure you're getting back valid JSON, and then you're ready to move on to the next step.

Setup an Amazon Lambda function

Amazon Lambda functions provide quick and easy ways to implement snippets of code that are only executed when called.  They are efficient ways to handle API implementations without having a full-blown server running, and are only charged on the per-usage basis.

The assumption here is that you've already setup an AWS account.  From the AWS console, go to the Lambda service (https://console.aws.amazon.com/lambda/home).  You'll want to create a blank lambda function without any triggers at this time.  Call it something like getWUForecast and use the Node.js 4.3 runtime.    For the inline code, you can use the following code snippet:

'use strict';

console.log('Loading function');

exports.handler = (event, context, callback) => {

    var http = require('http');
    
    var alertsurl = "http://api.wunderground.com/api/xxxxxxxxxx/alerts/q/pws:KVTSTARK3.json"
    var forecasturl = "http://api.wunderground.com/api/xxxxxxxxxx/forecast/q/pws:KVTSTARK3.json"

    // Get alerts first
    http.get(alertsurl, function(res) {
        res.setEncoding('utf8');
        var rawData = "";
        res.on('data', (chunk) => {
            rawData += chunk;
        });
        res.on('end', () => {
            var alert = JSON.parse(rawData);

            // Now do the forecast portion
            var obj = doForecast(http, forecasturl, alert, function(obj) {
                callback(null, obj);
            });
            
        });
  
    }).on('error', function(e) {
        console.log("Got error: " + e.message);
        context.done(null, 'FAILURE');
    });      
};

// Handle forecast API call
function doForecast(http, url, alert, callback) {

    // Add in the alert to the beginning of the flash message     
    var alertObj = null;
    if (alert.alerts.length > 0) {
        console.log(alert.alerts[0].description);
        console.log(alert.alerts[0].message);
        alertObj = {
                "uid": "00000000-0000-1000-0000-000000000001",
                "updateDate":  new Date().toISOString(),
                "titleText": alert.alerts[0].description,
                "mainText": alert.alerts[0].message,
                "redirectionUrl": "https://www.weatherunderground.com"
        }
    }
            
    // Get the info from Weather Underground
    http.get(url, function(res) {
        res.setEncoding('utf8');
        var rawData = "";
        res.on('data', (chunk) => {
            rawData += chunk;
        });
        res.on('end', () => {
            var forecast = JSON.parse(rawData);
            
            // Put together all the next 4 forecast periods
            // TBD: Ideally we should check to make sure we have 4 items in the array
            var curForecast = "The current forecast for " + forecast.forecast.txt_forecast.forecastday[0].title;
            curForecast += " calls for ";
            curForecast += forecast.forecast.txt_forecast.forecastday[0].fcttext + " ";
            curForecast += "For " + forecast.forecast.txt_forecast.forecastday[1].title;
            curForecast += " " + forecast.forecast.txt_forecast.forecastday[1].fcttext + " ";
            curForecast += "For " + forecast.forecast.txt_forecast.forecastday[2].title;
            curForecast += " " + forecast.forecast.txt_forecast.forecastday[2].fcttext + " ";
            curForecast += "For " + forecast.forecast.txt_forecast.forecastday[3].title;
            curForecast += " " + forecast.forecast.txt_forecast.forecastday[3].fcttext + " ";
            
            // Setup the results for Alexa feed
            var forecastObj = {
                "uid": "00000000-0000-1000-0000-000000000002",
                "updateDate":  new Date().toISOString(),
                "titleText": forecast.forecast.txt_forecast.forecastday[0].title,
                "mainText": curForecast,
                "redirectionUrl": "https://www.weatherunderground.com"
               };

            var obj = null;
            if (alertObj !== null) {
                obj = [alertObj, forecastObj];
            } else {
                obj = [forecastObj];
            }
        
            callback(obj); 
        });
  
    }).on('error', function(e) {
        console.log("Got error: " + e.message);
    });
    console.log('end request to ' + url);   
}


After you've got the inline code, you also need to setup some config info.  Under Role, select to Create new role from template(s).  Give the role a name, such as WULambaRole and choose Simple Microservice Permissions as the template.  Everything else you can leave as defaults and then Next and Create Function.

You're now ready to integrate the lambda function to the API.

Create an Amazon API interface

Go to the Amazon console and navigate to the API Gateway services.  From there select Create API and give it a name such as WeatherUndergroundAPI.  Select Create API to create it.  Now select the root of the API (/) and under Action, select Create Method.  Select a GET method, a Lambda region where you created your Lambda function (probably us-east-1 if you didn't specify anything different before).  Enter your Lambda function name you created above (getWUForecast in the example) and save it.

Once the saving is complete, click on the GET method and then the TEST button to test it out.  If all is well you'll get a 200 status code and a JSON response that is formatted for Alexa.

Now you'll need to deploy the API.  Click on Actions, Deploy API.  Give it a new stage name of Production and then Deploy it.  Make not of the Invoke URL which will be something like this:

Invoke URL: https://xxxxxx.execute-api.us-east-1.amazonaws.com/Production

You'll need that URL to link to the Alexa Skill.

Setup the Alexa Skill

Now you'll need an Amazon Developer Account to create the Alexa skill in.  Go to the developer Alexa skills page and Add A New Skill.  You'll want to select a Skill Type of Flash Briefing Skill API and then give it a name, such as Weather Underground Skill.  Next through until you get to the Configuration tab and enter a custom error message.  Something like "The Weather Underground Skill is not currently available".

Now click on Add A New Feed  and a preamble to describe the feed, such as "Here is your weather briefing for Starksboro, VT".  Name the feed WeatherUnderground with content type of Text.  Select a genre of Weather and then enter the API Invoke URL you have from above in the URL field.  Click on Save and it will validate the link and continue on.

Next on the Test tab, flip the switch to ON so that you can integrate it with your Alexa.  Next on through and Save your skill.

Don't worry about publishing the skill, as this is just setting it up for your own personal use.  If you publish it, you run the risk of using up your Weather Underground API calls pretty quickly, as everyone will be using your API key then.

Turn on the skill

Finally, you need to turn the skill on in Alexa.  Go to the Alexa and navigate to Skills and then Your Skills.  The new skill will show up in the list, just click on it and then enable it.  After it's enabled, you can go to Manage in Flash Briefing to turn it on and set the order it shows up.  When it's ready, you can just go to Alexa and say "Give me my Flash Briefing" and it should all work.

That's it.  Hope this helps you in setting up a simple Alexa skill and doing some integration to Weather Underground!

Tuesday, November 22, 2016

AMD Radeon™ Software AMDGPU-PRO for Ubuntu 16.10

Just downloaded the latest version of AMDGPU-PRO driver and ran into some issues installing this on Ubuntu 16.10.  When I tried to install, I got the following error message:

root@miner01:~/downloads/amdgpu-pro-16.40-348864# ./amdgpu-pro-install
tee: /etc/aptsources.list.d/amdgpu-pro.list: No such file or directory
Turns out, there seems to be a problem with the source_list function.  Editing amdgpu-pro-install and changing the function from:
function source_list() {
        local dir etc sourceparts
        eval $(apt-config shell dir Dir)
        eval $(apt-config shell etc Dir::Etc)
        eval $(apt-config shell sourceparts Dir::Etc::sourceparts)
        echo ${dir}/${etc}/${sourceparts}/amdgpu-pro.list
}
and editing the sourceparts line to this:

        echo ${dir}/${etc}/${sourceparts}/amdgpu-pro.list

seems to fix the problem.  Hopefully this will help someone else out in the future.

Monday, March 21, 2016

GDS Technologies - Energy from Water?

I've been watching GDS Technologies for a while now (http://gdstechnologies.ca/) and I am intrigued with the idea of generating power using their system and water alone.  To me, it sounds too good to be true, although the underlying technology has been investigated for a while now.

Just recently, their website had the banner:


The first 2500 units of the GDS5000 will be released and ready for delivery by July 5, 2016


But as of today (March 21, 2016) they removed it from their website.  Does that mean the technology does not work, or is it just a delay in the manufacturing process?

The other thing that concerns me is their disclaimer:


Our generators are for emergency backup use only. For warranty purpose, maximum run time is 4 continuous hours per day.

It makes me wonder if it's just a glorified battery that runs for 4 hours and then is recharged?

I'm optimistic about energy generation and alternatives, but this company does raise a lot of questions...