You would think that prominent law makers in Washington D.C. would at least be able to talk directly to the president. Apparently not. This is clear in light of Joe Wilson's "You lie" outburst during an Obama speech last week...
“I am not going to apologize again,” Mr. Wilson said. “I apologized to the president on Wednesday night. I was advised then that — thank you, now let’s get on to a civil discussion of the issues. But I — I’ve apologized one time. The apology was accepted by the president, by the vice president, who I know. I am not apologizing again.”
The article goes on to say:
Mr. Wilson also called the White House and reached Rahm Emanuel, the president’s chief of staff, who accepted an apology on behalf of Mr. Obama. And the president said later that he accepted it.
There is this myth that Teddy Roosevelt's rough rider's where this rough n' tumble gang of volunteers who won the battle of San Juan Hill by sheer force of will or some other ridiculous story of underdog heroism. But the truth is that the rough riders won the battle of San Juan Hill because they were one of the first forces equipped with the technical marvel called the Gatling Gun. Wars are won because one side achieves technical advantage over the other, not because of moral superiority.
I got married 4 weeks ago and just realized I hadn't blogged about it. It really was a great wedding - everything was beautiful and the weather cooperated perfectly. I'll post some pictures from the wedding and the honeymoon (to Vietnam and Japan) when I get a chance. Yay!
I'm starting to use yum and apt to manage production and development server configuration, installation, and updates. It's super easy to setup a yum repository and rpms are equally easy to create.
Creating a yum repository
First, setup an empty repository.
]# yum install createrepo
]# mkdir /var/ftp/pub/software/redhat/RPMS/x86_64
]# createrepo /var/ftp/pub/software/redhat/RPMS/x86_64
]# echo "[myrepo]
name=My Repository - Extras
baseurl=file:///var/ftp/pub/software/redhat/RPMS/x86_64
enabled=1
gpgcheck=0
" > /etc/yum.repos.d/myrepo.repo
You now have a repository setup and you have configured your yum client to connect to it using the local file: protocol. The command "yum repolist all" should list the new "My Repository - Extras" repository. If /var/ftp/pub is served by your ftp server then you can also access this repository using ftp:.
Create your rpm packages
Now you have to create rpm's and inject them into the yum repository. For this example I'll create a very basic rpm with a simple rpm dependency.
Overview: To create an rpm you basically choose some location on your dev server called a "Buildroot" which contains a bunch of standard RPM build-related directories, create a .spec file for your new package, place your package sources properly beneath the Buildroot, and finally run rpmbuild -ba to create the rpm binary package. Copy the newly created rpm from the Buildroot to your yum repository and rerun createrepo.
- Create your Buildroot. The default Buildroot location is /usr/src/redhat, but I prefer to create a special unprivileged user to create the rpm packages. I then create the Buildroot beneath the special user's home directory.
]# adduser rpmbuilder
]# su rpmbuilder
]$ mkdir ~/rpms
]$ cd /home/rpmbuilder/rpms && mkdir SPECS SOURCES BUILD RPMS SRPMS
Now create a ~/.rpmmacros file and enter the following into it:
%packager
%vendor
%_topdir /home/rpmbuilder/rpmsThe .rpmmacros file allows you to define symbolic variables (identified by a leading '%' character) which can be referenced in your .spec files
- In a normal scenario you would choose a source tarball and create a .spec file for it. Since this is a simple example we're going to create some idealized example tarballs so that we can focus on the rpm-related details rather than the nuances of building a specific software package. These commands will create simple foo-0.0.1.tar.gz and bar-0.0.1.tar.gz source tarballs:
]$ mkdir -p /tmp/foo-0.0.1/opt/foo/
]$ echo "testing" > /tmp/foo-0.0.1/opt/foo/this_file_will_be_installed.foo
]$ cd /tmp/ && tar -cvzf foo-0.0.1.tar.gz foo-0.0.1
]$ mkdir -p /tmp/bar-0.0.1/opt/bar/
]$ echo "testing 2" > /tmp/bar-0.0.1/opt/bar/this_file_will_also_be_installed.bar
]$ cd /tmp/ && tar -cvzf bar-0.0.1.tar.gz bar-0.0.1Now copy the foo-0.0.1.tar.gz and bar-0.0.1.tar.gz you just created into your /home/rpmbuilder/rpms/SOURCES/ directory. If you were, say, creating an rpm for a binary installation of apache webserver you would obtain the source tarball for apache and place it in the same SOURCES directory. Also, copy the same tarballs into your /var/ftp/pub/software/redhat/SOURCES/ repository directory so that they can be retrieved if you ever needed them again.
]$ cp /tmp/bar-0.0.1.tar.gz /tmp/foo-0.0.1.tar.gz /home/rpmbuilder/rpms/SOURCES/
]$ cp /home/rpmbuilder/rpms/SOURCES/*tar.gz /var/ftp/pub/software/redhat/SOURCES/
- Now create a .spec file for your package. We're going to create 2 packages - "foo" and "bar" - and make foo depend on "bar". The format for a .spec file is "package name"-"package version"-"release number".spec.
]$ touch ~/rpms/SPECS/foo-0.0.1-1.spec
Now open foo-0.0.1-1.spec using your editor, enter the following contents up to (not including) the __END__ token, and save.
%define name foo
%define version 0.0.1
%define release 1
%define vname %{name}-%{version}Summary: Example Foo
Name: %{name}
Version: %{version}
Release: %{release}
License: Proprietary
Group: ACME
Source: file:///var/ftp/pub/software/redhat/SOURCES/%{vname}.tar.gz
Vendor: %{vendor}
URL: http://your.url.here
Prefix: %{_prefix}
Buildroot: %{_topdir}/%{vname}
Requires: bar = 0.0.1%description
This does nothing, just testing.%prep
%setup -q
%install
rm -rf $RPM_BUILD_ROOT
install -m 755 -d $RPM_BUILD_ROOT
install -m 755 -d $RPM_BUILD_ROOT/opt
install -m 755 -d $RPM_BUILD_ROOT/opt/foo
install -m 444 opt/foo/this_file_will_be_installed.foo $RPM_BUILD_ROOT/opt/foo/this_file_was_installed.foo%clean
%files
%dir /opt/foo
%defattr(444, root, root)
/opt/foo/this_file_was_installed.foo%changelog
* Tue Nov 25 2008 Your Name
- Created rpm package for Foo
__END__See the RPM HOW-TO for more information about the different macros (like %prep, %setup, %install, %clean, %files) in a .spec file. If you've ever used "make" then the overall structure will be familiar to you. Now repeat for the bar package, creating a bar-0.0.1-1.spec file. You can shortcut this by just doing the following:
]$ cat foo-0.0.1-1.spec | grep -v Requires | sed 's/foo/bar/g' | sed 's/Foo/Bar/g' > bar-0.0.1-1.spec
Now, the following files should exist on your system:
/home/rpmbuilder/rpms/SOURCES/foo-0.0.1.tar.gz
/home/rpmbuilder/rpms/SOURCES/bar-0.0.1.tar.gz
/home/rpmbuilder/rpms/SPECS/foo-0.0.1-1.spec
/home/rpmbuilder/rpms/SPECS/bar-0.0.1-1.spec
- Now you are ready to turn the spec files and tarballs into rpms using the rpmbuild command:
]$ cd /home/rpmbuilder/rpms/SPECS
]$ rpmbuild -ba ./foo-0.0.1-1.spec
]$ rpmbuild -ba ./bar-0.0.1-1.specThis will create rpm packages in the /home/rpmbuilder/rpms/RPMS/ directory. Copy these rpm files into your repository and regenerate the yum repo metadata.
]# cp /home/rpmbuilder/rpms/RPMS/x86_64/*rpm /var/ftp/pub/software/redhat/RPMS/x86_64/
]# createrepo /var/ftp/pub/software/redhat/RPMS/x86_64
Try to install your new packages using yum
]# yum install foo
Yum should recognize that "foo" depends on the package "bar" and prompt you to accept installing bar as well.
I had a thought today regarding this world financial crisis. Last night I watched Charlie Rose interview Paul Volker who stressed that the most important thing that that the G7 and others take a collaborative approach to solving this problem. Basically he stated that they need to work together for the common good of the international financial system. Given that there is the potential for an even bigger and more catastrophic environmental calamity down the road (ie. global warming) I wonder whether any new international frameworks will come about which would be relevant in solving other worldwide crises were they to arise?
Well, my fiance and I had planned to purchase a house this year but barring some miraculous turn around in the market it seems that's not going to happen. It's so frustrating to get so close to achieving a goal and then to have it snatched away at the last minute. In March I talked to my financial advisor about possibly pulling my money out of the market and he said to wait until we found "the" house. My thinking was that we /had/ enough money to buy and that the general economic outlook was bad so let's hedge our bets and make sure we can attain our primary goal which was home ownership. Now the DOW has tanked to 5 year lows as real estate prices in SF have barely dropped at all. Sigh.
Generally I feel blessed to live in a country as safe, prosperous and free as the United States, but every once in a while I am reminded why you just can't ever give up the good fight. The current debate about net neutrality is probably a significantly historic battle whose outcome is likely to determine to what degree our current notion of the freedom of the press will carry over in the next generation of journalism. In other words, the decisions we make on net neutrality today are likely the very decisions that will likely define freedom for our children of tomorrow.
A few years ago I learned the hard way why you should always use your linux distribution's package management tools. It's just too easy to end up with conflicts that hose your system. Also, if you don't use your package management system properly you will likely end up with multiple versions of software that perform the same function, which can be confusing and error prone. One package I see people constantly mis-installing on linux is the Sun java jdk. Virtually every time I see someone install it I see them download the binary installation, install it to /usr/java and then set their JAVA_HOME env var to point there. Then I see them rm the java binaries in /usr/bin, replacing them with the binaries from their java installation which immediately breaks their linux alternatives system. Sometimes they just add the new java bin dir to their PATH variable and think that they are done. Both of these are wrong. Here is the Right Way to install java on Red Hat using the linux alternatives mechanism...
NOTE 1: jdkx.y.z_pp represents your jdk install dir, jdk1.6.0_10 for me at the time of this post
NOTE 2: the number 1421 is the alternatives priority - you want the new installation to be one higher than your existing gcj priority, if it is already installed. You can obtain the priority with the command `alternatives --display java`
1) install the java 1.6.0 rpm binary package from sun
2) move the sun 1.6.0 jdk from /usr/java/jdkxxx to /usr/lib/jvm/jdkx.y.z_pp
3) symlink /usr/lib/jvm/java-1.6.0-sun to /usr/lib/jvm/jdkx.y.z_pp
# cd /usr/lib/jvm/
# ln -s jdkx.y.z_pp java-1.6.0-sun
4) configure the alternatives mechanism to use the sun java installation
# alternatives --install /usr/bin/java java /usr/lib/jvm/java-1.6.0-sun/bin/java 1421 --slave /usr/bin/rmiregistry rmiregistry /usr/lib/jvm/java-1.6.0-sun/bin/rmiregistry --slave /usr/lib/jvm/jre jre /usr/lib/jvm/java-1.6.0-sun/jre/
# alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-1.6.0-sun/bin/javac 1421 --slave /usr/lib/jvm/java java_sdk /usr/lib/jvm/java-1.6.0-sun --slave /usr/bin/javadoc javadoc /usr/lib/jvm/java-1.6.0-sun/bin/javadoc --slave /usr/bin/javah javah /usr/lib/jvm/java-1.6.0-sun/bin/javah --slave /usr/bin/jar jar /usr/lib/jvm/java-1.6.0-sun/bin/jar --slave /usr/bin/rmic rmic /usr/lib/jvm/java-1.6.0-sun/bin/rmic
alternatives --config java
alternatives --config javac
5) configure alternatives for java man
# (cd /usr/lib/jvm/java-1.6.0-sun; txt="alternatives --install /usr/share/man/man1/java.1 man-java.1 /usr/lib/jvm/java/man/man1/java.1 1421 "; for f in man/man1/*; do f=`basename $f`; if [ "x$f" != "xjava.1" ]; then txt="$txt --slave /usr/share/man/man1/$f man-$f /usr/lib/jvm/java/man/man1/$f"; fi; done; `$txt`);
6) configure /etc/profile.d/java.sh to set the proper env vars, system wide
# echo "export JAVA_HOME=/usr/lib/jvm/java
export JRE_HOME=/usr/lib/jvm/jre
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
" > /etc/profile.d/java.sh;
We settled on Relais du Soliel, a beautiful rustic country guest ranch, as our wedding location. We're going to rent it out for the weekend and have a 3 day wedding party. I'm really excited as this place has so much potential. It's not fancy but will be beautiful during the late summer when we have our wedding. This is shaping up to be a great wedding and I just hope that all the people on our list will be able to make it. Without them we'd be missing the most important part of the celebration!
I got engaged to my girlfriend of 2 and a half years on Saturday! I feel so lucky and honored that I get to spend the rest of my life with this wonderful woman. I continue to look forward to every day with her, as I have been since we started dating. There have been many significant events in my life over the last year, but this is by far the most important and joyful. I proposed to her at Los Trancos Open Space Preserve in the Palo Alto foothills. I wanted to ask her somewhere that would most likely exist 10, 20, 50, 100+ years from now so that we and our family could visit the site in years to come. The weather was poor (cloudy, foggy, cold, damp) but somehow it still felt right. We paused on the trail to kiss and after an awkward pause I finally mustered enough strength to do it. I told her how much she meant to me, how much I love her and that I wanted to start the new year together with a plan. Then I got down on one knee and asked her to marry me. I was so nervous, but she said "yes" before I even got down on one knee. If anyone doubts whether I got down on one knee I can show them this picture!
Eh, whatever. He should be able to talk to the President directly. read more
on No wonder nothing (good) gets done in Washington