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 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:
Reference: http://kernel.org/pub/software/scm/git/docs/v1.7.0/howto/using-merge-subtree.html
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-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
Reset The Windows Update Catalog
- Insert the Windows Vista installation disc in the disc drive, and then restart the computer.
- When you are prompted to restart from the disc, press any key.
- 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 .
- On the Install Windows page, click Repair your computer .
- On the System Recovery Options page, click the version of the Windows Vista operating system that you want to repair, and then click Next
- On the System Recovery Options page, click Command Prompt .
- Type cd C:\windows\winsxs , and then press ENTER.
- Type ren pending.xml pending.old , and then press ENTER.
- In Registry Editor, locate and then delete the following registry subkey:
- At the command prompt, type exit to exit Registry Editor. Press ENTER.
- Click Restart
HKLM\Offline Components\PendingXmlIdentifier
HKLM\Offline Components\NextQueueEntryIndex
Reference: http://social.answers.microsoft.com/Forums/en-US/vistawu/thread/13dec2a0-2694-4b11-9b0c-9b8fbe6162ee
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.
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.
One could add a secondary pipe and grep statement to filter on individual file systems.
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:
- Click Start, point to Run, and type cmd.
- Click Ok
- At the command prompt, type the following command and then press ENTER:
set devmgr_show_nonpresent_devices=1
- Type the following command at the command prompt and then press ENTER:
start devmgmt.msc
- 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:
- Right-click My Computer.
- Click Properties.
- Click the Advanced tab.
- Click on the Environment Variables tab.
- 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
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
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 |
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.
Install VMware Tools on a Gentoo Guest
- emerge pciutils mkinitrd
- mkdir /etc/rc.d
- cd /etc/rc.d
- for i in `seq 0 6`; do mkdir rc$i.d; done
- File -> Install VMware Tools
- mount /mnt/cdrom
- cd /tmp
- tar xvfz /mnt/cdrom/VMwareTools-3.5.0-158874.tar.gz
- cd vmware-tools-distrib/
- ./vmware-install.pl
- All defaults with the exception of:
/etc/rc.d -> location of the rc.d directories
/etc/init.d -> location of the init scripts - When prompted to run vmware-tools-config, decline
- rc-update add vmware-tools default
- /usr/bin/vmware-config-tools.pl
- Verify that everything compiles without error
- Reboot
- 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.