From the sublime to the ridiculous.
12/31/2021 - Wintertime acceleration traction.
Ice is well known for having much less friction than bituminous tarmacadam (aka asphalt), a situation that often confounds drivers in winter. Indeed, ice's coefficient is about 5%, while dry asphalt's is up to 70%, with 40% for wet asphalt, for an all-season radial tire. Untreaded racing slicks increase this to 90% when dry - and this falls to 10% when wet, which is why racecar drivers make a pitstop when it starts raining, to change to all season radials.
This compounds the internal combustion engine's "initial inertia" issue - how to get a vehicle started from a full stop. Moving a vehicle from 0 MPH means adding momentous energy to it until it reaches 1 MPH, and so on and so forth, until it reaches the desired speed. The internal combustion engine has a minimum rotation speed (usually around 800 RPMs) to remain operational - lower than this and an individual combustion doesn't have the energy to rotate the engine. So there's a gap between the 800 RPM minimum and the, like, 1 RPM needed to reach that 1 MPH. How to bridge it? Rails for trains have a coefficient of max 50% when dry and 30% when wet, which is right around the 40% for wet asphalt. So trains essentially "spin out" until the train gets close to the wheel's speed. And while fine with steel wheels, Ken Block eats styrene-butadiene tires for breakfast.
Energy transmission and conversion.
So how do cars solve this? Transmissions, which convert some of the rotational energy into more torque. Several types are common:
- Dry-clutch manual - burns clutch pad instead of tire, with the driver manually adjusting the pressure between 2 asbestos plates, letting partial friction transfer some of the rotational energy to the wheels. Once up to speed, the strong spring holding the 2 plates together transfers like 95% of engine power. The driver has to manually shift between gears using the clutch pedal and gear shifter. (Which can be quite fun.)
- Hydrostatic automatic - churns highly-viscous transmission fluid instead of clutch pad, but this loses about 33% of engine power to friction, viscosity, turbulence,and emulsions. Usually this is coupled with a drum-style gearset and rotational shifter that downshifts with higher engine speed and upshifts with higher wheel speed. These sometimes "lock" to the engine at highway speeds, where most transmissions are simply transferring engine power at a 1:1 ratio and not multiplying its torque.
- Dual-shift manual - a pair of alternating-gear manual transmissions automatically shifted between - one set has 1,3,5(,7,9) and the other 2,4(,6,8,10) - so the engine will shift one, transfer power between, and shift the other. It still burns clutch pad at the get-go.
- Continuous-variable automatic - This is a hydrostatic automatic with an oddly-complex steel belt between two pulleys instead of the drum transmission.
- Gas-electric automatic - essentially an electric car with 1 mile of battery range, and a built-in gas generator to recharge the batteries. At a stop, the engine is usually off, and traction is provided by the 2 "traction motors" MG1 & MG2 propel the car for lower acceleration. A planetary gearset combines MG1 and engine inputs to transmission output, allowing MG1 to both start the engine and siphon engine power to conrol speed - up to highway speeds where it locks, giving a 1:1 ratio power transfer from engine to wheels, like other transmissions. The siphoned engine power is stored in the batteries.
Most of these are designed around a minimum friction coefficient around that of all season tires on wet asphalt of 40%, which creates another gap with ice's 5% coefficient.
Relationship with tire speed:
The other side of this issue is the maximum wheel torque possible to maintain friction. Asphalt has a much, much higher capacity for heat, and so can absorb and withstand significantly more torque than ice before changing states to liquid. (This can still happen in the summer heat.) The friction coefficient represents this, where 1 minus the coefficient is turned into heat, and the friction coefficient becomes the percentage of energy that can be transferred without melting the surface. Liquids basically have viscosity instead of friction, and liquid water has low viscosity, causing the tire to spin once too much energy has been transferred - as the water transitions from solid to liquid, its abiltiy to frictionally transfer energy plummets. So this is an equation with a minimum rotation based on engine speed, and a maximum rotation based on the coefficient, meaning the equation sometimes doesn't balance. This results in the system having either too-low rotational energy (engine stall) or too high rotational energy (spin out), or sometimes both at once. There is no Goldilocks here.
And there are yet more solutions to bridge this:
- Power to all wheels is the ultimate acceleration traction solution, using a differential transmission to average both torque and the friction coefficient between all 4 tires, but involves adding weight and complexity. Usual options are either 4x4, 4WD, one of the AWD varieties, or dual-motor/rear-motor eAWD (for electrics and hybrids). Each has specific advantages and disadvantages over the others.
- Tire chains are the ultimate stopping and handling traction solution, raising the traction coefficient on ice back into the neighborhood of wet pavement. A downside is that they are somewhat fragile and break easily. Also, chains on pavement can actually reduce traction coefficient back to ice levels, as the metal chains slide on pavement like train wheels on steel rails, causing a chained vehicle to become disabled on a dry road.
- Studded tires are similar to tire chains, requiring more work to install but being more durable. These cause heavy wear on asphalt and concrete roadways, and may not be legal for most of the year. They increase the friction coefficient by around 75%, increasing ice's coeffiicent from 5% up closer to 9%, but sometimes up to 13%. These too reduce the tire's friction coefficient on dry asphalt, but only by 5% (down from 70% to 66.5%) so shouldn't noticeably increase fuel usage.
Electric cars (both BEV and Hybrid) can use a type of eAWD. These cars are known for high torque output at zero RPMs, which is a struggle described above for internal combustion. The drivetrains are decoupled from any minimum rotations needed by an internal combustion engine, and are free to output the motor's maximum. And often an electric car's accelerator pedal inputs are written pretty aggressively to the motor outputs, to showcase performance on dry pavement. Which reintroduces the power gap described above for internal combustion.
Many come with another option: Eco mode
Eco mode makes the accelerator pedal a lot less sensitive, like there's a spring between it and the throttle body, which is perfect for snow and ice (and sand and gravel, but those are other stories). Going just 1 or 2 MPH becomes effortless, and while you're not racing around downtown like a 4x4 lifted truck, you're not stuck in a parking lot either. Plowed roads and packed snow turn into viable routes, and snow goes from being exciting to merely pretty.
12/28/2021 - What's the difference between kilowatts and Newton-meters?
Cars are rated in both - often seeing a peak in KW a lower engine rotational output than Netwon-meters.
These are the SI conversions from traditional measurements of horsepower (HP - the force necessary to lift a total mass of 33,000 pounds upwards by one foot in one minute) and torque (lb-ft, the force necessary to lift a total mass of 1 pounds rotationally at one foot from the pivot point.) Indeed, these can be converted to each other, once resolving the dimensional mismatch: Torque has units of mass and height, but HP has units of mass and height, and time which will have to be divided off. So torque can be converted to HP/min, giving 1 HP/min = 33,000 lb-ft. But there's still the rotation - the 33,000 has to be divided around a circle, aka by 2π, so 1 HP/min = 5252 lb-ft.
A little history.
Horsepower was originally determined from the amount of work a horse performed over a day while pulling a mill wheel. Torque comes from the Roman name for the twisting patterns of Celtic necklaces, and now means the forces involved in twisting or rotation.
So what's being measured here?
Converting them to SI units are a clue. Broadly speaking, Horsepower is energy delivered across a span of time, while torque is energy delivered at a moment in time. (Humans are capable of generating more than 1 HP in short bursts.) Torque is the ability to spin the wheels, while kW/HP is the ability to convert fuel into raw velocity. Combustion engines give different RPM values for these as energy output doesn't scale linearly with fuel consumption, partly due to engine timing differences, and partly due to the gearbox which is basically mandatory with internal combustion.
Last notes:
Horsepower is a time-dependent metric, but people often rattle it off without the time dimension, making it meaningless. Pay attention to torque and 0-60 numbers.
12/25/2021 - Information transmission with quantum entanglement.
Entangled particles have no propagation delay, despite the distances between them. And they will always have inverted polarity. So we have a sender and receiver, and the receiver always measures the polarization in the Z-down direction. The sender is transmitting a binary stream, and so measures in the Z-up direction for 1s, and for 0s measures in the X-down direction. Measuring "resets" the polarity along the measured direction, in the same way that all photons passing through a polarized film (aka sunglasses) are polarized in the same direction from the film's tiny slits. (This polarization is a huge part of the double-slit experiment.) And so the recipient would measure in the Z-down direction foreach of these, and converting the positive Z-down outcome as 1s, leaving the rest to zeroes. X-down measurement will result in an X-up polarization of the remote particle, so in theory this would always generate a negative result in a Z-down measurement. - the actual measurement vector of the binary zero might be a different measurement. And of course data would travel through data redundancy tools like Hamming codes, just like CDs and RAM, to prevent single-bit transmission losses.
12/23/2021 - Code chunk to update SG:
#Step 1: Prereq Variables
$DefaultSecurityGroupID = "sg-123456" #Update with your hosting SG.
#Step 2: Prereq Functions
#These can be found in my December 1st post, among others.
#Function Reset-AwsApiKey
#Function New-RdpSecurityGroup
#Step 3: Main Code
$currentServer = (Get-EC2Instance).Instances
[string]$SubnetID = $currentServer.subnetID
$Subnet = get-ec2subnet $SubnetID
[int]$CurrentSecurityGroupName = (Get-EC2SecurityGroup | where {$_.description -match "Created on"}).GroupName
Reset-AwsApiKey
$newSecurityGroupID = New-RdpSecurityGroup
$newServer = (Get-EC2Instance $newServer.instanceid).Instances
Edit-EC2InstanceAttribute -InstanceId $newServer.InstanceId -Group @($DefaultSecurityGroupID, $newSecurityGroupID)
Remove-EC2SecurityGroup -GroupId (Get-EC2SecurityGroup -GroupName $CurrentSecurityGroupName).GroupId -Force
12/22/2021 - If a tree falls in the forest, and there's nobody around, is it art?
...imitates life imitates art imitates life imitates art...
Life and art oscillate through an imitation field as they travel through time, not unlike electric and magnetic fields.
- Art makes you feel something. Art causes an emotional response within an emotional consciousness.
- Life is a set of chemical and physical processes that balance and drive each other against entropy over large time frames.
If you're comprehending this, then you're a set of chemical and physical processes complex enough to have developed a consciousness, and maybe emotions too. As sounds are merely vibrations until turned into electomechanical sensations by our bodies and brains, so too art is merely a collection of objects (or vibrations, see music) until turned into electromechanical sensations by our bodies and brains.
A lot of living objects are incapable of perceiving art, and so cannot imitate it. And some living objects *are* art, as they make other living objects feel emotions, such as the desire to smash/pairbond/eat the earlier life. As though life and art are two aspects of the same coin - life is art, and art creates impulses that drive life.
A tree falling in a forest - it makes me feel glad I'm not there for the tree to injure.
12/21/2021 - Inverted dice values making a moire pattern.
Table 1: Started with a classic 2d6 table:
+ | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
This shows all possible values, with the classic diagonal gradient, showing how entropy makes 2d6 sum to 7 more often than any other value, across the diagonal from the lower-left corner to the upper-right corner. The two d6 are the axes, and the dice rolls are the center of the chart. It's a nice and pretty gradient going from the upper-left corner to the lower-right corner. But what if we pretended these were waves, with the even numbers being the wave's positive amplitude, while odd numbers are the negative crests?
Table 2
+ | -1 | 2 | -3 | 4 | -5 | 6 |
---|---|---|---|---|---|---|
-1 | -2 | 1 | -4 | 3 | -6 | 5 |
2 | 1 | 4 | -1 | 6 | -3 | 8 |
-3 | -4 | -1 | -6 | 1 | -8 | 3 |
4 | 3 | 6 | 1 | 8 | -1 | 10 |
-5 | -6 | -3 | -8 | -1 | -10 | 1 |
6 | 5 | 8 | 3 | 10 | 1 | 12 |
It seems like a moire pattern at first glance. After staring at it for a bit, the first thing I saw was that only even numbers seem to follow the same gradient pattern as the above chart, but they flip-flop from positive to negative as they move across the diagonal from lower-left to upper-right - very wavelike! The second thing I noticed was that odd numbers do have diagonals, but they're the other diagonal (upper-left to lower-right, just like the 7s in the top table), and also flip-flop from positive to negative.
Table 3: Flipping this pattern, from odd-negative to even-negative, just reverses the signs of Table 2.
+ | 1 | -2 | 3 | -4 | 5 | -6 |
---|---|---|---|---|---|---|
1 | 2 | -1 | 4 | -3 | 6 | -5 |
-2 | -1 | -4 | 1 | -6 | 3 | -8 |
3 | 4 | 1 | 6 | -1 | 8 | -3 |
-4 | -3 | -6 | -1 | -8 | 1 | -10 |
5 | 6 | 3 | 8 | 1 | 10 | -1 |
-6 | -5 | -8 | -3 | -10 | -1 | -12 |
For diagonal clarity, we can call lower-left to upper-right "red diagonals" the others, upper-left to lower-right are "blue diagonals".
Some numbers become unavailable with this odd-negative system from Table 2: -12, 0, 7, 9, 11, and any odd negative number. This is because numbers which sum with their like types (even + even and odd + odd) increase in magnitude (away from 0), but those that cross (even + odd) decrease in magnitude towards 0. And summing like types results in even numbers, while crossing types produces odd numbers. 7, 9, and 11 are unavailable because they're larger than the largest d6 role, meaning they can't be reached subtractively, only additively - but being odd, they can only be built from a cross-type sum, which can only decrease in magnitude towards zero in this system. In other words, no code paths lead to their output in this finite state machine. -11, -9, and -7 are similar, with the added caveat that both even and odd halves of the cross-type sum would have to be negative, so are doubly unlikely. -12 being unavailalble is an artifact of only being rechable if the largest d6 role is negative, and that being false here, making this code path also unavailable. Zero is unavailable as there are no equal opposite values.
Table 4: One step further.
+ | -1 | 2 | -3 | 4 | -5 | 6 |
---|---|---|---|---|---|---|
1 | 0 | 3 | -2 | 5 | -4 | 7 |
-2 | -3 | 0 | -5 | 2 | -7 | 4 |
3 | 2 | 5 | 0 | 7 | -2 | 9 |
-4 | -5 | -2 | -7 | 0 | -9 | 2 |
5 | 4 | 7 | 2 | 9 | 0 | 11 |
-6 | -7 | -4 | -9 | -2 | -11 | 0 |
Mix an even-negative die and odd-negative die. This gives a very different pattern, with a 0 down the middle red diagonal, and numbers reflected across that middle red diagonal - if the upper-right half were "positive", the lower-left half would be "negative", as numbers are the same magnitude but with opposite sign. And unusually, even and odd have switched places, with even numbers on the blue diagonals, and odd numbers on the red diagonals.
Numbers -12, -10, -8, -6, -1, 1, 6 8, 10, 12 are unavailable here, almost exclusively even numbers. Unlike Table 2, like-type addition decreases in magnitude while cross-type increases in magnitude, but summing like types still results in even numbers (and crossing types produces odd numbers). So even numbers can only be reached by reducing in magnitude, making those equal or above the d6 max roll off limits. And odd numbers can only be reached by increasing in magnitude, blocking off 1 and -1 (which are odd for our purposes here).
Not sure what to do with this info? You're not alone, as I'm not sure what to do with it either.
Table 5: Moar Analysis - rebuilding the original table.
The red diagonals from the third and fourth tables combine to remake the first table, but with alternating positive and negative rows:
+ | 1/-1 | -2/2 | 3/-3 | -4/4 | 5/-5 | -6/6 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
-2 | -3 | -4 | -5 | -6 | -7 | -8 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
-4 | -5 | -6 | -7 | -8 | -9 | -10 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
-6 | -7 | -8 | -9 | -10 | -11 | -12 |
Table 6: Reverting the negatives.
This brings back Table 1:
+ | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
Table 7: The other half.
What do you get when you combine the blue diagonals from the third and the fourth tables? This is like the opposite of Table 5:
+ | -1/1 | 2/-2 | -3/3 | 4/-4 | -5/5 | 6/-6 |
---|---|---|---|---|---|---|
1 | 0 | -1 | -2 | -3 | -4 | -5 |
-2 | -1 | 0 | 1 | 2 | 3 | 4 |
3 | 2 | 1 | 0 | -1 | -2 | -3 |
-4 | -3 | -2 | -1 | 0 | 1 | 2 |
5 | 4 | 3 | 2 | 1 | 0 | -1 |
-6 | -5 | -4 | -3 | -2 | -1 | 0 |
Table 8: Reverting Table 7's negatives.
This gives us a subtraction table:
- | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
1 | 0 | -1 | -2 | -3 | -4 | -5 |
2 | 1 | 0 | -1 | -2 | -3 | -4 |
3 | 2 | 1 | 0 | -1 | -2 | -3 |
4 | 3 | 2 | -1 | 0 | -1 | -2 |
5 | 4 | 3 | 2 | 1 | 0 | -1 |
6 | 5 | 4 | 3 | 2 | 1 | 0 |
Is this the inverse or complement of Table 1?
12/20/2021 - The Log4J hack explained.
The hack itself is pretty simple, as explained by FitMC: just send "${JDNI:LDAP" followed by any command (and eventually the closing curly brace). Here's how it works:
- Dollar sign and curly braces ${ } are a way of adding arbitrary code - usually a variable - in the middle of a string. This makes a template that can be used often without modifying. Imagine if every customer needed a custom version of your software or website, with their name coded in every Name field.
- It's frequently used to personalize a string: `Hello ${User.FirstName}, how are you?`
- Sometimes it's badly used: `Hello ${String[] userName = User.name.split(" ");userName[0];}, how are you?`
- This feature should be escaped or caught within Log4J, and these commands should show up harmlessly in the weblogs instead.
- JNDI (Java Naming and Directory Interface) is a built-in directory lookup tool, and has interfaces for common directories, one of which is LDAP (Lightweight Directory Access Protocol).
- The most popular implementation of LDAP is Microsoft Active Directory, so this interface is likely widely used for legitimate purposes.
- The JNDI LDAP package has an "Extended" Operation mode, which is likely what's being hit here. I'm guessing the LDAP package's default switch puts whatever is sent to it inside Runtime.exec().
And that's pretty much it. This exploit uses built-in Java notation to escape Log4J program, and a built-in Java directory lookup service, which seems to allow arbitrary code execution. Evil here isn't the result of people acting maliciously and writing evil code with their "evil hats" on, but the result of gaps between good intentions. Unlike Batman or Charlie's Angels, there's no Mr Robot to punch away and stop future hacks. Instead, a resurgence of code analysis tools and code evaluation techniques will likely create the greatest benefit at the least cost.
12/15/2021 - Capitalism levels.
Capitalism is a system for transferring and exchanging physical, liquid, and intangible assets. It has 2 categorizes for resources: money, and everything that can be bought with money - which includes the time of humans to perform work that legally belongs to you.
- Provide Raw Materials: From mining, lumberjacking, farming, shipping (traveling merchants), etc.
- Build Components: Take raw materials and turn them into tools. (Foundry forms refined ores into sheets, wires, tubes, and other forms.)
- Assemble Components: Take tools as components and assemble into composite products (Radio maker takes coils, crystals, speakers, wires, & wooden boxes, and outputs radios.)
- Expand the Market: Transform products into new forms that open up new uses and/or new customers. (Miniaturize the cabinet-sized radio into a pocket radio.)
- Advertising: People tend to do what they're told, so tell them to buy your radio.
- Market Capture: Merge with old competition and acquire new competition. Spin off irrelevant SBUs in other markets to maintain regulatory compliance.
- ?
12/14/2021 - Legends and Theories.
Legends and theories are both stories. Legends are supposed to always be false if they are falsifiable, while theories must be falsifiable but can be true. But sometimes legends become true too.
Falsifiable | False | True | |
---|---|---|---|
Legend | Either | Always | Never |
Theory | Always | Either | Either |
Oops | Yes | No | Yes |
So is a falsifiable legend that becomes true actually a theory?
12/11/2021 - Two Megabytes of World History!!1!.
The World History page, including over 6,000 past and future events, now weighs in a at a beefy 2,098,673 bytes of history in a big table. This project was started in 2016, but didn't hit the 1 MB mark until shortly after going online in August, so that's 1 MB or 3000 entries in 120 days, or 25 per day. Most of these were periodic events like reigns of kings, emperors, pharoahs, and cicadas. Based on an average rate of 10 per day, we should reach 3 MB or 9000 total entries in October 2022. Future plans include "We didn't start the fire" for January and maybe February, depending on how long it takes. Then catching up on the nigh-infinite backlog. Happy reading!
12/7/2021 - This backpack is a game-charger.
This has been in the back of my mind for over 20 years - a laptop backpack that you could plug in. APC killed off this idea around 2007 by releasing an inferior product - a laptop bag with some USB ports and a built-in USB battery. So here is the kit:
- Solo-NY Duane hybrid briefcase backpack
- j5create - USB-C Travel Dock
- Razer Naga Pro
- 3 outlet 2 prong power strip
- Monoprice 4K High Speed HDMI Cable 12ft - 18Gbps Black
- Sonicare Toothbrush
- Other USB or 2 prong devices.
- Optional upgrade: 12+ port USB hub for the USB professional
It enables a portable IT generalist to use their laptop across a variety of modes:
- Full wireless - laptop and mouse in bluetooth mode.
- Wired mouse - Plugin laptop and mouse for charging and better responsiveness.
- Powered system - Plug the bag into a power outlet for full gaming speed. Also charges the laptop, mouse, and any connected devices.
- Projected system - Plug the bag into any HDMI TV or monitor and dazzle the conference room, get a lot of work done on a second monitor, or relax and watch a movie on the big screen.
- Powered and Projected - Plug into both HDMI and a power outlet to move your game to the big screen. Also charges everything.
Freedom to game and travel around the planet can be yours for just $699. Order yours now!.
12/6/2021 - Birds and squirrels plant seeds.
As winter approaches, birds, squirrels, and other small woodland creatures hide seeds to eat through the darker months, when the self-assembling solar-powered machines (plants) are receiving too little solar radiation and ambient heat to effectively grow and produce fruit. Many of these critters have common hiding places of under specific rocks, branches, roots, etc - in the ground, where it could seed and grow in the spring. But first the bird or squirrel retrieves it for a meal...unless an owl, fox, or car got to the critter first, in which case the hidden snacks are already in the ground to start growing next spring.
Yes, seeds transport in a great many ways (defecation vacation), but this pattern has struck me for some time as uniquely special - animals planting seeds - and has a symmetry with bees having to brush past plant gentials to get the tasty syrup. Like one organism where the DNA needed to survive is split between lineages in two different biological kingdoms.
12/5/2021 - This is now called "bong science".
"The photon goes through both slits, and because we're not watching very closely, it interferes with itself as it goes through, so it hits the back wall in this pattern of lines. Isn't quantum physics weird, man?"
It's like there are two schools of thought on quantum physics:
- An almost-invisible group that's creating falsifiable theories and performing repeatable experiments
- An extremely loud and incredibly well animated group that clearly explains (skipping over a few unimportant details) this odd and confounding quirk that we cannot understand, and after a Word From Our Sponsor, bring in the experts who mourn how the laws of physics prevent understanding it.
It's Sabine Hossenfelder that's popular among first group lately, and her videos have reignited much of my interest in quantum physics.
The second group are pushing what I'm calling "bong science" - everyone circle around with your cannabis vape pens and get a load of how strange are these quantum particles. Can you believe quarks live in a threesome? In the double-slit experiment, Copenhagen says we aren't able to know which slit the photon chooses to go through, unless we "observe" and then it stops making the cool lines. - taking ideas from different theories like science is a salad bar, Frankensteining a theory which is mostly wrong, a little made up, very entertaining, and entirely useless. But at least it sells those ad clicks!
12/2/2021 - What new democratization of technology will not be foreseen by futurists before it arrives?
Why did no futurist predict the iPhone? Why did nobody foretell the Model T in popular culture?
One oft-noted futuristic prediction is the proto-nuclear submarine in that foundational underwater science fiction classic, 20k Leagues Under The Sea. The powerplant enables indefinite submerged operation, unlike the other alternatives - diesel-electric (with huge batteries that last for days) or steam (which required an overwhelming ship and may have lasted for days). In the 1980s, pressurized air became a supplementary power storage option, adding maybe a day to the diesel-electric option.
Ford's Model T was like the iPhone or PSVR of cars. It democratized the technology and brought it down to a price point where everyone could afford one and rich people could afford 5. This didn't happen for trains because of the difficulty in sharing rails as compared to sharing roadways, where you can just signal and change lanes, and don't need a switched section of roadway to hop to a neighboring lane. (In roads, narrow curbs can still be added between lanes to prevent lane-changing and shape traffic flow around congested areas.) Instead, the "block" system was developed in the 1800s to prevent two trains from using the same section of track, after numerous deadly train collisions in the UK.
12/1/2021 - Site rotation code update.
#It's become a tradition on this blog to start the month with a new iteration of the same old code. Added annotation for steps to be done "remote" (your own laptop etc) vs "server" (the one you're building). Fun fact: The "code" sections below are actually grey (same #ccc as always) and only look red due to the contrast with the "bubble" div.
#Remote
#Step 1: Initializing server variables
#Step 1a: Manual variables - update with your private values:
[string]$DefaultSecurityGroupID = "DEFAULTSG"
[string]$Keypair = "KEYPAIRNAME"
[string]$PemFile = "C:\Secure\Location\$Keypair.pem"
#Step 1b: Dynamic variables - just run these.
$currentServer = (Get-EC2Instance).Instances
[string]$SubnetID = $currentServer.subnetID
$Subnet = get-ec2subnet $SubnetID
[int]$CurrentSecurityGroupName=(Get-EC2SecurityGroup | where {$_.description -match "Created on"}).GroupName
#Prerequisite 1: utility function:
#This function takes bytes as input, and outputs ASCII (or Unicode) characters.
-
Param(
-
[switch]$Unicode
[int]$Unicode2 = 0
$ReturnString = ""
if ($_) {
-
if ($Unicode) {
-
$ReturnString = [System.Text.Encoding]::Unicode.GetString(($_,$Unicode2))
-
$ReturnString = [System.Text.Encoding]::ASCII.GetString($_)
if ($ReturnString -ne "") {
-
return $ReturnString
#Prerequisite 2: Rotate AWS key
#Updating this function with a progress bar to countdown the 30 seconds.
-
$oldKey = (Get-AWSCredential default).GetCredentials().AccessKey
$key = New-IAMAccessKey
Set-AWSCredential -AccessKey $key.AccessKeyId -SecretKey $key.SecretAccessKey -StoreAs default
0..30| %{Write-Progress -Activity "Sleeping for keys to settle down." -Status "Countdown to 30 seconds: $_" -PercentComplete ($_*3.33);sleep 1}
Remove-IAMAccessKey -AccessKeyId $oldKey -Force
#Step 2: New Security Group
#Updating this function with a better name for the SG.
-
[ipaddress]$IpAddress = (((iwr https://checkip.amazonaws.com).content | Flip-BytesToText ) -replace "`n","" -join "")
[string]$IpCidr = ($IpAddress.IPAddressToString+"/32")
[string]$GroupDesc="Created on "+(Get-date -f d)+" - access from "+$IpCidr
New-EC2SecurityGroup -Description $GroupDesc -GroupName ($CurrentSecurityGroupName+1) -VpcId $Subnet.VpcId
$cidrBlocks = New-Object 'collections.generic.list[string]'
$cidrBlocks.add($IpCidr)
$ipPermissions = New-Object Amazon.EC2.Model.IpPermission
$ipPermissions.IpProtocol = "tcp"
$ipPermissions.FromPort = 3389
$ipPermissions.ToPort = 3389
$ipPermissions.IpRanges = $cidrBlocks
Grant-EC2SecurityGroupIngress -GroupName ($CurrentSecurityGroupName+1) -IpPermissions $ipPermissions
#Step 3: Build Windows server
#This step ends in a 5 minute wait for the new server to complete building.
$newSecurityGroupID = New-RdpSecurityGroup
$newServer = (New-EC2Instance -ImageId (Get-EC2ImageByName "WINDOWS_2016_BASE").ImageId -SecurityGroupId $newSecurityGroupID -InstanceType "t2.micro" -AvailabilityZone $AvailabilityZone -KeyName $Keypair -SubnetId $Subnet.SubnetId).instances
0..300| %{Write-Progress -Activity "Sleeping for server $($newServer.instanceid) to complete." -Status "Countdown to 300 seconds: $_" -PercentComplete ($_*.333);sleep 1}
$newServer = (Get-EC2Instance $newServer.instanceid).Instances
#Step 4: Login and configure
#Step 4a: Server login
#This retrieves the password and launches MSTSC (MS-RDP) to the server. Instead of storing the server password, store this command.
mstsc.exe /v:($newServer.publicIPaddress)
#Server
#Step 4b: Client variables - manual
#Again, update these with your own values
[string]$subDomain = "Subdomain"
[string]$CFAuthKey = 'CFAUTHKEYGOESHERETHISONEISLONG'
[string]$CFAuthEmail = 'YourEmail@$rootDomain'
[string]$PFXPass = '$tr0ngPa$$W0rdG03$|-|3r3'
#Step 4c: Client variables - dynamic
#Just run 'em.
[string]$ContactEmail = 'Contact@$rootDomain'
[string]$DownloadPath = "C:\LetsEncryptCerts\$((Get-Date).ToString('yyyyMM'))"
[array]$Computer = ((hostname))
[string]$FriendlyName = ("LetsEncrypt_$((Get-Date).AddDays(90).ToString('yyyy-MM-dd'))")
#Step 4d: Install software
#These install IIS, upgrade .NET's outbound security protocol to TLS 1.2, and install the Posh-ACME module. Posh-ACME is the toolkit that lets us request the LE cert. The TLS upgrade is needed because TLS 1.1 is used for compatibility, but more secure hosts disconnect instead of negotiating.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name Posh-ACME -Force
#Step 5: Request LE Cert
#Step 5a: Information Gathering
#Feel free to copy website code to c:\inetpub\wwwroot before/while running these steps.
$CFParams = @{CFAuthEmail=$CFAuthEmail; CFAuthKey=$CFAuthKey}
$NewCertificate = New-PACertificate $Domains -AcceptTOS -Contact $ContactEmail -DnsPlugin Manual -FriendlyName $FriendlyName -PluginArgs $CFParams -DNSSleep 180 -PfxPass $PFXPass -Force
#Step 5b: Goto your registrar and add the A records for _acme-challenge et al.
#Leave off the domain when adding to the registrar website or console. This process uses manual domain verification, until Google Domains automation can be developed.
#Step 5c: Copy to fileserver
$Path = Get-PACertificate | select -ExpandProperty CertFile
$Path = $Path.Substring(0,$Path.LastIndexOf('\'))
Copy-Item "$Path\cert.cer" $DownloadPath -Force
Copy-Item "$Path\cert.key" $DownloadPath -Force
Copy-Item "$Path\cert.pfx" $DownloadPath -Force
#Step 5d: Import PFXPassword, ComputerList and Thumbprint
$Thumbprint = $NewCertificate.Thumbprint
#Step 5e: Deploy
Import-PfxCertificate -FilePath "C:\cert.pfx" -CertStoreLocation Cert:\LocalMachine\My\ -Exportable:$false -Password $PFXPassword
$Cert = Get-ChildItem Cert:\LocalMachine\My\$Thumbprint
$Cert.FriendlyName = $FriendlyName
#Step 5f: Cleanup
Get-ChildItem Cert:\LocalMachine\My\ | Where-Object {($_.Subject -eq "CN=*.$rootDomain") -and ($_.ThumbPrint -ne $Thumbprint)} | Remove-Item -Force
#Step 6: Bind port 443 to IIS
#Now that we've populated the SSL cert, we can bind applications to port 443.
(Get-WebBinding -Name "Default Web Site" -Port 443 -Protocol "https").AddSslCertificate($Thumbprint, "my")
#Remote
#Step 7: Add hosting access to server
#This lets the public internet reach the server on ports 80 and 443. Updated to lookup the sole instance ID.
#Step 8: Transfer domain in Google Domains
#Move the domain to your new server's public IP. This is a todo.
#Step 9: Cleanup old server and SG.
#Deleting the server will remove the public IP too. Then removing the SG completes cleanup.
Remove-EC2SecurityGroup -GroupId (Get-EC2SecurityGroup -GroupName $CurrentSecurityGroupName).GroupId -Force