Solutions Log by Dan Reiland

2Mar/100

Git Subtree Merge and git-svn

Issue: Git submodules do not play nicely with git-svn; git subtree merging is a more appropriate strategy for my specific use case.

Resolution: This is my recipe (borrowed heavily from the formal git documentation).

git checkout -b TRY-MERGE master
git remote add -f Bproject /path/to/B
git merge -s ours --no-commit Bproject/master
git read-tree --prefix=dir-B/ -u Bproject/master
git commit -m "Task - JIRA-001 - Merge B project as our subdirectory"
git checkout master
git merge TRY-MERGE master -m "Task - JIRA-001 - Merging subtrees into project."
git-svn dcommit

You may update your local copy from the remote at any time with:

git pull -s subtree Bproject master

Reference: http://kernel.org/pub/software/scm/git/docs/v1.7.0/howto/using-merge-subtree.html

26Feb/100

Commit a linear git history to subversion

Issue: I was recently asked to integrate my local development (which I had done under git management) into our central Subversion server. How to do this while preserving my commit history?

Resolution: After a lot of reading (and an upgrade to git-1.7.0) I found the following recipe to work for me.

git branch master.bak master
git-svn init svn://repo.domain.local/Project/trunk/sub/directory
git-svn fetch
git checkout -b svnrebase git-svn
git-svn rebase
git rebase --root --onto svnrebase master
git-svn dcommit
Tagged as: No Comments
8Feb/100

Reset The Windows Update Catalog

  1. Insert the Windows Vista installation disc in the disc drive, and then restart the computer.
  2. When you are prompted to restart from the disc, press any key.
  3. When you are prompted, configure the Language to install, Time and currency format , and Keyboard or input method options that you want, and then click Next .
  4. On the Install Windows page, click Repair your computer .
  5. On the System Recovery Options page, click the version of the Windows Vista operating system that you want to repair, and then click Next
  6. On the System Recovery Options page, click Command Prompt .
  7. Type cd C:\windows\winsxs , and then press ENTER.
  8. Type ren pending.xml pending.old , and then press ENTER.
  9. In Registry Editor, locate and then delete the following registry subkey:
  10. HLKM\Offline Components\AdvancedInstallersNeedResolving
    HKLM\Offline Components\PendingXmlIdentifier
    HKLM\Offline Components\NextQueueEntryIndex
  11. At the command prompt, type exit to exit Registry Editor. Press ENTER.
  12. Click Restart

Reference: http://social.answers.microsoft.com/Forums/en-US/vistawu/thread/13dec2a0-2694-4b11-9b0c-9b8fbe6162ee

5Jan/100

Reset HP Integrated Lights Out Board to Factory Defaults

Issue:
Cannot login to HP Integrated Lights Out Board (bad credentials).

Cause:
Someone failed to record the configuration.

Solution:
If an operating system supported by HP Proliant Essentials is installed along with a recent Proliant Support Pack, you may reset the Integrated Lights Out board to its factory defaults. Use the HP Lights-Out Online Configuration utility.

C:\Program Files\HP\hponcfg\hponcfg.exe /reset
25Nov/090

Remove a Range of Unwanted ZFS Snapshots from the Command Line

Remove a range of unwanted snapshots, from the command line, if necessary.
In the following example, all automatic snapshots in the bash shell are removed.

for s in $(zfs list -H -o name -t snapshot | grep @zfs-auto-snap); do zfs destroy $s; done

One could add a secondary pipe and grep statement to filter on individual file systems.

Reference: How to Manage the Automatic ZFS Snapshot Service

1Oct/090

Device Manager does not display devices that are not connected to the Windows XP-based computer

Issue:
Device Manager displays only non-Plug and Play devices, drivers, and printers when you click Show hidden devices on the View menu. Devices that you install that are not connected to the computer (such as a Universal Serial Bus [USB] device or "ghosted" devices) are not displayed in Device Manager, even when you click Show hidden devices.

Workaround:

  1. Click Start, point to Run, and type cmd.
  2. Click Ok
  3. At the command prompt, type the following command and then press ENTER:
    set devmgr_show_nonpresent_devices=1
  4. Type the following command at the command prompt and then press ENTER:
    start devmgmt.msc
  5. Troubleshoot the devices and drivers in Device Manager. NOTE: Click Show hidden devices on the View menu in Device Managers before you can see devices that are not connected to the computer.

Note that when you close the command prompt window, Window clears the devmgr_show_nonpresent_devices=1 variable that you set in step 2 and prevents ghosted devices from being displayed when you click Show hidden devices.

If you are a developer or power user and you want to be able to view devices that are not connected to your computer, set this environment variable globally:

  1. Right-click My Computer.
  2. Click Properties.
  3. Click the Advanced tab.
  4. Click on the Environment Variables tab.
  5. Set the variables in the System Variables box.

NOTE: Use this method only for troubleshooting or development purposes, or to prevent users from accidentally uninstalling a required device that is not connected to the computer (such as a USB device or docking station that is not connected to a laptop computer).

Reference: http://support.microsoft.com/kb/315539

10Aug/090

Remote Mirroring Using nc and dd

You can use the dd and nc commands for exact disk mirroring from one server to another. The following commands send data from Server1 to Server2:

1
2
Server2# nc -l 12345 | dd of=/dev/sdb
Server1# dd if=/dev/sda | nc server2 12345

Make sure that you issue Server2's command first so that it's listening on port 12345 when Server1 starts sending its data.

Unless you're sure that the disk is not being modified, it's better to boot Server1 from a RescueCD or LiveCD to do the copy.

Reference: http://www.linuxjournal.com/content/tech-tip-remote-mirroring-using-nc-and-dd

9Jul/091

rsync failed to set times on [filename]

This error occurs because the version of rsync on the system cannot preserve modified times for directories.

Run rsync with the following arguments to suppress this warning:

 rsync -avrPO ./source/* ./destination

Explanation of switches:

1
2
3
4
5
a -> Archive mode (do not preserve hard links, ACLs, or extended attributes)
v -> Verbose (I like to know what is happening)
r -> Copy directories recursively
P -> Equivalent to --partial --progress (for long transfers that may be interrupted)
O -> Omit directories from times
Tagged as: , 1 Comment
8Jul/090

Create thumbnails en-masse from a bash prompt

A simple one-liner and ffmpeg, basename, and cut gets this done.

1
for i in *.f4v; do ffmpeg -i `basename $i` -s 320x240 `basename $i | cut -d'.' -f1`.jpg; done

Thumbnail output size is configurable with the -s switch.

8Jul/092

Install VMware Tools on a Gentoo Guest

  1. emerge pciutils mkinitrd
  2. mkdir /etc/rc.d
  3. cd /etc/rc.d
  4. for i in `seq 0 6`; do mkdir rc$i.d; done
  5. File -> Install VMware Tools
  6. mount /mnt/cdrom
  7. cd /tmp
  8. tar xvfz /mnt/cdrom/VMwareTools-3.5.0-158874.tar.gz
  9. cd vmware-tools-distrib/
  10. ./vmware-install.pl
  11. All defaults with the exception of:
    /etc/rc.d -> location of the rc.d directories
    /etc/init.d -> location of the init scripts
  12. When prompted to run vmware-tools-config, decline
  13. rc-update add vmware-tools default
  14. /usr/bin/vmware-config-tools.pl
  15. Verify that everything compiles without error
  16. Reboot
  17. Verify that VMware tools are reported as running in the VI console

Note: This was tested and found working under VMware VI 3.5.x with Gentoo x86_64, kernel 2.6.27-gentoo-r8.

Tagged as: 2 Comments