├── LICENSE ├── README.md └── docs ├── _config.yml ├── _layouts └── default.html ├── _posts ├── 2020-09-30-wsus-port-80.md ├── 2020-10-01-esxi-round-robin-iops.md ├── 2020-10-01-singularity-by-2030.md ├── 2020-10-06-enumerate-esxlunpaths.md ├── 2020-10-07-deep-learning-firefly.md ├── 2020-10-12-vmware-network-disk-throughput.md ├── 2020-10-14-powershell-email-functions.md ├── 2020-10-16-hyperflex-rest-api-python.md ├── 2020-10-18-predictions-self-driving-ev-cars.md ├── 2020-10-19-neuralink-predictions.md ├── 2020-10-22-infrastructure-dashboard.md ├── 2020-10-26-dashboard-update.md ├── 2020-10-29-gibberish-detector.md ├── 2020-11-05-better-gibberish-detection.md ├── 2020-11-15-question-detection.md ├── 2020-11-24-parsing-all-wikipedia.md ├── 2020-12-01-vcenter-partner-status.md ├── 2020-12-02-deep-learning-acceleration.md ├── 2020-12-07-artificial-intuition.md ├── 2021-02-05-rundeck-acl.md ├── 2021-02-07-gamestop-laughing-man.md ├── 2021-02-19-human-scale-dnn-2030.md ├── 2021-03-12-connect-ucs-powershell.md ├── 2021-03-12-install-powershell-modules.md ├── 2021-04-15-vmware-numa.md └── 2021-09-17-ucs-vlan-scripts.md ├── _sass └── jekyll-theme-tactile.scss ├── assets ├── favicon.ico └── numa.png ├── categories.md └── index.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 David Shapiro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DavidShapiroBlog 2 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-tactile 2 | title: "David Shapiro's Technology Blog" 3 | description: Documenting my technical work as well as ruminations about the current state and future of technology 4 | -------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |` tags in an HTML email. It ain't pretty but it's fast and valuable! 50 | 51 | I also recommend removing the additional console output if you do schedule this as an unattended job. 52 | 53 | # ESX Host Throughput 54 | 55 | This is the same exact information just with a different focus. 56 | 57 | ```powershell 58 | $vmhosts = Get-VMHost | Where-Object {$_.ConnectionState -like 'connected'} | Sort-Object 59 | 60 | $data = @() 61 | 62 | foreach ($vmhost in $vmhosts) 63 | { 64 | $net = $vmhost | Get-Stat -Stat net.usage.average -Start (Get-Date).AddDays(-1) -Finish (Get-Date) -MaxSamples 5000 | Sort-Object -Property value -Descending | Select-Object -First 1 65 | $disk = $vmhost | Get-Stat -Stat disk.usage.average -Start (Get-Date).AddDays(-1) -Finish (Get-Date) -MaxSamples 5000 | Sort-Object -Property value -Descending | Select-Object -First 1 66 | $info = "" | Select-Object vmhost,max_net_kbps,max_net_time,max_disk_kbps,max_disk_time 67 | $info.vmhost = $vmhost.Name 68 | $info.max_net_kbps = $net.Value 69 | $info.max_net_time = $net.Timestamp 70 | $info.max_disk_kbps = $disk.value 71 | $info.max_disk_time = $disk.timestamp 72 | $info | fl 73 | $data += $info 74 | } 75 | 76 | Clear-Host 77 | 78 | $data | Sort-Object -Property max_net_kbps -Descending | Select-Object vmhost,max_net_kbps,max_net_time -First 20 | ft 79 | 80 | $data | Sort-Object -Property max_disk_kbps -Descending | Select-Object vmhost,max_disk_kbps,max_disk_time -First 20 | ft 81 | ``` 82 | 83 | You can add other helpful information such as Cluster if you like. 84 | 85 | # Datastore Latency 86 | 87 | Storage latency is one of those things that is horribly counter-intuitive to pretty much everyone except virtualization and storage folks, and some cross-pollinated network folks. 88 | App folks, developers, and DBAs tend to not grasp this problem unless their domain deals specifically with storage technologies. This is nothing against them - we all have domains of expertise for a reason. 89 | Datastore latency is one of those more arcane metrics that is harder to get but incredibly critical when you need it. Hence this script! 90 | 91 | IMPORTANT: This script relies upon another function I have documented here: [Enumerate-EsxLunPaths](https://daveshap.github.io/DavidShapiroBlog/2020/10/06/enumerate-esxlunpaths.html) 92 | 93 | ```powershell 94 | $stat_list = "disk.deviceReadLatency.average","disk.deviceWriteLatency.average" 95 | $host_data = @() 96 | 97 | foreach ($cluster in Get-Cluster) 98 | { 99 | $vmhosts = $cluster | Get-VMHost | Where-Object {$_.connectionstate -like "connected"} 100 | foreach ($vmhost in $vmhosts) 101 | { 102 | $stats = $vmhost | Get-Stat -Realtime -Stat $stat_list 103 | $stats = $stats | Where-Object {$_.Value -gt 200} # change this threshold to squelch noise 104 | if ($stats -eq $null) { continue } 105 | $lun_data = Enumerate-EsxLunPaths $vmhost 106 | foreach ($stat in $stats) 107 | { 108 | $lun = $lun_data | Where-Object {$_.lun_name -like $stat.Instance} | Select-Object -First 1 109 | $info = "" | Select-Object host,cluster,max_latency_ms_15_min,datastore,device_id 110 | $info.host = $vmhost.Name 111 | $info.cluster = $cluster.name 112 | $info.max_latency_ms_15_min = $stat.value 113 | $info.datastore = $lun.vol_name 114 | $info.device_id = $stat.instance 115 | $info | fl 116 | $host_data += $info 117 | } 118 | } 119 | } 120 | ``` 121 | 122 | The biggest problem with this set of stats is that they expire very quickly so you may need to set this to run repeatedly, regularly checking for problematic LUN paths. 123 | If you've ever had a major issue with storage latency, I'm sure you're already salivating. This script relies upon my `Enumerate-EsxLunPaths` function, which is lightning fast. 124 | You can run this script on demand or as a scheduled task. Generally, I have used it as an on-demand tool to help troubleshoot big issues while on calls real-time. 125 | You're most likely to need this particular gem when backup jobs are taking too long or Oracle queries are bogging down. 126 | 127 | # BONUS: UCS Statistics one-liner! 128 | 129 | Okay, so you know how VMware basically nests the OSI model inside the OSI model? Cisco UCS takes that to the *nth* degree by abstracting all storage and networking over the IOM uplinks. 130 | I once discovered just how crazy this is when a network engineer discovered one particular IOM port was saturated during backup jobs. I traced it down and discovered that `Chassis/FEX Discovery Policy` was not set to `Port Channel`, which meant that every other server was pinned to a given IOM uplink on one side. Yikes! 131 | It had taken a few weeks of complaints getting louder and louder until we discovered that **storage**-intensive backup jobs were trashing **network throughput** because of this shared nature of UCS. 132 | 133 | Without further ado, the magical command that can enumerate more UCS statistics than you ever wanted! 134 | 135 | ```powershell 136 | Get-UcsStatistics -Current | Where-Object {$_.Rn -like "tx-stats"} 137 | ``` 138 | -------------------------------------------------------------------------------- /docs/_posts/2020-10-14-powershell-email-functions.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: "PowerShell Email Functions" 4 | date: 2020-10-14 5 | description: Since I'm a monitoring addict, I use email reports a lot... 6 | categories: [PowerShell, Email, Monitoring, KB] 7 | --- 8 | 9 | These are some functions I keep in a PowerShell module on my Rundeck server for easy reuse. I can import the module at the beginning of jobs like so: 10 | 11 | ```powershell 12 | Import-Module -Force -DisableNameChecking "C:\\EmailFunctions.psm1" 13 | ``` 14 | 15 | # Send HTML Email 16 | 17 | For the most part, you will want some formatting, which means you need HTML support. In my experience, most organizations have internal SMTP relays that will relay to local (domain) addresses without authentication. This is pretty typical as many servers, applications, and hardware support email notifications but many do not support SMTP authentication. 18 | 19 | ```powershell 20 | function Send-EmailHtml 21 | { 22 | param($to, $from, $subject, $html, $smtp) 23 | $message = New-Object System.Net.Mail.MailMessage $from, $to 24 | $message.Subject = $subject 25 | $message.IsBodyHTML = $true 26 | $message.body = $html 27 | $smtp = New-Object Net.Mail.SmtpClient($smtp) # FQDN of your SMTP server or relay 28 | $smtp.Send($message) 29 | } 30 | ``` 31 | 32 | # Make a pretty HTML table 33 | 34 | PowerShell already has a default function for converting data objects to HTML tables but it's ugly. 35 | 36 | ```powershell 37 | function Make-HtmlTable 38 | { 39 | param($data) 40 | $t_header = @" 41 | 54 | "@ 55 | $table = $data | ConvertTo-Html -Head $t_header 56 | return $table 57 | } 58 | ``` 59 | 60 | # Send email with attachment 61 | 62 | I have, on occasion, been asked to schedule reports for other people. Sometimes they don't want it in a pretty HTML table, they want it as an Excel doc or something. For that, I recommend [PowerShell Galleries ImportExcel](https://www.powershellgallery.com/packages/ImportExcel/7.1.1). 63 | 64 | ```powershell 65 | function Send-EmailAttachment 66 | { 67 | param($to, $from, $subject, $body, $attachment, $smtp) 68 | # attachment must be in the form of full file path to attachment 69 | $message = New-Object System.Net.Mail.MailMessage $from, $to 70 | $message.Subject = $subject 71 | $message.IsBodyHTML = $true 72 | $message.Body = $body 73 | $file = new-object Net.Mail.Attachment($attachment) 74 | $message.Attachments.Add($file) 75 | $smtp = New-Object Net.Mail.SmtpClient($smtp) 76 | $smtp.Send($message) 77 | } 78 | ``` 79 | -------------------------------------------------------------------------------- /docs/_posts/2020-10-16-hyperflex-rest-api-python.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: "Monitoring Cisco HyperFlex REST API with Python" 4 | date: 2020-10-16 5 | description: I'm actually super salty about this 6 | categories: [UCS, HyperFlex, Python, Monitoring, KB] 7 | --- 8 | 9 | # The REST API Explorer 10 | 11 | I judge companies and products harshly by their documentation. API documentation is especially stringent because, well, an API is meant to be standardized. There's no excuse for sloppy REST API documentation. 12 | 13 | Cisco HyperFlex documentation... [leaves a lot to be desired](https://developer.cisco.com/docs/ucs-dev-center-hyperflex/#!connecting-to-the-hyperflex-rest-api-explorer). Seriously, just compare that to [Twitter's API documentation](https://developer.twitter.com/en/docs/twitter-api). It's pitiful. 14 | 15 | To make matters worse, the HyperFlex REST API apparently changes drastically from release to release so it's increasingly critical that you get familiar with the REST API Explorer. There is something to be said for having a robust API explorer, so they get some points back for that one. Still, you can see that I have a lot of debug output in these scripts, and I decided to keep them to show you just much effort it was to figure this out! 16 | 17 | # Authentication 18 | 19 | This is what I got to work after cobbling together some snippets from around the internet and gaining access to my own instance of HyperFlex. A few things to note: The `client_id` and `client_secret` are apparently mandatory but not really documented anywhere that I recall. 20 | 21 | ```python 22 | import requests 23 | import json 24 | 25 | def auth_to_hx(fqdn, username, password): 26 | url = 'https://%s/aaa/v1/auth?grant_type=password' % fqdn 27 | headers={'content-type':'application/json'} 28 | payload = {'username': username, 29 | 'password': password, 30 | 'client_id': 'HxGuiClient', 31 | 'client_secret': 'Sunnyvale', # this is the default, you can change it 32 | 'redirect_uri': 'http://%s' % fqdn} 33 | try: 34 | response = requests.post(url,headers=headers,data=json.dumps(payload),verify=False,timeout=40) 35 | if response.status_code == 201: 36 | #print('Login succeeded to', fqdn) 37 | return response.json() # this is your authentication token 38 | else: 39 | #print('LOGIN FAILED', fqdn.upper()) 40 | #print(response.status_code) 41 | #print(response.text) 42 | return None 43 | except Exception as oops: 44 | #print('LOGIN FAILED', fqdn.upper()) 45 | #print(oops) 46 | return None 47 | ``` 48 | 49 | # Enumerate Clusters 50 | 51 | HyperFlex is organized in a few ways. There are the Clusters and the Platform. We will get to the Platform in a moment. The Clusters are the meat and potatoes, though. Pass the `token` you get from authenticating to this function. 52 | 53 | Note: The `timeout` option became necessary because sometimes HyperFlex doesn't respond as fast as you'd like. Sometimes it's lightning fast. I don't really know why there's variance. 54 | 55 | 56 | ```python 57 | def get_hx_clusters(fqdn, token): 58 | url = 'https://%s/rest/clusters' % fqdn 59 | #print(url) 60 | headers={'content-type':'application/json','Authorization':token['token_type'] + token['access_token']} 61 | response = requests.get(url,headers=headers,verify=False,timeout=40) 62 | if response.status_code == 200: 63 | return response.json() 64 | else: 65 | #print(response.status_code, response.text) 66 | return None 67 | ``` 68 | 69 | Another note: The `cluster` object returns has child elements `/entityRef/id`. This is the `Cluster UUID` or `CUUID` that you will need to reference the cluster by later. Again - this was not documented anywhere! To make matters even worse, the CUUID needs to be URL encoded so you have to manually convert it back like so: 70 | 71 | ```python 72 | cuuid = cluster['entityRef']['id'].replace(':','%3A') 73 | ``` 74 | 75 | Starting to see why I'm grumpy about the HyperFlex REST API? 76 | 77 | 78 | # Get Platform Alarms 79 | 80 | The Platform is the management/controller portion. As best I can figure, this is roughly analogous to vCenter in vSphere. It's similar to the methodology used in other hyperconverged systems, such as HPE Simplivity, where you've got a VM embedded that runs the software and manages the backplane. In UCS-world, the closest thing is likely UCSM that runs inside the Fabric Interconnects. 81 | 82 | The bottom line is that you will want to monitor the HyperFlex platform as well as the clusters/hosts. Most of the time there's going to be nothing reported, but that's okay. Still, I'd much prefer the old fashioned `Get-UcsFault` style. One request, all alarms. Period, end of story. Even VMware doesn't have anything that good. Alas, it seems like we were lucky only the once. Maybe I'll combine all these functions into a single `Get-HxFault`? 83 | 84 | The platform layer will return alarms dealing with things like the manager configuration, backups, and the like. 85 | 86 | ```python 87 | def get_hx_alarms(fqdn, token): 88 | url = 'https://%s/rest/virtplatform/alarms' % fqdn 89 | #print(url) 90 | headers={'content-type':'application/json','Authorization':token['token_type'] + token['access_token']} 91 | response = requests.get(url,headers=headers,verify=False,timeout=40) 92 | if response.status_code == 200: 93 | return response.json() 94 | else: 95 | #print(response.status_code, response.text) 96 | return None 97 | ``` 98 | 99 | I actually don't know what these might look like because I didn't record the one I had, I just fixed it. If I recall correctly it was something like "email alerts not configured" or "phone home support unreachable". Those kinds of things. 100 | 101 | # Get Cluster Alarms 102 | 103 | Cluster alarms are separate from platform alarms, which are yet still separate from cluster health. I really wish it weren't so, but it is what it is. Cisco did a great thing by giving you all UCS faults in one endpoing via `Get-UcsFault` and I will forever be salty that no other platforms seem to work this way. I just want to monitor everything and fix things before they blow up. Why is that so hard? 104 | 105 | Okay, I'll quit whining. Here's the cluster alarms function. This will return things like host and VM level errors. 106 | 107 | ```python 108 | def get_hx_cluster_alarms(fqdn, token, cuuid): 109 | url = 'https://%s/coreapi/v1/clusters/%s/alarms' % (fqdn, cuuid) 110 | #print(url) 111 | headers={'content-type':'application/json','Authorization':token['token_type'] + token['access_token']} 112 | response = requests.get(url,headers=headers,verify=False,timeout=40) 113 | if response.status_code == 200: 114 | return response.json() 115 | else: 116 | print(response.status_code, response.text) 117 | return None 118 | ``` 119 | 120 | This is what a cluster alarm might look like: 121 | 122 | ```json 123 | [ { "acknowledged": False, 124 | "acknowledgedTime": 0, 125 | "acknowledgedTimeAsUTC": "", 126 | "description": "Default alarm to monitor virtual machine memory usage", 127 | "entityName": " ", 128 | "entityType": "VIRTUALMACHINE", 129 | "entityUuId": "vm-1111", 130 | "message": "Default alarm to monitor virtual machine memory usage", 131 | "name": "alarm-6.vm-1111", 132 | "status": "CRITICAL", 133 | "triggeredTime": 1002709437316, 134 | "triggeredTimeAsUTC": "2010-07-16T00:50:37Z", 135 | "uuid": "alarm-6!!Alarm!!alarm-6!!vm-3517!!VirtualMachine!!vm-3517"}] 136 | ``` 137 | 138 | 139 | # Get Cluster Health 140 | 141 | Cluster health is fun. This primarily focuses on the storage replication status. 142 | 143 | ```python 144 | def get_hx_cluster_health(fqdn, token, cuuid): 145 | url = 'https://%s/coreapi/v1/clusters/%s/health' % (fqdn, cuuid) 146 | print(url) 147 | headers={'content-type':'application/json','Authorization':token['token_type'] + token['access_token']} 148 | response = requests.get(url,headers=headers,verify=False,timeout=40) 149 | if response.status_code == 200: 150 | return response.json() 151 | else: 152 | print(response.status_code, response.text) 153 | return None 154 | ``` 155 | 156 | This is what it might look like: 157 | 158 | ```json 159 | { "dataReplicationCompliance": "COMPLIANT", 160 | "resiliencyDetails": { "dataReplicationFactor": "TWO_COPIES", 161 | "hddFailuresTolerable": 1, 162 | "messages": ["Storage cluster is healthy. "], 163 | "nodeFailuresTolerable": 1, 164 | "policyCompliance": "COMPLIANT", 165 | "resiliencyState": "HEALTHY", 166 | "ssdFailuresTolerable": 1}, 167 | "state": "ONLINE", 168 | "uuid": " ", 169 | "zkHealth": "ONLINE", 170 | "zoneResiliencyList": []} 171 | ``` 172 | 173 | -------------------------------------------------------------------------------- /docs/_posts/2020-10-18-predictions-self-driving-ev-cars.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: "Some Predictions On Self-Driving EV Cars" 4 | date: 2020-10-18 5 | description: TLDR - lots of cost savings and job changes plus a bonus homestead house! 6 | categories: [Deep-Learning, Electric-Vehicles, Self-Driving] 7 | --- 8 | 9 | # Autonomous is Coming 10 | 11 | Fully automated cars are coming. It's not just Tesla. There are a number of other startups and small companies getting in the game. So are the giants. 12 | [General Motors](https://www.theverge.com/2020/10/15/21517833/cruise-driverless-cars-test-permit-california-dmv) has entered the field, as have the likes of Ford, Nissan, and Honda. The writing is on the wall: Fully autonomous cars are coming. 13 | The big buzz right now is on *robo-taxis*. These are autonomous fleets of cars that you summon via app just like Uber and Lift, except there's no human driver. Automobile-as-a-Service. 14 | 15 | The investment is there. We are now inexorably heading for a driverless future. 16 | 17 | # The Good 18 | 19 | ## Latent Demand 20 | 21 | Life is hard and getting harder for many folks. Reliable transportation is listed as a job requirement on many jobs and is simply outside of the reach of some people. Owning a car is expensive and complicated. Insurance, maintenance, inspections, taxes. It adds up. 22 | Even those of us with cars might sometimes question the reliability of our cars and avoid long hauls for fear of getting stranded somewhere. 23 | 24 | All that is about to change. 25 | 26 | Individual transit autonomous EVs are expected to get down to 5 cents per passenger-mile. That means a thirty-mile commute (sixty for round trip) will cost you a whopping $3 per day. Let's say that rate is absurdly low and off the mark by a factor of 3. 27 | That's still only $9 per day to get to and from work with no further risk or expenses. Even though these cars will be getting much more use, reliability is not a concern. Why? The car itself can request a replacement automatically if it breaks down. 28 | Worst case scenario: You summon another replacement with your phone. 29 | 30 | This will result in far more people gaining access to work that may otherwise be presently unavailable. Mass transit models of autonomous EVs are expected to get as low as 1 cent per passenger-mile. Suddenly transport is no longer a barrier for most people. I suspect th is will have many knock-on effects on the economy. 31 | Imagine dozing off every commute. Or reading, or continuing to work. Suddenly, a longer commute doesn't sound like a bad idea. Now you can buy a rural dream house and still have the urban job. Moving across the country is suddenly more feasible. Just summon a bigger truck! 32 | 33 | Stress will decrease for millions of people, access to goods, services, and jobs will increase. This is a huge win for everyone. 34 | 35 | ## Climate Change 36 | 37 | It goes without saying that getting off fossil fuels is a good thing. There are a few caveats, namely that we have to deploy enough renewables and batteries to go completely carbon neutral. That also means reducing the carbon intensity of producting renewable hardware and batteries. 38 | I consider this a problem that will inevitably be solved for economic reasons. Rare and conflict minerals are intrinsically more expensive. It just makes economic sense to find abundant alternatives. 39 | 40 | A more immediate impact will be increased cardiopulmonary health, particular in dense urban regions. This will decrease health costs and increase quality of life for millions of people. 41 | 42 | ## More Automotive Jobs 43 | 44 | American motorists presently drive about 13,000 miles per year on average. I think that could easily double due to cheaper and safer travel, as well as that aforementioned latent demand. More miles means more wear and tear. You know what else that means? 45 | 46 | More mechanics. 47 | 48 | A lot more. Sure, EVs are a bit cheaper to maintain, but EVs are going to rack up miles far faster than ICE vehicles. The only thing fundamentally different is the power train. Everything else is still just an ordinary car. 49 | Brakes and tires wear out. Electric windows and ACs fail. Windows and windshields break. Calipers and bearings all need replacing. While a lot of things will change with EVs, there's a lot that won't when you look at the nuts and bolts. 50 | 51 | The aforementioned latent demand, I think, will see the total passenger-miles per year skyrocket. The same thing happened when electricity became cheaper - people just used a lot more of it. I would argue that electricity still has a lot of unmet demand. 52 | I think that the EV repair shops are going to be hopping busy. This will bode will for the [presently-declining automotive tech industry](https://www.cnbc.com/2017/05/22/goldman-sachs-analysis-of-autonomous-vehicle-job-loss.html). 53 | By extension, I think this could be a boon to the autoparts industry as well. 54 | 55 | A more speculative new job that could be created would be remote drivers. These are folks who work in a remote call-center of sorts and can remotely control vehicles that are in distress. 56 | 57 | ## Childcare and School 58 | 59 | The NYC subway MTA says that children as young as 12 can ride by themselves. I suspect that EVs, with their plethora of cameras, could allow for children much younger to ride without supervision. This could be a game-changer for childcare and education. 60 | Instead of waiting for the schoolbus in the morning, a vehicle is summoned for the kids, taking them to the school that is best suited to their needs, not where they happen to be geographically constrained. This yields the possibility of building more schools in cheaper areas. 61 | 62 | An extension of this includes access to after-school programs. I think this will be particularly important for children in high-risk neighborhoods. Suddenly, it becomes a lot easier for a kid to stay somewhere safer and more accomodating for studying after school, rather than going straight home to the rougher neighborhoods. 63 | This extra mobility could very well be the difference in getting more children out of the cycle of poverty. 64 | 65 | ## Savings for Everyone 66 | 67 | People who own cars spend anywhere from 10% to over 30% of their income on their cars. Once car ownership becomes optional, that's a LOT of money that folks can spend elsewhere. That reallocation of funds will likely have dramatic effects on other segments of the economy. 68 | 69 | ## Safety for Everyone 70 | 71 | It's true that autonomous cars make mistakes. It's also true that they make far fewer mistakes than humans already, and that will only get better as the technology improves. Presently, about 38,000 people die each year from traffic accidents and another 4 million are seriously injured. 72 | That's a lot of avoidable death and injuries. Traffic fatalities and injuries are incredibly traumatic. They don't just create permanent loss of life and limb, but permanent emotional harm to survivors and family. I suspect traffic deaths will fall off exponentially over the coming years. 73 | 74 | # The Bad 75 | 76 | ## Millions of Jobs Gone 77 | 78 | There are currently about 4 million driving jobs in America. Machines tend to be more reliable and safer than humans once the kinks are worked out. They can also work tirelessly, hence why industrial robots have been assembling cars for several decades now. This reliability and safety translates to one thing: better bottom lines. 79 | Before long, human drivers are going to be antiquated - a privilege for concierge-level services only. Pizza delivery? Gone. Long-haul truckers? Gone. Amazon Prime drivers? Gone. FedEx, UPS, and USPS? All gone. 80 | It will become economically infeasible to hire humans for these jobs. 81 | 82 | Petroleum figures into a lot more than just automobiles. Figures vary wildly depending on who you ask, but the petroleum industry supports somewhere between 2 million and 10 million jobs. Any significant disruption in that domain can have huge knock-on effects. 83 | It's difficult to imagine a simple antidote to this problem. With the rise of automation, I suspect many of these folks will permanently transition out of the workforce. These jobs include oil and gas workers, as well as gas station employees. 84 | 85 | With so many people permanently unemployed, I don't see any solution other than redistribution of wealth via Universal Basic Income. 86 | 87 | ## Rare and Conflict Minerals 88 | 89 | Batteries, cameras, motors, and deep learning hardware all require some exotic elements to manufacture. Presently, that presents a huge humanitarian and moral dilemma. We don't want to fund crimes against humanity, slave labor, human trafficking, and child labor. 90 | Unfortunately, we have few other options at present. Some of the rarest minerals on the planet are controlled by some of the most despotic people. As the demand of autonomous EVs rises, those despots will become even worse to maximize their own profits. 91 | 92 | The only solution is to develop alternative materials through things like nanotechnology and other advanced materials science. This takes time and, more importantly, a lot of investment. 93 | 94 | ## Privacy Goes Out the Window 95 | 96 | Busses and other public transit already have cameras. EVs and autonomous cars are going to have even more. I am willing to bet that the EULA of every autonomous car service includes signing over your data. This probably includes biometrics about your body specifically as well as your destinations and pickups. 97 | If push came to shove, I bet this could be used to harm individual liberty. 98 | 99 | One way to mitigate this would be something akin to GDPR. I would expect to see legislation coming before too long that restricts what kinds of data car companies can collect, or require some kind of compensation or ability to pay extra to opt-out. 100 | 101 | # In Conclusion 102 | 103 | The cost savings for people will all but guarantee the transition from manual ICE vehicles to autonomous EVs. The increase in safety paired with decrease in per-mile cost makes this a no-brainer. 104 | 105 | ## Reallocation 106 | 107 | The cost-savings to individuals will get allocated elsewhere. Where exactly? I can't say. Perhaps home ownership? I suspect that cheaper homes in less desirable areas will become more popular with the rise of autonomous EVs. 108 | Perhaps we will see some folks setup a trucker-to-homebuilder training pipeline? Perhaps we will see a huge rise in demand for electricians, plumbers, and general purpose handymen to build and maintain these houses. 109 | 110 | Academics predict that jobs requiring improvisation, manual dexterity, and creative problem solving will be the last to get automated away. This supports the idea that plumbers, electricians, and repairmen jobs will be robust against automation. 111 | 112 | Other types of jobs that will remain robust against automation include teaching, childcare, therapy, massage, nursing, and other human-oriented caregiving services. I think it would be wonderful to see classrooms with fewer than 10 students per teacher. 113 | 114 | ## Relocation 115 | 116 | With reliable transportation a solved problem, and more money in people's pockets, we could see a surge to rural life. This may have additional knock-on effects in terms of physical and mental health. Allergies and auto-immune disease are reduced by increased contact with nature. More time in nature means better mental health. Smaller communities also promote more regular human connection. 117 | 118 | ## Health And Safety 119 | 120 | The one-two punch of increased physical safety and decreased environmental hazards will do wonders for the loss of human life. I expect there will come a time that people aren't allowed to drive manually and that ICE vehicles are banned outright. This won't be seen directly, but rather will be felt as an absence - like how we don't have to worry about polio today. 121 | -------------------------------------------------------------------------------- /docs/_posts/2020-10-19-neuralink-predictions.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: "Neuralink Predictions" 4 | date: 2020-10-19 5 | description: We're a long ways off from Ghost in the Shell 6 | categories: [Neuralink, Singularity] 7 | --- 8 | 9 | # I've seen this movie before... 10 | 11 | Neuralink appears to be the first practical step towards a *Ghost in the Shell* type world where our brains can be plugged in and hacked. Ghost in the Shell is a cyberpunk masterpiece. 12 | I lowkey place *The Matrix* in the same world as Ghost in the Shell, just a couple decades ahead. In *The Matrix*, machines can plug into our brains and give us a complete VR simulation world. 13 | In *Ghost in the Shell* you can dive into more abstract cyberscapes to do your hacking and social media. Perhaps most impressively, *The Matrix* postulates that you could learn anything in a matter of seconds. 14 | 15 | Elon Musk has been careful not to make any such grandiose promises, except on [Joe Rogan](https://www.youtube.com/watch?v=Jtn4tr202Ko). That being said, he has let slip some extraordinary claims. Still, I'm not here to debate the man, I'm simply going to write my own predictions for this technology. Here's a non-exhaustive list of movies that immediately come to mind: 16 | 17 | * The Matrix 18 | * Ghost in the Shell 19 | * Surrogates 20 | 21 | # Rehabilitation and Diagnostics 22 | 23 | Rehab is probably going to be the top use for Neuralink. The human brain is just too big and too complicated for a few thousand electrical probes to get a good picture of what's going on. 24 | We've had people controlling computer cursors and other very basic tasks with brain-machine-interfaces (BMIs) for quite a few years now. I think that Neuralink will, at best, make such technology more accessible and sustainable. 25 | 26 | Will it help restore sight and sound to the blind and deaf? Certainly not the early versions. Will it help restore motor function to paralysis and ALS victims? That's probably even farther away. 27 | 28 | Sensing and interpreting output is one thing. Every brain is different and so you'll need a lot of data and computational power outside of the Neuralink implant to even make sense of a lot of the output. 29 | It's simply not possible to jam enough computer power into a quarter-sized implant to do that. I am skeptical if phones even have enough horsepower to do this. I suspect that you'll need to integrate with cloud services, and more powerful computers, to get many of the benefits Elon has suggested. 30 | 31 | However! 32 | 33 | There would be a huge value to everyone walking around with high quality sensors in their heads (as well as the rest of their bodies). Stroke, aneurysm, dementia, depression, PTSD - all these things could be detected very early. 34 | The impact on the quality of life for people by avoiding suffering would be phenomenal. I suspect that Neuralink will ultimately find a lot of value by integrating with the ENS (Enteric Nervous System) as well. 35 | The brain-gut-axis is turning out to be extraordinarily important for mental and physical health, carrying huge implications for chronic illness. 36 | 37 | # High Bandwidth BMI 38 | 39 | I seriously doubt this will come about. Here are some reasons why. 40 | 41 | ## Limits of the human brain 42 | 43 | It can take us a while to formualte cogent, cohesive thoughts. We recruit specific regions of the brain when we intend to speak, and when we are listening and reading. Some of these regions are quite large, far too large for Neuralink to adequately survey. 44 | Elon says that writing, reading, speaking, and listening are very low-bandwidth. From a strictly numerical standpoint, I agree. But I also think that humans can only get so much faster. We have evolved to ingest general purpose information by listening to other humans. 45 | We simply lack the hardware and software to ingest data through other means. Even our reading and writing is just a facsimile of our speech, representing the sounds of speech with visual symbols. 46 | 47 | Sure, you can watch a lecture at 2x speed and still get most of it. We even have multimodal learning, where you see, do, hear, and practice all at once. It's simply a fact that human brains take a while to acquire new skills and knowledge. 48 | 49 | Neuralink would have to fundamentally alter the way the human brain works - which I don't think it will do with its first iterations. I would absolutely LOVE to be wrong. Maybe using Neuralink is a skill, a talent that we will have to develop. 50 | Perhaps we will have to learn to communicate with and through the device. Maybe it will ultimately be faster. It would be wonderful if I could type up this blog without a keyboard. 51 | 52 | Still, I think there are fundamental limits to how fast the human brain can assimilate and integrate new information. I think those limits are biological and won't be changed by a tiny implant. 53 | 54 | Sorry Neo, no helicopter program for you. 55 | 56 | ## Computer horsepower 57 | 58 | The human brain's processing power is roughly the equivalent of a 1 petaflop computer. It's a really bold claim to say that a pocket-sized machine could communicate with that faster and more effectively than it already can. 59 | The one caveat is if the power of the human brain is actually what the Neuralink device relies on. Still, I'm highly skeptical. 60 | 61 | At full power, my Pixel 4 operates at 954 GFLOPS, just shy of 1 TFLOPS, which is 1000x less powerful than my brain. 62 | 63 | Why do I use this comparison? 64 | 65 | I anticipate that Neuralink will have to build a model unique to everyone to essentially simulate their brains in order to calculate the exact pattern of neural stimulation required to communicate with us at a high bandwidth. 66 | In principle, I do believe that *Ghost in the Shell* and *The Matrix* technologies are possible. The human brain relies solely on neural impulses for all input and output (IO). We know this for a fact. 67 | 68 | When you want a human brain to learn something, you want to change the state of neurons, their individual "memory" in the form of synaptic connections. There's an initial state and an end state. 69 | We will probably need to be able to simulate or model a large portion of your human brain in order to communicate quickly and effectively with just you. If Moore's law holds, then it will be 20 years before a smartphone reaches the petaflop mark. 70 | That's 2040, which will be approaching Singularity anyways. If the overall goal is to prevent an AI holocaust, that's likely to be too late. 71 | 72 | # Direct sensory stimulation 73 | 74 | While I do believe the high bandwidth BMI is 20 years away, I think we could see direct audio and visual stimulation much sooner. Paradoxically, the part of the brain that handles optical processing is at the back of the head. 75 | This makes it an easy place to drop some electrodes. Perhaps this is why Neo jacks in at the back of his head? In *Ghost in the Shell* the connectors are on the back of the neck, closer to the brain stem. 76 | 77 | This could ultimately allow for hardware sensors being integrated, used to replace defective or missing eyes and ears. Wouldn't that be cool! You can upgrade your eyes to have telescopic and thermal vision! You could hear better than cats and dogs. 78 | Maybe you'll be able to relay extra sensory information via BlueTooth on your phone. 79 | 80 | In this way, I think Neuralink is far more likely to result in some cool augmented reality abilities rather than full VR. At least for the foreseeable future. 81 | 82 | # Telepresence robotics 83 | 84 | Did you ever see the creepy Bruce Willis movie *Surrogates*? Basically, I think we're far more likely to see that sort of thing than anything else. Elon Musk already demonstrated the ability to detect motor movements from neural signals. 85 | With motor output and sensory input, you could remotely inhabit any machine, not just human-like ones. In that movie, a bunch of soldiers are sitting in a call-center, remotely piloting battle mechs. 86 | 87 | The movie was really cool in the premise but the villain was very 1980's. Spoiler alert: *He's going to take over the world by enslaving everyone with his telepresence robotics technology! Bwahahaha!* Yeah, that was dumb. 88 | 89 | I recently played through a game called *Lone Echo* where you occupy the perspective of a robot working on the outside of a space mining station. I think that Neuralink could enable that sort of remote work for humans. 90 | *Dr. Who* even had an episode about this, except the telepresence robots were learning polymer goo that became sentient and rebelled, killing the workers. 91 | 92 | 93 | -------------------------------------------------------------------------------- /docs/_posts/2020-10-22-infrastructure-dashboard.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: "My Infrastructure Dashboard" 4 | date: 2020-10-22 5 | description: When you're responsible for dozens of systems and hundreds of hosts... 6 | categories: [VMware, UCS, Python, PowerShell, Flask, Monitoring, Dashboard] 7 | --- 8 | 9 | # Enterprise Tools are Expensive 10 | 11 | I'm not gonna knock tools like vRops and UCS Director and SolarWinds. They are awesome tools, but they are expensive. 12 | They also tend to offer a lot of functionality that I might not need. Lastly, they might not integrate with all my systems. Here's a summary of what I want in a dashboard: 13 | 14 | - Single pane of glass for EVERYTHING I'm responsible for 15 | - Inventory of hardware, servers, switches, blades, etc 16 | - All active faults, alarms, etc, across all my systems 17 | - Capacity and throughput for all my systems 18 | - I want it to be FAST and CLEAN 19 | 20 | Basically, I want the ability to glance at one thing to quickly ascertain the state of my entire environment. 21 | I set up a previous version of this at a while back and several of my team members found it indispensible - a great way to keep dynamic track of all inventory. 22 | This is especially critical when you have blades, chassis, and vCenters that don't necessarily all talk to each other. 23 | 24 | My first iteration of this was something like 7 years ago, when I tried to make a PowerShell GUI app that I called "vCommander". 25 | It didn't go too far because I didn't have clarity of purpose. I thought I wanted a fast way to run all my scripts, but for that I just use PowerShell ISE and now Rundeck. 26 | [Rundeck](https://www.rundeck.com/) provides all the script-via-web functionality you could ever want and it's open source! 27 | 28 | # Python Flask 29 | 30 | Ever build a web page from scratch? Well, now you can! With Python and Flask! Personally, I've created a few utility tools and REST APIs with Flask. 31 | It's one of my favorite little things. 32 | 33 | ## Bare Bones Version 34 | 35 | ```python 36 | import flask 37 | import json 38 | 39 | 40 | def json_to_html_table(data): 41 | # data must be list of dicts, where all dicts have same keys 42 | result = ' ' 59 | return result 60 | 61 | 62 | def load_json_content(filepath): 63 | html = '' 64 | with open(filepath, 'r') as infile: 65 | content = json.load(infile) 66 | for section in content: 67 | html += '\n
' 43 | keys = data[0].keys() 44 | for k in keys: 45 | result += ' %s ' % k 46 | for row in data: 47 | result += '' 48 | for k in keys: 49 | try: 50 | if 'http' in row[k]: 51 | short_name = row[k].replace('https://','').replace('http://', '').split('.')[0] 52 | result += ' ' 58 | result += '%s ' % (row[k], short_name) 53 | else: 54 | result += '%s ' % row[k] 55 | except: 56 | result += '%s ' % row[k] 57 | result += '\n' 70 | return html 71 | 72 | 73 | app = flask.Flask('InfrastructureDashboard') 74 | 75 | 76 | @app.route('/', methods=['get']) 77 | def home(): 78 | html = base_html 79 | html += '\n%s
\n' % section['Header'] 68 | html += json_to_html_table(section['Data']) 69 | html += '\nFast Links
\n' 80 | html += load_json_content(\n) 81 | html += '\n