Archive for category Technology Recipes

Extract All Regular Expression Results (Copy all regex matches to clipboard)

    This was difficult information to find.  I searched for a method using Notepad++, Vim for windows, and a few others, but finally found the easy way to do this using – of all things – Microsoft Word.


    I’ll spare you the details of the other methods I attempted and just give you the detailed answer of how to accomplish this with Microsoft Word.


    So I’ll use my scenario as the example for what you might want to use this for.


    I had a bunch of html code from which I needed to extract every instance of anchor text between the <a href=”…”></a> tags.  In this particular case here is how you accomplish this:


  1. Paste the html code you are working on into a new word document.

  2. Press ctrl+f to bring up the “Find and Replace” dialog box.

  3. In my particular case I used this code in the “Find what:” field. -> \”\>(*)\<\/a\>
  4. Your needs will most likely be different and you will need to research a bit if you’re unfamiliar with regular expressions.  Even if you are familiar with regular expressions (as I am) you’ll still probably need to do a little research to get the exact expression that will work for you.  I’m sure there are regex gurus out there who dream in regex, but in my case I find that I always have to spend more time than I would like just coming up with the syntax for the regular expression that will provide me the results I am looking for.  Microsoft Word regular expressions.


  5. In the “Search Options” portion on the bottom half of the dialog box you’ll need to check the box “Use wildcards”.  This is what enables the regular expression functionality of Microsoft Word.

  6. Just to get a preview of your results click on the “Reading Highlight” drop-down box and choose “Highlight All”

  7. Here are the results in my scenario (which is exactly what I want… well, not exactly.  I’d like to just get the text in between the <a> and </a> tags, but I don’t know how to do that in one step.  The only way I know to do it is to include the “> and the </a> at the beginning and end of the regular expression so that it captures what I’m looking for):


  8. Once you’ve verified that you’re getting the results you want by choosing “Highlight All” to preview it, then you click on “Find in” and choose “Main Document”

  9. All of your highlighted text will now actually♦ be selected.  Now right click on top of any of the selected areas in the document and click on “copy”.

  10. Press ctrl+n to create a new document.

  11. Press ctrl+v to paste what you’ve just copied to the clipboard into your new document.

  12. Press ctrl+f to bring up the “Find and Replace” dialog box again.  Now click on the “Replace” tab.

  13. In the “Find what:” field make sure you still have this code -> \”\>(*)\<\/a\>
  14. In the “Replace with:” field put this code -> “\1″ (without the quotation marks)

    Make sure the “Use wildcards” checkbox is checked and then click “Replace All”


  15. “Wallah.  She is clean.”  (Jacques on “Finding Nemo”)

  16. Kudos and thanks to Ivaylo for posting his workaround which led to my finding this solution and expanding on it here.

Tags: , ,

Windows 7 to Windows 2000 network connection

You need to tweak a registry setting in order to allow connecting to a windows share that is shared on a windows 2000 or xp machine from a Windows 7 machine. Here is the technet article that describes the registry setting that needs to be changed:

http://technet.microsoft.com/en-us/library/cc960646.aspx

Here is the relevant part from the post:

LmCompatibilityLevel

HKLM\SYSTEM\CurrentControlSet\Control\Lsa

Data type

Range

Default value

REG_DWORD

0–5

0

Description

Specifies the mode of authentication and session security to be used for network logons.

Value

Meaning

0

Clients use LM and NTLM authentication, but they never use NTLMv2 session security. Domain controllers accept LM, NTLM, and NTLMv2 authentication.

1

Clients use LM and NTLM authentication, and they use NTLMv2 session security if the server supports it. Domain controllers accept LM, NTLM, and NTLMv2 authentication.

2

Clients use only NTLM authentication, and they use NTLMv2 session security if the server supports it. Domain controller accepts LM, NTLM, and NTLMv2 authentication.

3

Clients use only NTLMv2 authentication, and they use NTLMv2 session security if the server supports it. Domain controllers accept LM, NTLM, and NTLMv2 authentication.

4

Clients use only NTLMv2 authentication, and they use NTLMv2 session security if the server supports it. Domain controller refuses LM authentication responses, but it accepts NTLM and NTLMv2.

5

Clients use only NTLMv2 authentication, and they use NTLMv2 session security if the server supports it. Domain controller refuses LM and NTLM authentication responses, but it accepts NTLMv2.

Tags: ,

Windows 7 old QuickLaunch

I do not like the large spacing that does not seem to be adjustable in the Windows 7 taskbar. I spent some time googling and found the post below that I have re-posted here. Hooray!

THE GOOD OL’ QUICK LAUNCH SOLUTION

1.Right click on the taskbar
2.Select : Toolbars—>”New Toolbar”
3.Enter this line in the folder line :

%SystemDrive%\Users\%username%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch

4.Make sure the right folder appeared on the list, then press “Select Folder”
5.Unlock the taskbar

Voila! Seems like you got the good ol’ quick launch bar

via http://windows7forums.com/windows-7-discussion/1163-taskbar-customization.html

Tags:

Ubuntu Hardy repositories

Using Command Line (Only for advanced Users)

To enable the universe and multiverse repositories using the command line, you can execute the following steps:

Open a terminal and open your sources.list file using the following command

sudo gedit /etc/apt/sources.list

Assuming you are using the default sources.list, you should be able to replace everything currently in that file with the following

## MAIN REPOSITORIES
deb http://gb.archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse

## MAJOR BUG FIX UPDATES produced after the final release
deb http://gb.archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse

## UBUNTU SECURITY UPDATES
deb http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse

If you wish to enable the backports and proposed repositories as well (recommended), then add these lines as well

## BACKPORTS REPOSITORY
deb http://gb.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse

## PROPOSED REPOSITORY
deb http://archive.ubuntu.com/ubuntu hardy-proposed main restricted universe multiverse

Now save and close the file, and then reload new source list using the following command

sudo apt-get update

If that command runs with no errors, then you have successfully enabled the universe and multiverse repositories.

via: http://www.ubuntugeek.com/how-to-enable-the-universe-and-multiverse-repositories-in-ubuntu-804-hardy.html

Tags: ,

VMWare WordPerfect Dos printing

I set up DOS printing from within a VM machine with Windows ME loaded for Allen Merrill.  Here are the steps I took.

1 – Download the AWESOME dos drivers made available here.
2 – Move the downloaded executable “wp51hplj.exe” to the WP folder.
3 – Double click it to extract the contents to the current folder.
4 – I couldn’t figure out how to change the default printer that is selected within WP for dos.  It kept defaulting back to LaserJetIIIP for me.  So, my solution was to rename the file to match the name of the printer driver that would always come up as the default when I went into the WP printer options.

Go to this columbia.edu page for full instructions on how to install the print driver for WP for Dos 5.1+ that you have downloaded.

Based on info from this site, you may need to use the built-in HP Laserjet6L PCL driver.



WordPerfect Shift F7 settings

This is the Printer settings page for WP 5.1. For me the printer would always default to HP LaserJet IIIP. From here hit "s" and it will take you to the next screen.


HP LaserJet IIIP file name

Here we see the actual name of the HP LaserJet IIIP print driver -> "HPLASIII.PRS".


We see here that the file name for the downloaded HP Dos printer driver is HL12SEPC.PRS

We see here that the file name for the downloaded HP Dos printer driver is HL12SEPC.PRS


The new printer will show up after you have copied the .PRS file into the correct folder.


HP Laserjet IIIP

Mine would always default to HP LaserJet IIIP even after I had selected the new 1200 laserjet driver.


Rename the HPLASIII.PRS file to HPLASIII.old

Rename the HPLASIII.PRS file to HPLASIII.old

Rename the new HL12SEPC.PRS file..

Rename the new HL12SEPC.PRS file..

to HPLASIII.PRS

to HPLASIII.PRS. Now it will show that you are using the HP LaserJet IIIP printer, but you are actually using the new print driver for the HL12SEPC.PRS

Tags: ,

Installing CS4

First uninstalled CS3. – 1 hour, 10 minutes! Wow..

I uninstalled and then ran the “WinCS3Clean” application provided by Adobe here -> http://www.adobe.com/support/contact/cs3clean.html

On Amber’s computer I was unable to uninstall at first. Then I logged off her profile and then logged in under mine and proceeded to uninstall under that profile. That worked without issue.

So be sure to uninstall under the same profile you installed it under if you have multiple profiles you use.

On my laptop I ran into a problem installing CS4. It spent about 20 minutes installing and then put up an error:

“Error 1603. Fatal error during installation.” I found this page at adobe’s site -> http://kb2.adobe.com/cps/408/kb408436.html

This seems to be a common error. The fix is to go to c:\windows\system32\spool\drivers\color\ and unlock the “sRGB Color Space Profile.icm” file. Use the great freeware tool “Unlocker” to do this.

Download unlocker here -> http://ccollomb.free.fr/unlocker

Best to check this file beforehand and make sure it is unlocked, then you won’t get interrupted in the installation and have to start the install over again.

Tags:

Extract Audio from DVD (VOB files)

Best and easiest way (that I’ve found) to extract audio from a DVD.

1 – Use DVD shrink 3.2 to save the VOB files for the part you want to extract.


Choose “Full disc” and then look through the structure and try different Titles (you can play it in the bottom left side) to see which part you’re trying to find.

Once you’ve figured out which “Title #” you want, then switch over to “Re-author” mode.


Scroll down on the right side until you get to the title (in this case “Title 5″) and double click it to add it to the compilation on the left.


Click on “Backup!” and then choose “Hard Disk Folder” for the “Select backup target:” field.

Choose a location to save the files to. You can either check or uncheck the “Create VIDEO_TS and AUDIO_TS subfolders checkbox depending on your preference (it actually doesn’t create any AUDIO_TS files in this case, so just leave it unchecked.. I guess it depends on the DVD)

Now use “SmartRipper” to actually extract the audio from the VOB files that DVDShrink created.

I followed this tutorial for this part. But I’m reproducing it here in case it ever goes away and is not available.

Don’t worry if this screen pops up. It still seems to work.




 

Choose the file location that you saved the VOB files to from DVDShrink in the first part by clicking on the folder and choosing it (in the upper-right corner)



Make sure everything is selected in the “Input” tab. Then click on the “Stream Processing” tab.



Make sure the “Enable Stream Processing” checkbox is checked. You can uncheck the “Video NTSC…” if you only are wanting to extract audio.


Also on the right side change the radio button to “Demux to extra file”


If the “Start” button on the left side doesn’t show up, then be sure that you’ve selected a valid “Target” in that field. It didn’t show up for me at first because it was just pointing to “vts_01″ instead of “C:\INC0NNS1\vts_01″

It needs a full path.


Now you can look in the folder you’re working with and there will be a file with an “AC3″ extension at the end.

You can open the AC3 file in Audacity just by clicking and dragging it into an open session of Audacity.

From there you can figure out the rest.




Tags: ,

fslint

findup find DUPlicate files
findnl find Name Lint (problems with filenames)
findu8 find filenames with invalid utf8 encoding
findbl find Bad Links (various problems with symlinks)
findsn find Same Name (problems with clashing names)
finded find Empty Directories
findid find files with dead user IDs
findns find Non Stripped executables
findrs find Redundant Whitespace in files
findtf find Temporary Files
findul find possibly Unused Libraries
zipdir Reclaim wasted space in ext2 directory entries

Tags: ,

CSS Block for

code{
background:#EEEEEE none repeat scroll 0 0;
border-bottom:1px solid #999999;
font-family:LiberationMono,consolas,monaco,”courier new”,courier,monospace;
overflow:auto;
display:block;
margin: 1em 0;
}

Tags:

Linux mount network share via CIFS


Place the following in the /etc/mtab file at the end of the file:

//ip.addr(or name)/sharedFolder /local/directory cifs rw,mand 0 0

Okay, so I’ve since learned that you don’t need to or even want to modify the /etc/mtab file. This file lists the currently mounted file locations or block devices. (thus “mtab”… Mount Table)

Also in the /etc/fstab you need to place the following at the end of the file:
//ip.addr(or name)/sharedFolder /local/directory cifs defaults,rw,username=username(whatever it is),password=password(whatever it is) 0 0

In the fstab entry the elements need to be separated by "tab" instead of "space" except for at the end (0 0) The 0's are separated by a space.

Tags: ,

Bad Behavior has blocked 272 access attempts in the last 7 days.

Better Tag Cloud