Wanted 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 some stickers on that bad boi, there ya go the AUTOTRON1700
Monday, January 4, 2021
Monday, December 28, 2020
ESP8266 Magnetic Switch Deep Freezer Monitor
Setup 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.
If the Deep Freezer has been opened for over a minute I get a text and an email. Then the counter resets. If if is still open after another minute I get another text and email. In version 2 I am planning to add a temperature probe I can place in the deep freeze. Then I will take some random temp samples to monitor the temperature.
Monday, November 16, 2020
PowerShell Delete files by Modified Date
Simple script to delete files based on modified date.
Wednesday, October 28, 2020
Microsoft Teams PowerShell Bot Example
Microsoft 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 Teams
- Open the MS Teams Channel you want to add the bot to
- Click Connectors
- Click the Configure button by the Incoming WebHook option
- Give your WebHook a name...such and such Bot and you can upload an image if you want. Scroll down and click Create
- On the create screen you will see a URL. Copy this URL and save it somewhere you will need it in your PowerShell Script.
PowerShell Script
Wednesday, October 14, 2020
AC Notification with DHT22 and ESP8266
Friday, September 25, 2020
Alpaca Paper Trading Bot Test
Alpaca 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 account
On the right side of the paper account you should see a link to View your API keys. You will need these keys to plug into your Python Script. They have tons of documentation on the API but I will list out a few samples below. You will see a Buy, Sell, Lookup Order, and a very basic Trade Bot.
Buy Sample
Sell Sample
Lookup order Sample
Basic Trade Bot
This is a very very very basic Trading bot for a paper money account (fake money). Please don't use this and expect big GAINS. The bot will buy shares and then hold them until a specified profit threshold or loss threshold has been hit. You can tweak the thresholds to see how the strategy works. At the bottom of the script you'll see the startBot('WDC') command. This is where you insert the stock you want to work with.
Of course this can be improved upon, this is just a sample to get the bot up and rolling quickly. The bot can be configured to work with multiple stocks, etc.
So there you have it. Run wild, make a fancy new trading strategy and reap all the GAINS.
Thursday, September 24, 2020
Air Quality Calculation Purple Air API and Python
Stumbled 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?mylocation
You can easily hit the Purple Air api when you find a sensor in your location. Just click on the sensor you want and inspect the URL. Here is an example of the sensor near Vinita Oklahoma: https://www.purpleair.com/map?opt=1/mHUMIDEX_F/a10/cC0&select=35895#12.99/36.63253/-95.14012
That Select = in the Address is what you want to key on. Now that you have the sensor ID you can just plug that in to the URL to get the JSON feed for that sensor: http://www.purpleair.com/json?show=11668
You will get back some neat looking JSON. Now all you need to do is parse it. See below for sample code. This is using Python to parse out the JSON return value and then doing some fancy math to calculate air quality index based on the value returned for PM2.5 Particulate < 2.5 microns pollutant. You can read up more about the Air Quality Index here: https://www.airnow.gov/aqi/aqi-basics/#:~:text=Think%20of%20the%20AQI%20as,300%20represents%20hazardous%20air%20quality.
Wednesday, April 29, 2020
Copy Folder Structure Only Robocopy
robocopy source destination /e /xf *.*
Wednesday, February 12, 2020
Run MSC using RunAs
C:\Windows\System32\runas.exe /user:DOMAIN\user /savecred "cmd /c start /b mmc %SystemRoot%\system32\dsa.msc"