How to Install GCC 7 on CentOS 7

February 14th, 2018

Interested in keeping up with the latest C++ standard, I noticed that CentOS 7.4.1708 uses gcc version 4.8.5 20150623. This version of gcc defaults to ISO/IEC 14882:1998. Updated C++ standards have been released in 2003, 2011, 2014, and 2017. Although gcc developers are still implementing the 2017 standard, it is good to use a recent version of gcc that defaults to the 2014 standard. Installing centos-release-scl and devtoolset-7-gcc-c++ packages allows me to use a recent version of gcc.

To determine the default C++ standard used by g++:

1. $ g++ -dM -E -x c++ /dev/null | \
   grep -F __cplusplus

I did the following to install devtoolset-7:

1. # yum install centos-release-scl
2. # yum install devtoolset-7-gcc-c++

Every time I want gcc to default to using GCC 7, I run the following:

1. $ scl enable devtoolset-7 bash

Hello, Responsive Web Design

February 11th, 2018

This blog’s customized WordPress theme is finally updated with responsive web design elements. Reading a tutorial at w3schools.com, Responsive Web Design Introduction, encouraged me to implement responsive web design this week. The introduction is concise and actionable for someone with previous experience using HTML and CSS. Seeing their simple implementation using HTML div tags and CSS media queries to implement a responsive web page gave me the needed confidence to start updating this blog.

My customized theme is based on Michael Heilemann’s Kubrick. I wanted to adopt responsive web design techniques to allow this blog to be mobile-friendly or presented naturally by web browsers running on mobile phones or tablet devices. I also wanted to keep many of Kubrick’s design elements, such as the centered column for content and sidebar with a blue header containing the blog title and footer containing centered statistics, when the page is viewed from desktop browsers. According to Heilemann, Kubrick “may be the most widely used template ever designed, having been in used [sic] by millions of sites and ported to over thirty completely different platforms.” I desired maintaining such a recognizable theme for my blog. Implementing responsive web design techniques was a great exercise in adapting and reusing this site’s design.

The Intelligent Investor

August 31st, 2017

Picture of book cover for The Intelligent Investor by Benjamin GrahamBenjamin Graham’s The Intelligent Investor motivated changes to my personal investment operation. My copy of the book was published around 2006 and contains Jason Zweig’s commentary relating Graham’s observations about the stock market to the then recent dot-com crash. Having had some exposure to the dot-com crash and being an active participant in securities markets through the Great Recession up until today, I see in current market conditions parallels with those Graham and Zweig observed. Seeing these parallels pushed me to adjust my portfolio.

In a small section of his book, Graham discusses a company named Ling-Temco-Vought, Inc. The company grew through acquisitions funded by debt. Its market value increased as its size increased. With the increased market value, the company was able to borrow even more. In 1969, its long term debt was ten times earnings before interest and taxes (EBIT), and its interest charges were 98% of EBIT. This arrangement left very little gain for common stockholders. Market participants later realized this and adjusted the company’s market value accordingly.

I found a similar holding in my portfolio: Valeant Pharmaceuticals International, Inc. (VRX). Like Ling-Temco-Vought, VRX grew through acquisitions funded by debt. At the end of 2015, VRX had an EBIT of $1.4B and interest expense of $1.6B. Recognizing their struggle with debt, VRX has been focusing lately on divesting their acquisitions. Reading about Ling-Temco-Vought and seeing a parallel with VRX motivated me to immediately remove VRX from my portfolio.

In another gem found in his book, Graham also notes that a great number of initial public offerings (IPOs) are made at bull market peaks. This is a time when the market has a high demand for new offerings. He observes that IPOs during bull market peaks are of inferior quality, and he questions whether the investment bankers should be frowned upon for bringing securities of questionable value into the market.

There recently have been a flurry of IPOs as the S&P500 hovers at all-time highs. I was interested in IPOs by Blue Apron (APRN) and Snap (SNAP) before thoroughly reading Graham’s book. According to Snap’s Form S-1 registration statement, Snap has “incurred operating losses in the past, expects to incur operating losses in the future, and may never achieve or maintain profitability.” On its second day of trading, Snap peaked at $29.44 per share and a market valuation of $35.3B. The frenzied market valued Snap, a company that has never achieved profitability, above consistently growing market stalwarts. Since its peak about six months ago, Snap has declined to around $14.96 per share. Benjamin Graham kept me away from IPOs and prevented me from experiencing catastrophic losses.

Thanks to Benjamin Graham, I look forward to finding securities with good value underappreciated by the market. I hope to preserve capital while gaining a satisfactory, not exceptional, return on my investment.

Aiming Higher

May 7th, 2015

Many people interpret the phrase, “aiming higher,” as setting goals that are 110% of what is desired. A trivial example of this interpretation’s absurdity is setting the goal to fit one gallon of water into a cup. Aiming for an unattainable goal is aiming for failure. The trivial example shows it also wastes resources.

“Aiming higher” is better interpreted as setting higher level goals. We set goals at different levels everyday. Figuratively, the goals at 0ft determine what should be done right now while those at 35,000ft determine what should be done over a lifetime.

There is a popular anecdote in which of three workers, each performing the same task, a traveler asks, “What are you doing?” One reports he is cutting stone, the other is earning food for his family, and the last is building a cathedral.

It is easy to become too focused on goals for the day, week, or quarter. We should frequently refocus our goals for career, relationships, and life. We should reflect on why we are doing what we do. Through such reflection, we can properly aim higher, achieve, and succeed.

Installed Lubuntu 13.10 on Mini 9

January 11th, 2014
Posted in Linux / Unix | 1 Comment

I recently installed Lubuntu 13.10 to continue running updated versions of Ubuntu on my Dell Inspiron Mini 9. My Mini 9 was delivered with Hardy Heron (Ubuntu 8.04 LTS), and it will bother me to have installed a different flavor of Linux.

The procedure that I describe requires an existing Ubuntu installation and wired ethernet connection for the Mini 9.

I was unable to install current versions of Ubuntu, because of my netbook’s restricted amount of disk space. With the “Lubuntu Minimal Installation” option, I have no swap partition, a 128MB boot partition and an encrypted root partition with 1.8GB used space and 1.6GB free space after installation.

To ease updating, I downloaded the linux and initrd.gz netboot installer binaries and copied them to /boot/13_10. After rebooting, I entered the following into the Grub command line:

grub> root=(hd0,msdos1)
grub> linux /13_10/linux
grub> initrd /13_10/initrd.gz
grub> boot

There were complications with configuring the wireless adapter. The wireless adapter drivers are not installed automatically, and my wireless access point has a hidden SSID.

The wireless adapter drivers were installed with:

sudo apt-get install \
  b43-fwcutter \
  firmware-b43-installer \
  wpagui

The /etc/network/interfaces file was updated to:

auto lo
iface lo inet loopback

#auto eth0
iface eth0 inet dhcp

iface wlan0 inet manual
  wpa-roam /etc/wpa_supplicant.conf

A /etc/wpa_supplicant.conf file was created with:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=0
filter_ssids=0

network={
  ssid="MyHiddenSSID"
  scan_ssid=1
  psk="MyPassphrase"
  key_mgmt=WPA-PSK
}

network={
  key_mgmt=NONE
  disabled=0
}

After the above is performed, the computer is rebooted and the wired ethernet cable is removed. The wireless connection is enabled with the following:

ifup wlan0
dhclient wlan0

wpa_gui can be used for a graphical interface to the wpa_supplicant. Changes to wpa_supplicant.conf by wpa_gui is prevented by the update_config flag being set to 0. This is preferred to prevent losing my network’s configuration and polluting the network configuration file with several networks.

I installed Firefox. Now, the Mini 9 is running great!