Tag Archives: windows

TMUX: A Command Line Must!

When I started with Unix, it was during my college days on a VT-100 terminal, with text command lines. There was even an online chat window using text (remember “talk”?). When a GUI was introduced using X Windows on Sun Microsystem Solaris machines, the experience was so different and it was considered to improve productivity because we get to multitask. However, old habits die hard, so even with a GUI, I would have dedicated X-Term windows for command line stuff. I would run “screen” (aka “Gnu Screen”) to have multiple (and switchable) windows within X-Term.

The advantages of using screen are:

  1. When my SSH connection is broken, the command line sessions are still working. Useful when running shell scripts that take a long time to complete.
  2. Having a shell with command line history, I could review the previous executions, in case I forgot to document something.
  3. Instead of using the mouse to click on a different window, I use the keyboard shortcut Ctrl-A and the number keys, to switch between screens. Way quicker.

With the introduction of Red Hat Enterprise Linux 8, I was introduced (read: forced) to use a new screen replacement called TMUX. Apparently, it’s not a new util but it’s way more powerful – and useful. After using it for a while, I saw these advantages:

  1. Having a vendor managed Firewall, I didn’t have a choice for connection keep-alives. My SSH connections will drop after inactivity. With TMUX, there’s a clock display that forces the connection to send data once a minute. Thus keeping the connection alive – indefinitely. No more dropped connections and reconnecting effort.
  2. Being able to run screen within TMUX window is pretty nifty. I have another layer of switchable window, which is really handy when I have multiple servers representing the different layers for a site (ie. web, JBOSS, database, etc.) This is possible because TMUX’s key bindings for switching window is configurable and by default it’s different than screen’s.
  3. TMUX has window panes, for dashboard like monitoring. Plus, it looks awesome!
My tmux screen with split panes (For demo only. I usually like to see one window at a time)

Most of the Red Hat Enterprise Linux I’m working with is version 6.x, TMUX is not included as part of RHN repository. Thus, I had to build it from source. These are the steps to do it:

  1. Download, compile, and install the latest libevent and ncurses.
  2. Download TMUX and compile using the following configure flags (note, I installed on local home directory):
    CFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-L$HOME/local/lib -L$HOME/local/include/ncurses -L$HOME/local/include" CPPFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses"

If there’s a doubt that command line is important to a sysadmin’s daily work, Microsoft Developers are proud to present an expanded version of Windows OS command prompt. The video below has the full highlights and it looks great!

Windows Terminal: Building a better command line experience for developers

There’s even a trailer that rivals an iPhone launch commercial!

The new Windows Terminal: Trailer

I’m excited that Operating System vendors are now providing more robust terminal tools, making command line a much better experience for all of IT folks!

Converting UTF-16 to ASCII Format Text Files

For those dealing with Windows applications, sometimes the app writes logs with UTF-16 character encoding.  This is the case with Titan-FTP (commercial) software that writes the logs in that format.  Using cygwin or Linux grep command to search through the file will not return any result!  When using vi to examine the file, the escape characters doesn’t show up. The dos2unix command will not strip them, neither.

Fortunately, there is an easy way out. The utility iconv will help convert the file to make it searchable (read: Useful) again.

iconv -c -f utf-16 -t ascii file.log > newfile.log


Still Unknown PC’s Future

Can the PC Business Survive?The business of selling Windows based laptops and desktops are at a critical point. The industry is still suffering from profit loss, notably with the most recently high profile exit of the PC business by Sony. Previously, many experts believed the PC business could have been saved by Windows 8 ((Even the release of Windows 8.1 failed to change people’s perceptions)). Unfortunately, the result was (and still is) much less than anticipated.

Is there still a future in the PC business? Most insiders will say they’re cautiously optimistic. After several years of lost revenues due to falling prices and lack of consumer demand, the industry is beginning to cut its losses. Several promised innovations, such as integrating the computer with TV, did not pan out. The PC itself sees no significant improvement in the technology, other than the usual CPU and OS upgrades. Laptops are starting to become more like a tablet, such as a “convertible tablet“, but the cost and usability are questionable when compared to the sleek and highly marketable Apple iPad.

A glimmer of hope is in the cloud services. With the rising demand of highly portable and cheaper devices, such as tablets and Chromebooks, the direction is to provide products on the lower end of the PC units.  But, there is a big dependency on the ubiquity of wireless infrastructure, such as Wi-Fi or 4G/LTE. Then there are the security concerns over possible data leaks and hijacking. The balancing act is still being performed.

The PC industry’s downward spiral may also be contributed to the dependance of corporate and government mass purchases. In the past, they were always reliable sources of revenue, much more than consumers. However, in this tough economy, with rising cost on both private and public sectors, those revenue streams have dried up. No one expects high volume sales to increase the bottom line, any more.

So where’s the industry going? Like any good business, it has to stay on course: Continue to innovate and cut cost.  It needs to weather storm. The free market will sort itself out and consumers will pick the best from the lot. Perhaps to be in the last few to remain standing will be the winner in this highly competitive business.