Archive for the ‘Linux’ Category

Nginx, Varnish, PHP5-FPM, and WordPress

Wednesday, April 4th, 2012

10 Million hits a day with WordPress using a $15 server

Here are my results, as generated by my four-year old PC. My math tells me that localhost can handle about 406 million hits a day. Too bad it’s so difficult to monetize the computers stacked under my desk.

Linux Mint LMDE, 2.66GHz Core 2 Duo, Nginx, Varnish, PHP5-FPM, etc.

% /usr/bin/ab -t 60  -c 100 http://localhost/2012/03/02/setting-up-two-portrait-monitors-with-linux/
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests

Server Software:        nginx/1.1.0
Server Hostname:        localhost
Server Port:            80

Document Path:          /2012/03/02/setting-up-two-portrait-monitors-with-linux/
Document Length:        14171 bytes

Concurrency Level:      100
Time taken for tests:   10.606 seconds
Complete requests:      50000
Failed requests:        0
Write errors:           0
Total transferred:      728605005 bytes
HTML transferred:       708550000 bytes
Requests per second:    4714.15 [#/sec] (mean)
Time per request:       21.213 [ms] (mean)
Time per request:       0.212 [ms] (mean, across all concurrent requests)
Transfer rate:          67085.01 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      0      16
Processing:     0   21   9.4     19     134
Waiting:        0   20   8.8     19     133
Total:          0   21   9.5     19     136

Percentage of the requests served within a certain time (ms)
  50%     19
  66%     22
  75%     24
  80%     25
  90%     31
  95%     38
  98%     45
  99%     53
 100%    136 (longest request)

Windows Newlines Will Kill Your Linux Scripts

Tuesday, June 21st, 2011

Here’s a little something I give to my online Ruby and Python students every year.

(more…)

Solarized Color Scheme Rocks

Tuesday, May 3rd, 2011

Solarized – Ethan Schoonover

This a great color scheme—light and dark versions, both readable and easy on the eyes, available for Vim, Emacs, gnome-terminal, Terminal.app and lots more.

The gnome-terminal version is tricky to install, since gnome-terminal lacks a decent configuration gui. Check this link for accurate instructions. Terminal.app is a little tricky, too tricky for Mac hipsters, so I suggest that they should pass on this one—if Steve wanted you to have Solarized, he would have included it in OS X.

On second thought, I’d rather keep this color scheme all to myself. It’s so sweet that I’d hate to see everyone else using it. Oh well, it’s too late. I’ve already pushed the “Publish” button.

How I Learned to Love the Linux Desktop

Wednesday, June 23rd, 2010

After 15 years of waiting, I have a Linux desktop that I’m happy with. I think it’s time to write an homage to the Linux window managers I’ve used over the years.

But first I want to apologize to all the programmers, famous and anonymous, who poured so much of their time and talent into making Linux the fine system it is today. I’ve made some mean and nasty remarks about KDE, Gnome, FVWM over the years, and I have to admit that I never once considered the dedication and hard work of the hackers who contributed to the FOSS cause. In honor of the giants on whose shoulders Linux now stands, I want to share my humble observations about the Linux desktops I have known, through good times and bad.

(Note: Most of the images below come from XWinman.org and http://toastytech.com/guis/index.html.)

Before the Linux Big Bang

Xerox Alto

The Xerox Star (1980) looking very contemporary.

The graphical user interface was created in the 1960s and was refined and commercialized by researchers at Xerox PARC. As you can see from the picture of the Xerox Alto (1980), the gui hasn’t changed since 1980. When the Linux 0.95 kernel was released with X-Window support in 1992, the gui interface was already 25-years old.

The descendants of Xerox PARC—Sun OpenLook, Machintosh, NextSTEP and, yes, Microsoft Windows—all preceded the X11 desktops that we use with Linux. Here are a select few of the gui desktops that influenced the design of X11 desktops.

Sun OpenLook

The Sun OpenLook Desktop circa 1989.

The Sun OpenLook Desktop in 1996, looking a little too blue.

Many a Original Gangster Unix hackers earned their stripes on SunOS. The Sun OpenLook desktop served as the inspiration for many X11 desktop managers we see in the Linux world. The xclock app running in the top corner is still a fixture on many Linux desktops. You will immediately notice the distinctive (wicked-looking) resizing handles in the corners of each window. These always looked to me like something a Roman soldier might use to enforce Caesar’s will.


CDE

The CDE (Common Desktop Environment) was based on TWM.

The CDE desktop was developed by a consortium of Unix companies —AIX, Digital UNIX, HP/UX, Solaris, UnixWare, and others. CDE’s clean looks were widely imitated by Linux desktop designers. The control panel at the bottom of the screen was a predecessor of the various “docks” we see today.


NeXTSTEP

Tim Berner-Lee's NeXTSTEP Desktop. You can see some of the first web pages in existence.

The NeXT desktop environment was called NeXTSTEP. I loved everything about the NeXT computer. It was, in my 1985 eyes, the epitome of hardware and interface design. It remains my sentimental favorite after 25 years. One of the notable features about NextSTEP was the use of Adobe Display Postscript to render the entire desktop–a stunning achiement in 1988.

NeXT abandoned the hardware business in 1992 and became a software company. In 1996 Apple rehired Steve Jobs and paid him $400 Million for NeXTSTEP, which eventually evolved into the FreeBSD-based OS X we know and love today.


The First Linux Desktops

TWM

This charming fellow is TWM, a.k.a. Tom's Window Manager.

This pretty face was what we saw in the first Linux desktops. Though TWM doesn’t look like much and couldn’t do much, it did give us the power to open multiple xterms. This alone made it useful enough. Most of the window managers that followed TWM were built on TWM’s open source code.

CTWM

CTWM (1996) is a variant of TWM.

CTWM was one of the many TWM variants. I’ve included it as an example of why software guys should hook up with designers when they create the look of a product. Desktops like this one, though it may have been beautiful in the eyes of its owner, would never attract Windows or Mac users to the Linux desktop.


FVWM

FVWM stands for F Virtual Window Manager.

By 1993 everyone was tired of TWM. Robert Nation, the creator rxvt, hacked FVWM out of the TWM code and released it to the world. FVWM became the basis for many window managers, including Afterstep, Xfce, Enlightenment, Metisse and others. If you installed Redhat in 1995, FVWM would have been the default desktop. I never found FVWM to be fun to work with. Compared to Windows and the Mac, it looked a little too primitive.


The Wannabes

One persistent trend in Linux desktops is the desire to mimic the look of commercial desktops, especially Windows, NeXT, and OS X. I believe that imitation of good examples is acceptable. We were all aware that our X11 desktops weren’t appealing, and we looked to the commercial products for inspiration.

FVWM95

FVWM95 trying to look like Windows 95.

FVWM95 was a good imitation of Windows 95. The window decoration uses the classic Windows minimize, expand, and close buttons. The Start button makes its appearance on the Linux desktop. Imitating Windows was a step forward for the most part. Notice that the Linux text is bitmapped, not anti-aliased as on Windows 95. Jagged text was the Linux curse and contributed to its reputation for being unpleasant to look at.


Amiwm

AMIWM is an Amiga look-alike.

In 1985 the Commodore Amiga was the most technically advanced consumer computer available to mere mortals. If you wanted to edit video production, you used the Amiga and Video Toaster software. In 1985 the Amiga had a 32-bit processor, high-end graphics and sound chips, and a multi-tasking OS. Sounds pretty good, doesn’t it.


AfterStep

AfterStep (1996)

AfterStep was a noble effort to bring the NextSTEP look to X11. The most notable feature was the Dock applet. Note that some of the menus use gradients. This example is unfortunately cursed with “Engineeritis”, with a sensational purple lightening background. I would guess that the owner of this desktop was very proud of his handiwork.


WindowMaker

WindowMaker Desktop (1998)

WindowMaker Desktop looking good (1997).

In the line of NextSTEP copycats, WindowMaker was one of my favorites. It had a more sophisticated look than AfterStep. In the hands of someone with a little design talent, good things could happen. This blue example looks amazing to me even now. I won’t claim that this color scheme is particularly functional, but it is a nicely designed desktop.

As with most of the early desktops, configuration was accomplished with a challenging mix of gui interface poking and low-level configuration file hacking.


KDE, GNOME, and Xfce

Xfce and KDE arrived in 1998 with Gnome following in 1999. These three desktops are still available as options with most Linux distributions, and each has it’s loyal fans. Each has evolved to become sophisticated, good-looking, and functional. I have always been partial to KDE.

Xfce

Xfce (1998) cloning XP very nicely.

Xfce disguised as OS X Jaguar.

In this screenshot we see that Xfce successfully imitates Windows XP. Though Linux can steal the look, it still does not feel as good, to me, as Windows or OS X. Part of my perception is the result of the driver software for the mice and keyboards. Linux mouse drivers, in my experience, lack the slick ballistics of Windows and OS X.


KDE and Gnome

KDE showing what it can do. Yikes! (1998)

Gnome looking very sensible. (1999)

KDE and Gnome are the two most popular Linux desktops at this time (2010). KDE has the philosophy of offer the user many configuration options, and Gnome presents a more locked-down (some say dumbed down) approach, with fewer configuration options. Chances are, if you like Gnome, you’ll think KDE is a mess. And if you prefer KDE (as I do), you’ll find Gnome too restrictive. I’ll put it into an analogy: KDE is to Gnome as Perl is to Python.


Linux Gives You A Choice

In the World of Linux Desktops we are fortunate to have choices. We can make our desktop look like whatever we want—we can even make it look like Vista if we want, or, if we want a Sci-fi or video game look, we can have it. And if we want something stodgy, we can make it happen. If you have accessibility concerns, as I do, Linux has a solution. It’s true that too many options can give us design schlubs the power to make an ugly mess. But that’s just the price of having a little Freedom of Choice.

Thanks to all of you Linux and X11 hackers who have given your time and wisdom to the FOSS cause. I appreciate it, and I promise I’ll never bitch or whine about my Linux desktop again.

Keep hacking…


My KDE Desktop

KDE can dim the distracting inactive windows.

KDE on Mandriva running a Squeak Drunken Walk simulation.

Here are a few shots of my current KDE desktop configuration. Because I have a minor vision problem (gross astigmatism) I have trouble reading text on wide, bright backgrounds, so I prefer a muted theme. Compiz allows me to create a desktop that minimizes contrast problems. These screenshots were taken from my 1920×1200 HP monitor.

More Resources

Due to space and time constraints, I’ve omitted many interesting desktops. If you’re interested in seeing all of them, I highly recommend that you go through the XWinman.org site to get a feel for the enormous energy that went into creating the desktop managers we use today. If you’re interested in reading more about the history of graphic user interfaces, check out the encycolpedic http://toastytech.com/guis/index.html

If you want to see what other free-thinking Linux hackers are doing with their freedom of choice, check out these great resources: