Convert Little-endian UTF-16 to ASCII

hacker screen
Photo by Markus Spiske temporausch.com on Pexels.com

I generated some text files working with Get-Acl Powershell, but I did not know how to get Powershell to do some advanced features. (Basically, I wanted to the Select-String to include the next 2 lines and see whether a specific group was in that list. And maybe some exclusions.) So, I copied the files over to my Linux home to check there.

The basic most grep? Nothing.

I used ls -l and confirmed they have data. I used less to confirm I can see it.

I copied a string and did a grep for it. Nothing.

I did a dos2unix. That didn’t fix it. Finally, I did:

file filename.txt

That revealed the files had types of:

  1. Original: Little-endian UTF-16 Unicode text, with CRLF line terminators
  2. dos2unix converted: Little-endian UTF-16 Unicode text

Basically, this told me that the dos2unix fixed one problem but not both. The “with CRLF line terminators” means that Windows and Unix have philosophical differences in how to format text lines.

Little-endian is a geeky homage to Gulliver’s travels. It has to do with which direction one encodes the bits. But, it isn’t really the big problem here. UTF-16 is the problem because apparently, I need it to be UTF-8 for grep to read it. So, the fix is to use an encoding converting:

iconv -f utf-16 -t utf-8 filename.txt > filename_new.txt

Why do we restrict the use of nuclear technology?

The Flynn pushed to share nuclear tech with Saudis story seems like something people are likely to overlook. The story is about:

Lawmakers from both parties have expressed concerns that Saudi Arabia could develop nuclear weapons if the U.S. technology were transferred without proper safeguards.

But, why?

  1. The Middle East turmoil is in part over what kind of Islam will prevail. Iran is controlled by Shi’a sect clerics (Baptist) while Saudi Arabia is controlled by followers of the Sunni (Catholic) sect.
  2. Both countries manipulate others in the region. Much of the fighting in the region is proxy fighting. Yemen has a Saudi-backed government. The opposition forces that almost took over are backed by Iran. Syria has an Iranian-backed government. Some of the opposition forces are backed by the Saudis.
  3. Saudi Arabia wants the potential capability of nuclear weapons because Iran is far ahead of them towards that.
  4. The Atomic Energy Act section 123 stipulates how the US may cooperatively work with other countries to have safeguards to prevent the development of weapons from nuclear reactors.
  5. The United States (and Europe) helped Iran with the start of nuclear reactors in the 70s. See, the Shah was our friend. The conflict has to do with him being overthrown and the clerics taking charge. The current government HATES us.

Sure, the plan is to build nuclear reactors, not weapons, but the normal deal includes safeguards to prevent the development of nuclear weapons from them. This Middle East Marshall Plan is also interesting given the Saudis extract so much oil, but realize these fossil fuels face lowering demand as people switch.

I get it. The Saudis are our allies (like the Shah was). But, the current decision maker, MSM is just as bad as the Shah was. He locks up people for speaking bad about him. A woman publicly drove a car before he was ready to allow women to do so. He had her imprisoned for it, let his sister do it, and still has the first woman locked up years later.

We’ve been here before. We gave nuclear technologies to Israel who exacerbates the Middle East turmoil. Everyone is worried Pakistan and India the clash in Kashmir is going to result in a nuclear exchange. China is still peeved at us giving the tech to Taiwan who it considers its territory. Our choices to help countries have this technology embroils already tense situations. The safeguards are supposed to make it more palatable to the world, so giving it to Saudi Arabia without them is an open provocation.

Dream: Airbender gone wrong

This was one of those being chased dreams. Everyone has superpowers. Mine? If I move too fast in a single direction a glowing, writhing ball of explosives developed in front of me. My superpower was pulling the hydrocarbons out of the air to make an aerosol TNT. But only in front of me. If I timed it just right, then it would develop enough into an explosive and fall to the ground when I changed direction and explode in the face of whatever it was that was chasing me.

Dream: Corporate VP of Junk

I dreamt I was called into a meeting without knowing why I was there. (That is typical.) The meeting was about a company VP being in the hospital with a heart attack so they were going to make me the acting. Which was confusing because I have no idea who that guy was, what was his portfolio, or even how things are done there.

I leave the meeting and learn he sells junk on eBay and Amazon. Literal junk. The company’s other areas hand over broken or unusable objects. We list and sell them and write off the loss.

America’s experiment in democracy

A friend mentioned the above phrase General Mad-Dog Mattis often uses in posting about the death of the badass Cryptologic Technician. This happened on Facebook and it being Facebook, it spurred a troll who completely misunderstood the phrase. He took it to mean the United States attempting nation building.

Here is an example of Mattis’ usage in a paper on the national defense strategy:

“Increasing the lethality of our troops, supported by our defense civilians, requires us to reshape our approach that managing our outstanding talent, reinvigorating our military education and honing civilian workforce expertise.

“The creativity and talent of the department is our deepest wellspring of strength, and one that warrants greater investment.

“And to those who would threaten America’s experiment in democracy, they must know: If you challenge us it will be your longest and your worst day. Work with our diplomats; you don’t want to fight the Department of Defense.”

He is using the phrase to talk about attacking the United States. Not Afghanistan, Iraq, Libya, Syria, or Yemen.

Mattis, having read far more about history, the founding of the US, and Constitutional scholarship uses this phrase to indicate that the democracy we have is pretty fragile. Democracies can fail. The United States has somehow lasted over two centuries as a republic, but it is still possible for our country to fail. We have to protect it. We have to be wise in our choices. Or we might find ourselves beholden to Putin-like totalitarianism. He viewed his job as more than just protecting the country, but as protecting something special in the world that deserves to survive.

And, that is why he had to go. His loyalty was primarily to democracy, not the Commander-in-Chief who demanded personal loyalty.

Read more about how democracies fall into totalitarianism:

ʻOumuamua images and representation

Artists_impression_of_ʻOumuamua
By ESO/M. Kornmesser

I ran across this image of the interstellar asteroid. It struck me that I recognize an artist’s impression as the actual representation of the object. Because we do not have an actual photo, an artist made something. And yet, to me, it IS the asteroid enough that when I see the impression photo, I think it is.

It started to bother me that my brain has become so tricked, but I think I am about to get over it. We do this all the time. When I think of a very generic term like cat, my current cat comes to mind. Even if I go for an animal I have never seen before in person, then I think of an image of one or something similar. Being visual creatures, images are how we think, so we need something like an impression to recognize it.

New Blog Project

In sharing stuff on Twitter and Facebook, I feel like I could be writing more instead of just sharing a quote. That is where the blog comes in, but I also feel like RRRv4 is all over the place. So, I started a new one: Polymath Parent.

Some self-imposed rules:

  1. Semi-anonymous: I’m not going to use names on it. No photos.
    • It’s not anonymous because I am still using the WP Jetpack sharing options to put them on my public Facebook page. I’m not anonymous, but anyone stumbling across it from WP might not know how to find them.
  2. Mainly going to talk about science, observations, and tie together what I am reading about parenting applies to the kids.

Maybe I will keep it up. If not, then I can always eventually roll them back up into this one.

Also, maybe it will encourage me to blog more here too.

Brainstorming Ebola under America First

Saw a story that got me wondering what the reaction would be under the current president if the test had come back positive.

An unidentified patient who was kept in isolation at a Philadelphia hospital while being tested for Ebola has been confirmed as not infected with the deadly virus.

  1. Thoughts and prayers? That seems to be the go-to for so many things like massacres at home and abroad.
  2. Deny travelers to Ebola prone countries the ability to fly to the US until they have self-quarantines elsewhere for the contagious period, thereby spreading it around the world?

The Obama administration’s Ebola response was to send 3,000 health officials to the region who:

  1. Constructed treatment units in the region.
  2. Provided protective equipment and medical supplies.
  3. Operated almost 200 burial teams.
  4. Conducted aggressive contact tracing to locate other potentially infected cases.
  5. Trained health care workers and conducted community outreach.
  6. Identified travelers who may have Ebola before they left the region.

I suspect health officials would lobby for the same response with the rationale, the faster we end the outbreak there, the fewer infected individuals overall and less like they end up in the US: America First! But, this is the region the current president referred to as “shithole countries.” My guess is this is just the excuse needed to bar travel to or from there.