Bringing a Taste of Linux to Windows

For a good part of my life, I was a Linux zealot. I preached it like I was preaching a religion. I felt superior to others because I could handle something so daunting and intimidating. I realized that most of my day was spent configuring the operating system rather than actually getting work done. As my responsibilities in life grew and my career as well, I didn’t have time anymore to deal with all the shenanigans and challenges that this operating system brought to my life.

Eventually, I got disillusioned with Linux and was tired of wrestling with it because the new update just borked my GPU drivers once again being presented with a black screen when booting up my system. I had to sift through documentation and wikis for hours to find out a solution and since I only owned one system, I had to relegate myself to my phone’s tiny screen. I was done. I made some backups and wiped everything out for a Windows 10 install.

Linux has spoiled me quite a bit and I got used to some its applications, features and quirks. Moving to Windows created some gaps in my workflow that I felt slowing and holding me down. Going back to Redmond’s offering has forced me to search extensively for software that would fill in these holes requiring quite some experimentation.

(Keep in mind the Headings can be clicked to go to the application’s website)

Windows Subsystem for Linux

The confusing name for WSL made it hard to understand what this feature was for the one who was uninitiated. However, Linux started to become an infatuation at Redmond and they became to embrace it starting with Azure. Windows 10 brought the surprise that I would be finally able to run my favourite Linux tools without needing a virtual machine and complex setup of shared folders. It was light and fast. Basically, WSL is Wine backwards: it runs Linux ELF binaries translating the Linux API calls into equivalent Windows NT ones.

All the beautiful Unix commands were finally available to prune through files easily, automate tasks and of course use magical tools to deal with obscure situations. You could even pick what distro WSL would run. I just picked Ubuntu because it provided a polished bash experience alongside a great package manager APT for pulling in your favourite packages and building your arsenal.

Shortly after, I customized it a bit by installing ZSH and doing various tweaks to make it just perfect for me. However, the built-in Windows terminal emulator left a lot to be desired and have a good solution:

ConEmu

I have no memory of how I discovered this tool however it was quite the revelation. It rendered the colours and symbols that Linux command line tools used. You could choose to start the shell you wanted even in administrator mode. The great Quake-style dropdown was available. And of course, a nice tiling functionality reminding you of your good old days in awesome tiling window managers. Tabs were not left out either.

You can even have ConEmu be part of your context menu so you can launch it straight from explorer.

Admittedly, the keyboard shortcuts are clunky and quite the mess, thus making them harder to remember. There’s so much to customize like colour themes, fonts and way more, but the settings window is a bit hard to decipher and quite difficult to navigate. I guess that’s the price you pay for all that customizability.

AutoHotkey

Linux’s probably most powerful feature is scripting. There are so many command line tools and APIs that you could create the most sophisticated scripts that did exactly what you wanted. Want to download a YouTube video on your hard drive? You’re covered. Need to rearrange displays when plugging in your dock? You got it. What about starting a bunch of applications per workflow? You’re set.

This is where AutoHotkey comes in, bringing the ability to automatic tasks via a huge swath of commands available at your disposal. Whether you want to move your pointer to the center of the screen or have a keyboard command bring up your note taking application. It’s all possible

Just like when scripting in Linux using bash or python, there’s quite a steep learning curve to get a hold of the power of this beast. Thankfully, the official documentation is excellent and like always, there are forums and stackoverflow to save you.

I personally use AutoHotkey to switch between applications and start the terminal. I don’t have ideas yet on what else I can do, but I don’t doubt that this scripting language will allow me to do whatever I need to suit my workflow.

Divvy

In my opinion, the biggest showpiece that Linux has was tiling window mangers. It was a whole paradigm shift from floating windows to making them well organized and neatly stacked. My favourite WM was definitely i3 because of it’s ease of use and intuitive way of tiling windows. It was well tested and easy to configure as well.

When I left Linux land, I had to content with a disorganized mess of floating windows again. There was some honorable attempts (such as b3 and bug.n) at porting them to Windows but they were clunky and often didn’t work seamlessly. The truth is, the APIs on Windows for manipulating windows is quite complicated and often generated inconsistent results. The poor developers had to content themselves with these trying to shoehorn the power of tiling managers into an operating system that just couldn’t accept it and clearly wasn’t made for it.

In comes Divvy, a piece of software a friend introduced to me many years ago. Although it didn’t automatically tile the windows for you, you were able to organize your windows into tiles by selecting the area of the screen you wanted to fill. It’s very intuitive and quite customizable such as adjusting the size of the tiles and their count. You can even have gaps between the tiles. A featured so loved by /r/unixporn users who ran a modified version of i3 called i3-gaps.

Now, my desktop can be organized but unfortunately, I have to do it manually. It’s not bug free either sometimes windows not being moved or resized properly.

Groupy

A feature that I fell in love with was provided by the lightweight window manager Fluxbox. You could merge multiple windows into a single title bar being able to switch them just like you would switch tabs in a web browser. This really helped with the mess experienced by floating window managers and provided more comfort.

I knew Stardock for it’s amazing customization tools bring powerful features to the Windows Desktop. I often kept an eye on their new releases and played around with what they had.

Groupy is one of their more recent creations. It allows Windows to be groups in tabs cleaning up your desktop quite a bit. You chose how you organized your windows whether it was by application type or easy workflow switching.

Unlike many of the other available solutions, Groupy looks clean and professional with a bit of configurability such minor appearance tweaks and keyboard shortcuts. It’s very intuitive: you simply drag a title bar of one window to another and that’s it. You have merged two windows into a tab.

Conclusion

These were a sampling of applications that brought creature comforts of Linux into Windows. I still think that Linux is awesome and use it extensively in VMWare for web servers and deploying software for those I work with. Every year is the year of the Linux Desktop but I don’t think we’ll ever get there. At this point, in terms of the general public, Windows and macOS own 100% of the desktop market share.

One plug and shout-out to AlternativeTo that helped me find equivalent applications for both Linux and Windows.

Please share your ideas on this topic in the comment sections below. Are you still a Linux user who managed to make a living out of it and comfortable with the OS? Or have you moved to another OS?

How to fix a Linux computer according to the Oatmeal

The Sad Demise of Propulsion Controlled Aircraft

Sioux City Crash

In July 1989, a DC-10 chartered by United Airlines, Flight 232, crash-landed in Sioux City after a disastrous loss of all hydraulics rendering the plane uncontrollable. One-hundred and twelve souls lost their lives in that accident considered one of the worst air disasters in US history. The hydraulic fluid, which actuates the flight controls based on pilot input, leaked out after an uncontained failure of the tail engine severing the lines.

The hopeless last moments of United Airlines Flight 232

One off-duty training captain, joined the cockpit after hearing the explosion from the back. Through experimentation, he discovered that by manipulating the throttle controls, he could control the plane slightly and attempt a safe landing. While everything seemed under control, at the last seconds before impact at Sioux Gateway Airport, the plane banked hard and flipped over and burst into flames.

The terrifying final moments of JAL123 recorded on CVR.

Japan Airlines 123 Disaster

Four years before, in August 1985, Japan Airlines 123, was the subject of the world’s worst single aircraft disaster in aviation. An improper repair of the rear bulkhead caused it to rupture after several cabin pressurization cycles over hundreds of flights and slowly tore the rear tailfin. All the hydraulic pipes ran through the tail and their breakage caused again, all the hydraulic fluid to leak leading to the subsequent loss of all flight controls.

Again, the pilots followed the technique of the Sioux City flight. They wanted to fly back to Haneda airport but despite all the heroic efforts to control the plane for an incredible 30 minutes, fate was against them and they crashed into the mountains near Mount Fuji. As the single worst aircraft crash in history, 505 people lost their lives.

DHL Takedown

It seemed at this point that the aviation industry still didn’t learn their lessons after two similar crashes. Years later, in 2003, a DHL Airbus A300 cargo took off from Baghdad, Iraq towards Bahrain and shortly got hit from by a man-portable surface-to-air missile from Fedayeen terrorist group. It struck the left wing causing damage to it and subsequent fuel leak. The hydraulic lines ran through the damaged wing and all three leaked and failed. Again, the pilots lost all flight controls.

Captain Éric Gennote was forced to improvise again using the same technique as in the previous incidents. He managed to turn back to the airport but had to make two approaches because the first final was too close. As an incredible feat of flying, they managed to land the plane safely with a damaged wing, leaking fuel and no flight controls though they went off the runway. It was the first instance of a plane crippled by lost hydraulics managing to land safely at an airport without injury.

Other Incidents of Flight Control Failure

Many more incidents occurred over aviation history counting over a dozen. Wikipedia lists a comprehensive compilation of these types of incidents.

Throttle Only Control

All the pilots in the flights above learned that by controlling the throttles they could slightly control the plane with throttle commands alone. To climb, more power would be needed to increase the speed of the plane thus increasing lift. To descend, the opposite would be done dropping lift. Turning was done through asymmetric adjustment of the throttles while the engine with more power would cause the plane to lift from that side to turn in that direction.

However, despite the effectiveness of said technique, the flight paths tended to be erratic with constant pitching movements would cause a phugoid cycle. The plane would climb until it lost enough speed and pitch down and lose altitude. During the descent, the plane would gather up speed until it started climbing again. This rollercoaster ride made it hard to stabilize the aircraft and be the cause of quite the terrifying maneuvers.  

An amazing demonstration of a flight control-free landing in a simulator.

PSX Simulation

The developer of Aerowinx PSX, a Boeing 747 flight simulator, has created an excellent demo where they manage to control an aircraft with only throttle commands. As seen in the video on the side, we can see the first landing attempt to be aborted (go-around) only to return back for another approach and make a successful landing. While this is only a simulation, it shows that it is possible to control an aircraft without flight surfaces and only throttle control instead.

PCA Tests

Little did these pilots know, there was already software in development that would save the plane in cases like these. In 1993, NASA with the cooperation of McDonnell-Douglas, managed to create a system that would control and land the aircraft safely without any flight controls. It was dubbed Propulsion Controlled Aircraft (or PCA). The principle was similar to what the pilots in the mentioned incidents above attempted to do (by moving the throttles up and down) but done so systematically and automatically. However, since the system was run by software, it could be more precise and generate a more stable flight.

It was first implemented on an F-15 tested in the Dryden Facility and was demonstrated to safely land the plane that looked exactly like a normal landing. The increased stability was dramatic and the increase in control would be impossible to replicate by even the most skilled of pilots. They also tested the system on a passenger MD-11 aircraft with similar results. The MD-11 has its third tail engine set at idle to mimic the more common two-engine configuration found on most aircraft.

NASA’s demonstration of PCA

The system works through the autopilot with the pilots setting the heading, altitude and vertical speed that they desire and instead of manipulating the trim and flight controls, it would send the commands to the engines. No new sensors would need to be installed simply relying on the already existing ones.

PCA had an excellent success rate and landings were not only survivable but looked a lot like a normal landing. In fact, with PCA, I believe that none of the above accidents would have ever happened ending up being but a short NTSB report.

FAA Rejection

To me, the system seemed like a really trivial installation and with the software already developed, not very costly. However, the future of the technology was looking bleak. From Bill Burcham’s rough sketch to a prototype fully developed along with engineer Tom Wolf at NASA, lead to a system that seemed integral to future aircraft. However, that did not happen.

The FAA which oversaw the project concluded that it wasn’t financially worthwhile to implement such system. Their reasoning was that complete hydraulic loss was so rare, 1 in 100 million, that it wasn’t worth installing PCA onto the aircraft of the future. Enthusiasts of the technology such as Dave Hayes, from the Airline Pilots Association, and Dennis Fitch, one of the captains who survived the Sioux City crash, were thoroughly disappointed when this technology was thrown out.

Conclusion

No matter how rare that such incident apparently is, it’s happened so many times in aviation history. We can’t say it’s unlikely anymore. The 632 people who died from said failures certainly agree. Aviation is known to be the pinnacle of safety but recent times have shown that manufacturers have chosen a culture of profits and the consequences might cause even more incidents. Isn’t it enough that I mention the MCAS on the Boeing 737 MAX that resulted in the destruction of two aircraft and hundreds of deaths?


The above flights have been dramatized by the excellent Mayday documentary series:

New domains to access my website...

I’ll have to admit that https://cdahmedeh.net can be a bit overwhelming to remember sometimes even though it’s the official URL of the website. Most people try to pronounce the full URL but it’s often incorrectly pronounced and it’s hard to remember. The reasoning behind my URL is that it is my username for almost everything.

Two new domains have been introduced that just include my name which will redirect you to this website.

ahmedelhajjar.com

ahmed.place

Hopefully, these are easier to remember and makes reaching my website more accessible.

NES Musical Masterpieces

This article requires some knowledge of oscillation for producing sound. I’ll also confess that determining what chiptune sounds good requires an appreciation for them.

In my opinion, the Nintendo Entertainment System is the first video game console to feature games that have gameplay that still holds up to today. People still play NES for their playbility rather than solely their nostalgia factor. Older consoles like the Atari 2600 featured very simplistic games that gamers only play today for nostalgic reasons. Those who didn’t grow up with the Atari console don’t find any meaning in them.

I’m not sure if I mentioned this before on my blog, but I have an incredibly soft spot for chiptunes. There’s a charm to pushing these chips that can only make simple sounds to their limits to create a beautiful piece of music. I enjoy melodic music and what other than video games have solid and consistent melodies? There are some composers that I consider magicians because they make songs so deep that you’d put it in a club.

The NES APU, the sound chip in the NES, is what generates the simple tones to create music and sound through the console. Quality was lukewarm with the original Famicom and NES that outputed sound and video through a single coaxial cable. Eventually, a composite output was added providing a purer sound, though it was mono only despite many artists writing stereophonic music. Certain enthusiasts build mods to extract both channels.

There was five channels on the APU. Two pulse-wave (square) channels with four pulse-width settings in addition to a triangle channel. A random noise generator. Finally, a PCM for playing samples, although low-quality due to memory limitations.

I’ll give a basic explanation of how most games used these channels though some artists were more creative with their use. The two pulse channels supported the main melody, one was the main one and the other supported it (say with a slightly different pitch). The triangle channel was used to add bass. Finally, the noise channel was used for percussion.

Additional sound chips were used in cartridges that added extra channels or FM synthesis. I will talk about a few of these later but won’t cover all of them since there’s quite a few. I’ll go through some games that use them. Unfortunately, the sound chips could only be used on the Japanese Famicom since the NES didn’t have the sound passthrough through the cartridge slot. American ports of these games had to make shift with use of the available 5 channels and often the game sounded more muddled in comparison to their Japanese counterparts.

I want to take a dive into a few a games that have music that I consider ‘masterpieces’. There’s no real criteria other than my subjective tastes. Many won’t agree with me but I’m sure it will be appreciated by those who love ‘old things’. I hope you enjoy a few tunes and the order is set by my preference.

Super Mario Bros.

The overworld theme in Super Mario Brothers isn’t something I would consider a masterpiece. However, it’s such a classic that I felt that I had to include it here. There’s not much to comment about, it uses channels in the same way that most games do. Virtually everyone has heard some version of this song and I would consider it the prime example of chiptune.

Super Mario Bros. (World) (HVC-SM)_001.png
Super Mario Bros. (World) (HVC-SM)_003.png

Some noticed that parts of the music would be interrupted while jumping. It’s because all five channels were used for the music and nothing was left for sound. The sound effect would take place of one of the square wave channels so that it could play.

Mega Man 2

I would best describe Mega Man 2’s music as the ‘traditional’ sound of the NES. No special techniques are used for production, no intense melodies; just music that perfectly fits the atmosphere and theme of the level or the situation.

Mega Man 2 (USA)_001.png
Mega Man 2 (USA)_004.png

The boss of the stage, Quick Man, uses electricity as his weapon therefore the music has an electric sound to it. The music also plays at a faster tempo because of Quick Man was quicker than other bosses in the battle.

Mega Man 2 is an excellent example that simple music can still sound pleasant without the input of a master who knows every limitation of the chip and instead used it traditionally. Mega Man 2 uses the typical channel setup that was mentioned above for producing melody and beat.

One interesting fact about the composer’s goal was to create very simple melodies only composed of a few notes. The idea was to make catchy songs that were almost as simple as a pop song with a similar structure.

Silver Surfer

Tim Follin is probably the composer with the worst luck. He pushed soundchips to their limits making some amazing pieces except there was one caveat, the games he was contracted for were absolutely terrible.

Silver Surfer was torn apart more than a decade ago by The Angry Video Game Nerd. It sent him into a fit of endless cursing and swearing. However, he oddly didn’t comment on the amazing music in the game. Maybe he was too distracted by the awful gameplay.

The insanely fast paced music almost sounded something that would come out of the SID Chip on the Commodore 64. It was demoscene quality to be honest. He even managed to produce a convincing electric guitar sound.

Silver Surfer (USA)_001.png
Silver Surfer (USA)_002.png

The kick sound isn’t created with the usual DPCM sample like done in most games. Instead the triangle channel is with a pitch change is used to create a quick thump. He uses the same channel for the kick but what really showed that Tim Follin was a master at his art is that the two never played at the same time. It required quite a bit of creative production to never have them clash.

I really want to highlight how bad his luck is. Imagine being the composer for a Pictionary game, I’m sure you’d write something atmospheric and melow. Instead, Follin decided to compose something that would fit an Action-Adventure game where you’d be saving the galaxy from mutant aliens.

This is unusually intense for a board game but perhaps this was to make up for the boring nature of the game. I wonder what kind of music we’d end up with if he was composing for Chess Master.

Admittedly, Tim Follin confesses that he often didn’t compose music to follow the theme of the game but rather see what he could do with the limitations of the sound chip. That might explain the situation with Pictionary.

Pictionary - The Game of Video Quick Draw (USA)_001.png
Pictionary - The Game of Video Quick Draw (USA)_002.png

Journey to Silius

If any game completely broke the rules on the traditional method of using channels, it’s Journey to Silius. The artists did an amazing job of creating something that sounded so much fuller than the average NES game. The bass was stronger, the melodies more engaging and a beat that sounded completely different.

The two pulse channels were still used for the melody but instead of using the noise channel for the drums only, they combined the noise and triangle channels to create a very realistic sounding drum. This was because attack was done with the noise channel and decay using the triangle channel. However, the stroke of genius was using the traditionally unused DPCM sample channel for the bass. The samples used for the bass are pretty high quality and provide for that deep sound we crave when listening to music.

Journey to Silius (USA)_005.png

Castlevania 3

The music between the American and Japanese Castlevania sound completely different. This is due to the use of a chip VRC6 which adds two square wave channels (pulse) and one sawtooth channel. It’s not secret that having additional channels creates for a deeper sound and this is definitely the case for Akumajou Densetsu. There’s not much to comment other than to listen.

Akumajou Densetsu (Japan) (Virtual Console)_002.png

It’s quite obvious that the American version sounds much more dull. The artists didn’t really use any creative techniques to make up for the missing VRC6 chip. Instead, they used the typical arrangement using channels to generate beat and melody. It’s a bit disappointing.

Lagrange Point

Lagrange Point doesn’t sound like any NES game in existence. Rather than primitive sounds, we hear a pleasant and smooth track being played. This is due to the use of a special chip, the VRC7, which adds 6 channels of FM Synthesis. The sound produced ends up reaching 16-bit territory.

I won’t go into detail of what FM Synthesis is because I’m leaving that for another blog post. However, it can be noted that the VRC7 is used exclusively for the music while all other sounds effects are still done with the NES APU. The contrast between the two sounds is a bit jarring in my opinion and generates a disjumbled mess of 8-bit and 16-bit sound. I have to admit it’s quite strange to see 8-bit graphics with 16-bit sound, it doesn’t feel right.

Lagrange Point (Japan)_001.png

Gimmick!

Gimmick! (Japan)_002.png

This company is playing its magic tricks again. If anyone could make the 8-bit NES sound and look 16-bit, it would be Sunsoft. Wikipedia lists some of the amazing techniques to generate such beautiful graphics using mostly graphics tiling optimizations.

My favourite track is an unused one, Strange Memories of Death. It has all the elements of a good song, catchiness, good production, a rich sound and oddly a dark undertone which flows really smoothly.

Gimmick was the only game to use the Sunsoft FME-7 chip which contained the Sunsoft 5B. It contained extra channels which the game used mostly to produce more bass (similar to Journey to Silius). Interestingly, the game didn’t make use of all the channels of the chip neither were all the features such as noise. It’s also the only game that uses the chip.

I put Gimmick! last on this list because it’s my favourite soundtrack on the NES. It spans multiple genres and sounds like a mix of different video game music styles. Apparently, this is what the artist intended. It has a rich deep sound unparalleled by any other NES game and I bet the bass would sound nice on a decent set of speakers or headphones.

Conclusion

This was just a small sampler of some of the good music that is on the NES. I haven’t played that many NES games and had to find other ways to discover interesting music. There’s a lot to listen to on grad1u52’s YouTube channel though unfortunately they add a reverb effect to the music which puts it further away from the original.

Chiptunes are an acquired taste for most people who are used to pop but I consider those to be simple music as well. I have shared with peers these songs and they have found them interesting but it didn’t light them up. It was just something that sounded different to them.

My next writing adventure will be about FM Synthesis which is my favourite way of generating sound. Most focus will be on the Yamaha YM2612 in the Sega Genesis and perhaps the OPL2 from the AdLib PC sound card.

If you have your favourites on the console, feel free to share them. Other kinds of chiptunes are welcome in the comments section below.

Ottawa Computing Group

I’ve just founded a meetup group in Ottawa, ON for programmers and hackers to work together or alone on whatever projects they’re endavouring in.

From the meetup description:

“Writing the next hot Android App or making a mundane Web App? Bring your laptop and hack away at your next computing project. Everything is welcome whether is traditional software development or administrating your personal website server. If you can do it on a laptop, than you're welcome to join.

You can both hide in your corner quietly typing away or sit in a group with your portable rigs on table and discuss your next big computing adventure.

This group has no focus on the type of technology being worked on, whether it's a basic web project or artificial intelligence or machine learning. Bring your ideas with you and share them with the group.

Non-hackers are welcome to join if they want to be thought how to code, we're all open for learning opportunities. Just ask anyone if they're willing to teach you new skills. If you're stuck on some tricky part of your project, ask your peers for help.

We will be meeting weekly in various coffee shops in the downtown area. If we get big enough, we can have groups in the suburbias of Ottawa.

Feel free to be late to the party or come in a bit earlier. Leave whenever you're tired at staring at your screen or have a more important date coming up.”

Hoping to meet you exciting people and see projects beyond my comfort zone!