Web blog.revragnarok.com

Welcome to RevRagnarok's Blog

This is not a typical "read my thoughts blog" - instead it is a "I found something that may be useful to be jotted down for myself, and maybe others can benefit from my sweat and tears." So it is more of a brain dump. If you find any of it useful, please feel free to drop me a line at blog using this domain name. Also, most of my useful links are dumped at del.icio.us. And with that disclaimer finished, I now have a "funny stuff, etc" blog on blogspot.

Tags that will help you navigate:

  • General Technology - General tech stuff I found interesting
  • Import - These were imported from the old bblog based blog (Dec 2006)
  • Cygwin - Cygwin-related posts - don't miss the Linux too below
  • Ghost - Symantec Ghost related stuff
  • Links - Misc web links I find useful
  • Linux - Linux-related posts - most will likely apply to MacOS X, Solaris, etc
  • Mozilla - Mozilla and Firefox related links
  • MySQL - MySQL related posts
  • Perl - Perl snippets and useful stuff
  • Ranting - OK, this part is like a normal blog... see my other blog.
  • Subversion - Stuff related to 'subversion'
  • trac - Stuff related to 'trac', the development system this blog runs on
  • VMWare - VMWare related stuff (both original "paid" stuff and free VMWare Player)
  • Windows 95/98/ME - "Old" Windows stuff (unused since 2006)
  • Windows NT/2K/XP - "New" Windows stuff

If you find this page helpful, please consider checking out HowToSupportRevRagnarok.


TEN NEWEST POSTS


<<  <  Sep  2008  >  >>
Su Mo Tu We Th Fr Sa
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

Car Repair Pricing

http://consumerist.com/5032351/demystify-car-repair-prices-with-repairpalcom


Service Manuals for a BUNCH of stuff

http://www.eserviceinfo.com/


"sudo" for Vista

http://technet.microsoft.com/en-us/magazine/cc162321.aspx

"elevate" acts as sudo


Subversion from Perl

So I spent about three hours trying to get my perl svn_compress script running and I ran kept running into the damned thing segfaulting!

svn_path_basename: Assertion `is_canonical (path, len)' failed.

I finally found the answer. Apparently, libsvn wants '' as the current directory, not '.' like every other program since the beginning of time (Jan 1, 1970, right?).

Three hours.

Where I read the answer. Pasted here:

Peter Samuelson wrote:
> [Julian Gilbey]
>> burnside:~/debian/tex/tetex-bin $ perl -MSVN::Client -e \
>>   'sub print_names { print "<$_[0]>\n"; } $ctx=new SVN::Client;
>>   $ctx->status("", "BASE", \&print_names, 1, 1, 0, 1);' | head -5
>> <>
>> <.pc>
>> <.pc/.version>
>> <configure>
>> <INSTALL.generic>
> 
> I reproduced your bugs with subversion 1.3.0-5, so I can properly
> discuss it with upstream.  Unfortunately, I don't know much about the
> Perl bindings.  But comparing "svn status" with your command, it does

(...)


Today I created a yum repository

This is what happens when you are at work and you have ISOs for the 6 CDs of CentOS 5.2 but NOT the DVD, and no connection to the 'net... I couldn't use the 5.2 installer thanks to this bug (it's an embedded Celeron 650). Since I went thru all the work, I also then imported the directory as a "shared folder" under VMWare player and then did the same upgrade path on that machine (I want it to mirror the embedded machine for all versions of everything, except it also has the gcc suite, etc).

One Time Only

(This can be done on any Linux machine with the external drive connected)

  • I mounted the external drive under Linux and there are the 6 ISO CDs. I mounted each and then upgraded what was on it that we already had installed.
  • cd /media/ext_drive/<install dir>
  • mkdir mnt
  • mount -o ro,loop <CDFILE>.iso mnt
  • cp -urv mnt/CentOS .
    • If I were doing this again, I may mount the 6 as /mnt1 thru /mnt6 and then try to use cp -l to make links?

(...)


Stopping a Windows Executable from Running

To prevent a file from being created, in the past I have created a folder with the same name. This lets you stop a file from running (the example used is a worm executable):

1. Create a registry key with the name of the process you want to prevent to execute. Ex.: calc.exe

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\calc.exe 

2. Under this new key you've just created, create a SZ value called "Debugger" and set it to the following value:

SZ Debugger = "cmd.exe /c echo  %time% %date% calc.exe >> c:\ExecBlocked.log"

From http://blogs.technet.com/marcelofartura/archive/2006/10/24/a-virus-infection-contolling-the-outbreak-tip.aspx with slight mods by me.


Random Unix/Linux Tips

Yeah, that's pretty much the subtitle of this blog, but I found another that has similar stuff:

http://users.softlab.ece.ntua.gr/~ttsiod/tricks.html

My favs (I'm copying in case the site goes down):

Convert a static lib (.a) into a dynamic one (.so)

gcc -shared -o libXxf86vm.so.1.0 \
	-Wl,-soname,libXxf86vm.so.1 \
	-Wl,--whole-archive,libXxf86vm.a,--no-whole-archive

Create PNGs from a pdf presentation

gs -dSAFER -dBATCH -dNOPAUSE -dTextAlphaBits=4 \
    -dGraphicsAlphaBits=4 \
    -r85 -q -sDEVICE=png16m -sOutputFile=icfp-pg%02d.png \
    PhDPresentation.pdf

Read a damaged CD/DVD valid parts and get the rest with rsync

As is often the case, when I bring some burned CD/DVD 
from work, I find out that its bad at some offset.
I came up with this Perl script:

---------------------------------------
#!/usr/bin/perl -w
use strict;

my $i=0;

select((select(STDOUT), $| = 1)[0]);

(...)


"Hidden" Search Feature in File Open dialog

OK, I've been using Windows for years and I really thought I knew almost every shortcut. I Alt-Tab like there's no tomorrow (and occasionally remember to Win-Tab on wifey's laptop w/Vista). Win-R hourly (typing cmd or calc is quicker than finding it on the menu). Win-E any time a USB drive is nearby. Anyway, apparently you can do searches within a "File Open" dialog. Obviously, I knew most programs add a pull-down with file types. But on a whim, I was in UltraEdit the other day and type *vhd and wow it limited the selection to the VHDL files. *.v worked too, but acted like *.v* - however *.l and *.l?? showed the second one acting as I would expect (matching only 3 letter extensions starting with l - .lock was hidden). I tried it in a few other programs like Gimp and it seems to be part of the standard Windows UI. This is XP, I don't have access to any 2000 machines anymore, but no idea when it came about. (As shown before), I hate it when something I'm looking for is right under my nose!


Extra Secure Remote Desktop

I have been using Microsoft's Remote Desktop for a few years now (pretty much since I switched to XP). It's decent, and I like that it retains sessions unlike TightVNC, which is what I had used before. By using a SSH tunnel, I feel confident that my connection is secure and I am willing to visit my banks, etc. using my desktop machine via my laptop on a wireless network. Here's what I did:

On the server (in this case my desktop):

  • Installed the Cygwin build of SSHD as a service
    • Many guides are available, just search with Google above keywords like "cygwin sshd". But in a nutshell:
      • Install cygwin (duh) - include openssh (under Net) and cygrunsrv (under Admin)
      • Set up sshd: "ssh-host-config -y"
      • Start it as a service: "cygrunsrv -S sshd"
  • Allow Remote Desktop usage:
    • Right click on "My Computer" and choose "Properties"
    • Go to the "Remote" tab
    • Make sure that "Allow users to connect remotely to this computer." is checked

On the client (in this case my laptop): (...)


Compressing Subversion checkouts

I'll let the file intro explain itself:

# "Disk space is cheap!" - SVN Authors
# "Except when backing it up!" - RevRagnarok

# This script will drastically reduce the size of an svn checkout so you can back up the folder.
# It will include a script to re-expand the directory with NO interaction with the server.
# It will also (optionally) write a script /tmp/svn_uncompress.sh that will restore all compressed
#   folders.


Something to check out in the future: http://scord.sourceforge.net/


Update 3 Apr 08: Updated the script to touch a file saying it ran so it won't run again. Also have it dump a tiny "readme" file to let somebody else know what is going on.
Update 4 Apr 08: Fixed bug with deep paths.
Update 22 Aug 08: Huge changes, now using "proper" native calls.

Updated on 08/22/08 20:49:30