You are heretips
tips
Open Windows Explorer (explorer.exe) in a different folder, not in Documents folder
I use 32-bit explorer in 64-bit Vista because of a few problems that use 32-bit explorer extensions and therefore don't work in the default 64-bit explorer. So I call the explorer.exe in the SysWOW64 directory (confusingly, the apps in the SysWOW64 directory are 32-bit apps).
%systemroot%\SysWOW64\explorer.exe /separate /n,/select,%HOME%
My New 320G Hard Drives using RAID and LVM
I just bought two new 320G hard drives last weekend and they are finally up and running with my same old Gentoo Linux OS. I wanted to put them in a RAID1 configuration and this was my first experience with software RAID.
Anti-Aliasing in Java >=1.3
It's really simple. Just add the a few lines of code at the top of your paintComponent method:
protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); . . . . . . }
Drag & Drop from Linux (KDE, Gnome) File Managers (Konqueror, Nautilus) to Java Applications
I tried a few months ago to get drag & drop working from Konqueror to a Java application but it didn't work. Two programmers (myself and another) each had a crack at it and couldn't get it to work. I found one link through Google that seemed to be promising (see reply 23 or 23) but that didn't work.
Maintaining Vendor Sources With Subversion
Here is how I upgrade my Drupal sites (which have their own customizations) to new versions of drupal core when they become available, as I mentioned in a previous post.
This section of the subversion book pretty much explains it. Here is specifically what I did for Drupal, assuming you already have some directories set up as follows:
/var/svn/repos/www/vendor/drupalcore /var/svn/repos/www/vendor/drupalcore/4.7.2 /var/svn/repos/www/vendor/drupalcore/4.7.3 /var/svn/repos/www/vendor/drupalcore/4.7.4 /var/svn/repos/www/vendor/drupalcore/current /var/svn/repos/www/drupal4.7
Upgraded to Drupal 4.7.5
I just upgraded to Drupal 4.7.5 today and upgrading is now more of a snap than ever for me. I fully track the drupal sources in my own svn server and then I merge changes between the releases into my own Drupal 4.7 branch (that contains core drupal + patches + contrib modules + contrib themes + 4 sites/ directories). It is so easy. Here is an article I wrote that explains how to maintain vendor sources using Drupal specifically.
Complex GMail Filtering
A few days ago I ran in to a situation where I wanted Gmail to filter something based on the OR of a From: filter and a Subject: filter. In other words I get email from a website and I want to catch their From: email address as well as another criteria based on the Subject: line. In this case, I want to catch emails with From:bookmooch.com OR Subject:Bookmooch OR Subject:"Book received" OR ... (there are a few other cases. If you enter the From: and Subject: conditions in the google create-a-filter wizard they will be logically connected with AND by default; however, if you put the following:
Generate Custom digg.com Feed
I found a really neat site that can generate custom feeds. I really wanted a way to not only get a feed of the most popular articles today on digg, but also have links directly to the dugg article, not to the digg page (sorry digg).
This site called RSSxl Beta could do it. I entered:
- Page URL:
http://www.digg.com/view/all/popular/today - Start String:
<div class="news-body"> - Start Item String:
<h3 id="title.*?"> - End Item String:
<div class="news-details"> - Start Description String:
<p> - End Description String:
</p> - Link Number:
1
Small Gotcha When Copying Paths With Subversion
I was trying to do an svn copy from a specific server path into a local working copy. I basically wanted to copy over the vanilla mediawiki-1.8.1 sources from my repository into a local directory (called trunk). Here is what I did:
svn copy svn+ssh://david@server/svn/repos/Projects/wiki/mediawiki/1.8.1 ./trunk
You would think that this would copy the contents of the 1.8.1 directory into the trunk directory. Wrong; it copies the 1.8.1 directory and its contents into the trunk directory, thus creating a 1.8.1 directory inside trunk. It took me forever to figure out why it was doing this instead of what I wanted it to do (which is to copy the contents of 1.8.1, not the 1.8.1 directory itself).
Awesome screen tips
Great GNU screen tips from Damien Krotkine. Modify your ~/.screenrc file as follows:
vbell on
defscrollback 5000
caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c"Now you get a cool console at the bottom. By the way, to change the title of a screen, use
CTRL-a, CTRL-A
Starting sshd With a Higher Nice Value
I wanted sshd on my MythTV box to start with a lower priority than other processes. Sometimes I do large transfers to this box over scp (although usually I use nfs). I tried:
nice -n 10 /usr/sbin/sshd ${myopts} ${SSHD_OPTS}and
start-stop-daemon -N 10 --stop --quiet --pidfile /var/run/${SVCNAME}.pid --signal HUPSecret Digg "Top Today" Feed
I found a secret Digg feed today. I have been looking for a while for a way to get a feed for the "Top Today" page because the regular digg feed has too many articles. It turns out it does exist although it doesn't seem to be advertised anywhere on digg's site. Here is is: http://digg.com/rss/toplinks.xml.
Interesting svn Recovery Problem
I was just trying to recover some files from a subversion repository at work that were deleted a few revisions ago. Here's what happened:
update to old revision where directory jlamothe still exists:
$ svn -r 2444 up -q
directory jlamothe is there in revision 2444:
$ ls cjm david jlamothe pix wgm
updated to HEAD, jlamothe got deleted in HEAD:
$ svn up D jlamothe Updated to revision 2477.
see, it is gone:
$ ls cjm david pix wgm
trying to recover:
$ svn cp -r 2444 svn+ssh://david@weatherwax/svn/repos/Docs/jlamothe . -q svn: The URL 'svn+ssh://david@weatherwax/svn/repos/Docs/jlamothe' has a different repository root than its parent
Fix Capitalization in Latex Bibliographies
To make words in Bibliographic titles appear in the capilization that you specify, enclose the word in curly braces, {}. So to ensure the word, VLSI is capitalized, put {VLSI}.
Creating Pretty PDF Files From Latex
To create good PDF files which look good in Adobe Acrobat even at maximum zoom levels:
- First run latex as many times as you need to resolve all references. This will produce your final *.dvi file. Let's assume it's called myfile.dvi.
latex myfile.tex
- Now that we have our myfile.dvi file, we need to convert it to postscript. This is the safest step for most applications. For example some Latex features will not appear in the document unless the *.dvi file is first converter to a Postscript (*.ps) file. One example is shading, by using the Latex shading package (available on CTAN). The "other" method I am elluding to is by converting directly to PDF by using dvipdfm or pdflatex. This usually works fine, however, I recommend going to Postscript first using dvips. You need to provide two key arguments: a) the paper size, and b) a PDF option. The paper size option is usually necessary because dvips is set up for A4 paper by default. Note, even if your postscript file looks like it fits on the page properly, it may not once you convert it to a PDF! The PDF option is necessary so that dvips includes outline fonts instead of bitmap fonts in the Postscript document. This is what will make our fonts look pretty in the final PDF document, and will allow the fonts to scale themselves when we zoom in. So the command we need to run is: