Thursday, August 26, 2010

Using Pastel Colors on Black Background in iTerm

Source: http://kpumuk.info/mac-os-x/customizing-iterm-creating-a-display-profile-with-pastel-colors/

At the link above, I found the following script which will create a new profile in iTerm which will have a black background and pastel coloration of text.

Here is the script as it was on 8/26/2010:

#!/bin/bash

PASTEL='{
"Ansi 0 Color" = {
"Blue Component" = 0.3097887;
"Green Component" = 0.3097887;
"Red Component" = 0.3097887;
};
"Ansi 1 Color" = {
"Blue Component" = 0.3764706;
"Green Component" = 0.4235294;
"Red Component" = 1;
};
"Ansi 10 Color" = {
"Blue Component" = 0.6727703;
"Green Component" = 1;
"Red Component" = 0.8094148;
};
"Ansi 11 Color" = {
"Blue Component" = 0.7996491;
"Green Component" = 1;
"Red Component" = 1;
};
"Ansi 12 Color" = {
"Blue Component" = 0.9982605;
"Green Component" = 0.8627756;
"Red Component" = 0.7116503;
};
"Ansi 13 Color" = {
"Blue Component" = 0.9965209;
"Green Component" = 0.6133059;
"Red Component" = 1;
};
"Ansi 14 Color" = {
"Blue Component" = 0.9970397;
"Green Component" = 0.8763103;
"Red Component" = 0.8759136;
};
"Ansi 15 Color" = {
"Blue Component" = 1;
"Green Component" = 1;
"Red Component" = 1;
};
"Ansi 2 Color" = {
"Blue Component" = 0.3764706;
"Green Component" = 1;
"Red Component" = 0.6588235;
};
"Ansi 3 Color" = {
"Blue Component" = 0.7137255;
"Green Component" = 1;
"Red Component" = 1;
};
"Ansi 4 Color" = {
"Blue Component" = 0.9960784;
"Green Component" = 0.7960784;
"Red Component" = 0.5882353;
};
"Ansi 5 Color" = {
"Blue Component" = 0.9921569;
"Green Component" = 0.4509804;
"Red Component" = 1;
};
"Ansi 6 Color" = {
"Blue Component" = 0.9960784;
"Green Component" = 0.772549;
"Red Component" = 0.7764706;
};
"Ansi 7 Color" = {
"Blue Component" = 0.9335317;
"Green Component" = 0.9335317;
"Red Component" = 0.9335317;
};
"Ansi 8 Color" = {
"Blue Component" = 0.4862745;
"Green Component" = 0.4862745;
"Red Component" = 0.4862745;
};
"Ansi 9 Color" = {
"Blue Component" = 0.6901961;
"Green Component" = 0.7137255;
"Red Component" = 1;
};
"Anti Alias" = 1;
"Background Color" = {
"Blue Component" = 0;
"Green Component" = 0;
"Red Component" = 0;
};
Blur = 1;
"Bold Color" = {
"Blue Component" = 0.5067359;
"Green Component" = 0.5067359;
"Red Component" = 0.9909502;
};
Columns = 120;
"Cursor Color" = {
"Blue Component" = 0.3764706;
"Green Component" = 0.6470588;
"Red Component" = 1;
};
"Cursor Text Color" = {
"Blue Component" = 1;
"Green Component" = 1;
"Red Component" = 1;
};
"Disable Bold" = 0;
Font = "Monaco 14";
"Foreground Color" = {
"Blue Component" = 1;
"Green Component" = 1;
"Red Component" = 1;
};
"Horizontal Character Spacing" = 1;
NAFont = "Monaco 14";
Rows = 24;
"Selected Text Color" = {
"Blue Component" = 0.9476005;
"Green Component" = 0.9476005;
"Red Component" = 0.9476005;
};
"Selection Color" = {
"Blue Component" = 0.5153061;
"Green Component" = 0.2224857;
"Red Component" = 0.2099074;
};
Transparency = 0.1;
"Vertical Character Spacing" = 1;
}'

# Add display profile
defaults write net.sourceforge.iTerm Displays -dict-add Pastel "$PASTEL"
echo "Pastel display profile added"

# Set the default display profile
BOOKMARKS=`defaults read net.sourceforge.iTerm Bookmarks | sed 's/\("Display Profile" = \)"[^"]*";/\1"Pastel";/'`
defaults write net.sourceforge.iTerm Bookmarks "$BOOKMARKS"
echo "Pastel display profile installed as default"

"no such file to load -- zlib (LoadError)" while trying to install gems via rvm

On a fresh install of Ubuntu 10.04 LTS, I recently encountered the following error after installing "rvm":

no such file to load -- zlib (LoadError)

I ended up fixing this with:

sudo apt-get install zlib1g-dev \
  libssl-dev libreadline5-dev \
  libxml2-dev libsqlite3-dev

However, rvm appears to have a solution for this built-in. I haven't tried it, since I did the apt-get install above, but I have read that it worked for others:

rvm package install zlib

U.S. Government Unfriendly Towards Businesses

I know, I know, not exactly a news flash.

Regardless, here is some interesting insight from the CEO of Intel.

"I can tell you definitively that it costs $1 billion more per factory for me to build, equip, and operate a semiconductor manufacturing facility in the United States," Otellini said.
The rub: Ninety percent of that additional cost of a $4 billion factory is not labor but the cost to comply with taxes and regulations that other nations don't impose. (Cypress Semiconductor CEO T.J. Rodgers elaborated on this in an interview with CNET, saying the problem is not higher U.S. wages but antibusiness laws: "The killer factor in California for a manufacturer to create, say, a thousand blue-collar jobs is a hostile government that doesn't want you there and demonstrates it in thousands of ways.") 

http://news.cnet.com/8301-13578_3-20014563-38.html?tag=mncol;1n

The interview linked from the story above, offering more detail into why it's so much more expensive to create a semiconductor fabrication plant in the U.S. than elsewhere in the world.
http://news.cnet.com/2008-1006_3-5215272.html

Tuesday, August 17, 2010

Improve anti-aliasing in MacVim

The line below greatly increases the display quality of fonts in MacVim:

defaults write org.vim.MacVim AppleSmoothFixedFontsSizeThreshold 8


I found it here by searching Google for ways to improve anti-aliasing in MacVim.

Code Syntax Highlighting with Blogger

Getting syntax highlighting was fairly painless using the help found at MLA Wire.

Short little test to see if the highlighting is working.

class TheClass
  def somefunc
    "Hola!"
  end
end

The only thing I don't like is that it pulls the javascript files directly from the SyntaxHighlighter's web site, which seems kind of rude. I'll probably move the files to an already existing virtual server. That way it's using my bandwidth, not the SyntaxHighlighter author's.

Update: I just did a little bit of digging into where the SyntaxHighlighter web site lives, and it appears to be hosted at DreamHost.

Knowing DreamHost (I have an account with them, too), he is probably allotted more bandwidth than he can use, so now I don't feel the need to self-host the javascript files is quite as important.  I should still do so, but most browsers will cache the files locally, anyhow, and my blog is going to have, essentially, zero traffic, so I think it's ok for now.

Blogger is really sharp!

Even though my experience with Blogger only consists of about 10 minutes of fooling around, I must say that I'm pretty impressed.

I've been looking at several different blogging packages to install on a small virtual server.  I figured it'd be good to have something I can manage myself.

But, after trying out a half-dozen, or so, I'm glad I tried Blogger.  The time savings alone will make this decision more than worth it.

Not to mention that it seems to offer so much more in the way of features.  The "Monetize" option seems really cool, too, though I don't imagine I'll be taking advantage of it. This blog is a place for me to dump thoughts or discoveries to remember.  Be it code samples, political articles, or random thoughts.