tag:blogger.com,1999:blog-73486602709041471052024-03-20T00:13:24.323-05:00thejoestory #techthejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.comBlogger214125tag:blogger.com,1999:blog-7348660270904147105.post-48960545364179834512021-01-04T10:18:00.002-06:002021-01-04T10:18:43.989-06:00AUTOTRON 1700 - Teensy Shortcut ButtonsWanted to cook up a shortcut button thing for common work tasks. Had some 30mm arcade buttons laying around. Man I searched and searched for a 3d printable box to house 30mm buttons in. I could not find anything, most boxes use the 24mm arcade buttons. Me updating a CAD drawing is a no go so I was able to find the top plate with 30mm holes and used it. Had a cardboard box laying around and threw thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-47826884630700574982020-12-28T14:27:00.005-06:002020-12-28T14:34:35.469-06:00ESP8266 Magnetic Switch Deep Freezer MonitorSetup an ESP8266 as a Deep Freezer Monitor using a magnetic switch. The ESP8266 will start sending me emails and text messages if the Deep Freezer has been open for more than 1 minute. I also wanted to log when the Deep Freezer was open. So a web service is called to log the data to a database.<![CDATA[
#include
#include
#include
#include
const char* ssid = "SSIS";
const char* password = "thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-20218557978300526152020-11-16T08:08:00.005-06:002020-11-16T08:08:51.159-06:00PowerShell Delete files by Modified Date Simple script to delete files based on modified date. <![CDATA[
#set your root folder here
$folder = 'C:\Your Folder here\'
$start_date = Get-Date
#set your threshold here -90 = remove all files older than 90 says old
$end_date = ($start_date).AddDays(-90)
Get-ChildItem $folder -Recurse -Directory |
#Where-Object {(($_.LastWriteTime) -lt $end_date) -and ($_.psIsContainer -eq $thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-88381947046954451502020-10-28T09:29:00.006-05:002020-10-28T09:55:32.461-05:00Microsoft Teams PowerShell Bot ExampleMicrosoft Teams has a lot of cool features. This article will show you how to write a simple PowerShell bot that will post messages to a Teams channel.Configure the WebHook in MS TeamsOpen the MS Teams Channel you want to add the bot toClick ConnectorsClick the Configure button by the Incoming WebHook optionGive your WebHook a name...such and such Bot and you can upload an image if you want. thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-2944186590723764252020-10-14T08:30:00.006-05:002020-10-14T08:30:37.473-05:00AC Notification with DHT22 and ESP8266The building installed new AC units in the building. On the new units you can actually crank up the fan and turn the unit off completely. Last summer the building would routinely heat up to over 80 degrees. We are on the west side of the building so in the afternoon it gets stuffy.So we can control fan speed and power, but we cannot control the temperature. I wanted a solution where I could thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-19045426919253906802020-09-25T08:45:00.001-05:002020-09-25T08:45:34.716-05:00Alpaca Paper Trading Bot TestAlpaca is a cool little site that allows you to test various stock trading strategies using their free fake money account (paper account) with a powerful free API. Head on over to the site and sign up for a free account. You will see a link on the left side menu that takes you to the paper trading accountOn the right side of the paper account you should see a link to View your API keys. You thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-91387612742820154182020-09-25T08:32:00.001-05:002020-09-25T08:32:11.139-05:00SQL Server Read/Write Percentage and Index Usage Script<![CDATA[
DECLARE @tableNAme VARCHAR(255)
SET @tableNAme = 'Table NAME'
SELECT OBJECT_NAME(OBJECT_ID) AS TableName,
ISNULL(SUM(s.user_seeks +0.000 + s.user_scans + s.user_lookups + s.system_seeks + s.system_scans + s.system_lookups) / SUM(s.user_seeks + s.user_scans + s.user_lookups + s.user_updates + s.system_seeks + s.system_scans + s.system_lookups + s.system_updates) * 100, 0) thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-45437634501820161372020-09-24T13:25:00.002-05:002020-09-24T13:25:48.896-05:00Air Quality Calculation Purple Air API and PythonStumbled on an article about the Purple Air Air Quality API. This thing has a wealth of knowledge. Had no clue how Air Quality numbers were calculated. The API provides several different metrics for those folks that purchase the Purple Air monitoring sensors. The sensor feed data into the Purple Air network of sensors and display the data on a nice handy map: https://www.purpleair.com/map?thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-20965572863853820442020-04-29T08:10:00.005-05:002020-04-29T08:11:05.066-05:00Copy Folder Structure Only RobocopyQuick and easy way to copy the folder structure and not the files.
robocopy source destination /e /xf *.*thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-74341469120191427452020-02-12T07:54:00.001-06:002020-02-12T07:54:14.235-06:00Run MSC using RunAsAt times you need to run MSC as a different user. Specifically for active directory users and computers when managing AD objects. I have to run this app as an elevated admin to make changes. Finally made a shortcut and documenting it here for the future.
C:\Windows\System32\runas.exe /user:DOMAIN\user /savecred "cmd /c start /b mmc %SystemRoot%\system32\dsa.msc"thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-61951691322198070732019-12-24T08:39:00.001-06:002019-12-24T08:39:49.989-06:00ESP8266 DHT Temperature SensorMy cube mate seems to think that hanging NASA Space Blankets on the glass cube block windows drastically changes the temperature in our cube. It does nothing to class the place up but does seem to offer some heat savings on hot days. The blocks get up over 100 degrees on sunny days so I am sure it helps some.
Anyway, I have a thermometer at my desk and thought it would be fun to create a thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-48721666432732019532019-10-21T15:37:00.001-05:002019-10-21T15:54:46.406-05:00MQTT Python Save to SQL Server Database using OwnTracks DataStarted playing around with MQTT this week. Figured out how to save MQTT messages directly to a SQL Server database so I thought I would share how here.
Owntracks
Owntracks is an application that allows you to post your location from your phone to an MQTT broker. You can read about it here: https://owntracks.org/ and download the app. I am using Android.
Mosquitto
Mosquitto is an thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-33249456316852585152019-09-17T16:13:00.000-05:002019-09-17T16:14:24.913-05:00Chiefs Tomahawk Chop with Raspberry PiWanted to cook up a quick and nerdy way to support the Chiefs this year. So I came up with a Raspberry Pi Tomahawk Chop Button using a servo and an arcade button I had laying around.
Code here.
<![CDATA[
import RPi.GPIO as GPIO
import time
import subprocess
import os
GPIO.setmode(GPIO.BCM)
servoPin = 23
GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(servoPin, GPIO.OUT)
p = thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-40216833307413354482019-05-16T16:39:00.004-05:002019-05-16T16:43:13.288-05:00Python NEOPIXEL Google Traffic and Weather LED StripStarted playing around with the Neopixel library and python on the Raspberry Pi. I usually take a run over lunch break so I wanted a way to get a quick view of the current weather conditions. I have a 60 LED WS2812 strip so I divided the strip up into 15 LED sections.
Section 1 - Temperature. Depending on the temperature I wanted to color the 15 LEDs a specific color.
temp > 44 and < thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-2231261912666211302019-03-25T15:49:00.000-05:002019-03-25T15:55:37.819-05:00PowerShell Folder SizesMore of just a place holder for me because I am tired of searching for this everytime I need it. The following powershell will list out all the subfolders for a given root folder with Sizes and last date modified.
<![CDATA[
$array= @()
$folder = "c:\your_folder"
Get-ChildItem -Recurse $folder | Where-Object { $_.PSIsContainer } |
ForEach-Object {
$obj = New-Object PSObject
thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-2743489081090840512018-12-26T11:03:00.001-06:002018-12-26T11:03:35.677-06:00Christmas Tree Timer and SwitchDidn't do the Christmas tree to music this year. I did however setup a simple timer and override switch so the tree would turn off and on automatically.
I setup a simple relay attached it to the Raspberry Pi and wrote the Python Script below. I wired up a light switch (hadn't done this before so that was fun) to the Pi with some wire nuts. The Light switch will override the timer. So if you wantthejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-62917445064554642332018-10-03T10:34:00.001-05:002018-10-03T10:34:46.685-05:00Smart Garden v1.0 Raspberry PiSome fellas at the office had a crazy idea to try and grow a garden in their cube at work. After several people tried to talk them out of it, they plowed ahead and started one anyway. So why not hook up some sensors and a web cam and call it a Smart Garden?
Sensors and such
Kuman Moisture Sensor Kit 5Pc: From the reviews these have a tendency to not last very long. They are cheap and this thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-12082225471338326242018-09-05T10:57:00.000-05:002018-09-05T10:57:06.789-05:00Raspberry PI Relay Control using Python and FlaskI wanted to create a party button accessible from a web site using Python and Flask. Buckle up folks.
So somehow I got flask up and running. There should be a ton of articles on how to install it. I seem to remember it being pretty easy. Just google it already.
I created a new directory called party. Inside this directly I created a static and a template directory. I then created a file thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-24364808248810089342018-07-30T22:17:00.001-05:002018-07-30T22:17:27.708-05:00ESP8266 Post to Web ServicePurchased a DHT22 recently for a Work Desk Temperature project. Wrote a web service and created some SQL stuff to capture the temperature and humidity at my desk. Here we go.
Web Service
Just a real simple web service to call the stored procedure I wrote:
<![CDATA[
[WebMethod]
public string LogDeskTemp(string temp, string humidity)
{
SqlConnection con = new SqlConnection(@"thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-61766235578794407432018-07-05T12:23:00.000-05:002018-07-05T12:23:00.486-05:00Find Text String in Text Files PowershellQuick script to search a set of text files for a specific text string.
<![CDATA[
$searchString = "Text you are looking for"
$path = 'C:\SomePath2yourfiles\'
$files = Get-Childitem $path *.xml -Recurse | Where-Object { !($_.psiscontainer) }
ForEach($file IN $files) {
$result = Get-Content $file.FullName | Select-String $searchString -quiet -casesensitive
if ($result -eq $True) thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-54618030860453215892018-06-06T09:10:00.000-05:002018-06-06T09:10:18.007-05:00Raspberry Pi Speed Camera PythonI setup a pedestrian speed camera in the office using a great project by pageauc on github: https://github.com/pageauc/speed-camera. This thing was so dead simple to setup and run, and after some tweaks on the config I was clocking fast walkers in my office like a champion.
I started with a fresh Raspberry Pi 3 Raspbian build
Installed OpenCV3 using this link: https://thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-44886670745291850812018-04-02T10:25:00.002-05:002018-04-02T10:26:06.812-05:00AnswerBot 3000 Version 2Way back I made an AnswerBot using Teensy. I mean not a real one. Basically its a button that you push, it will pick a random saying and send the keystrokes using Teensy Keyboard library.
AnswerBot: keep it gucci fam
Always answerbot. Anyway, I wanted to make a better physical representation of AnswerBot so here is Version 2.0.
He of course has a short in one of the LEDs which is perfect. Ithejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-65590606230000149842018-02-25T19:24:00.003-06:002018-03-06T08:10:12.917-06:00Stream Google Play Music using Python and gmusicapiParking this example of how to stream a random song from Google Play music using the gmusicapi python library. You will have to find your device id to plug into the script which can be done using the gmusicapi like so.
<![CDATA[
from gmusicapi import Mobileclient
from gmusicapi import Webclient
import subprocess
from random import randint
import sys
api = Mobileclient()
api.login('YOUR_USER@thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-88014937815230049972018-02-22T15:19:00.000-06:002018-02-22T15:20:22.327-06:00Microsoft Face API using PythonAfter finding the Google Vision API I stumbled on the Microsoft Face API. it is pretty slick and returns more data than the Google Vision API.
<![CDATA[
import requests
import cv2
import io
from datetime import datetime
face_api_url = 'https://westcentralus.api.cognitive.microsoft.com/face/v1.0/detect'
subscription_key = "Your SUB KEY"
#image_url = 'C:\Python27\Projects\emotion\cap\thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0tag:blogger.com,1999:blog-7348660270904147105.post-81941701585916146142018-02-22T13:23:00.001-06:002018-02-22T15:17:00.518-06:00Google Vision API using PythonStumbled on this guy's cool project: http://labonnesoupe.org/2018/02/14/introducing-qrocodile/ and wanted to play around with that idea a bit. Using the Raspberry Pi and the gmusicapi module I was able to develop a proof of concept that would use the Web Cam to read a QR code and stream a song using google play.
Fast Forward a few hours after that proof of concept and an idea hit thejoestoryhttp://www.blogger.com/profile/16144268723980034955noreply@blogger.com0