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: , ,

ModX Manager Preview Page Problem

Wow, that was a fun little adventure.

I could not figure out for the life of me why the QM overlay for modX was not working.  When you’re logged in as admin on the backend then when you preview a page you’re supposed to get what’s called the “Quick Manager” overlay at the top.  I was getting this when inexplicably it disappeared and I was only able to get it to come back here and there.  I could not figure out what caused it to work and what caused it not to work specifically.

Here’s some pics just to make this look nice:

This is without the QM overlay.


Here it is with the QM overlay before it is extended when you hover over it (the thin little darker strip at the top)


Here it is fully extended.


So, I went through A LOT to finally figure it out.  I tested it on valleywideplumbing.com with my firefox browser by backing up the DB and the templates folder and putting them into a fresh installation on that domain.  I avoided interrupting the production environment because right now it is set up statically with .html files and the apache web server is set to give precedence to .html extensions over .php.  The modX engine works beginning with the index.php file which is located in the root folder for your modX installation.  So, since there was an index.html file there it did not matter that the index.php file was there because the .html is what was displayed.  That’s how I was able to test this in parallel with the production site running.


Anyway, from my MANY different tests I was convinced there was something wrong with my firefox install.  I completely uninstalled firefox together with searching through the registry and removing any references to firefox and mozilla there.  I did back up my extensions, passwords, etc.  with MozBackup which I am very glad I did as it was a huge time saver.  After all of that I got it to work and I thought “problem solved”.  But then it went back to not coming up again.


**Tld = “Top Level Domain”


Finally I discovered the difference.  For Valleywideplumbing.com the mod_rewrite 301 redirect for valleywideplumbing.com -> www.valleywideplumbing.com was working correctly including for the tld**/manager/ folder.  For some reason the redirect was not working correctly for brinformation.com for the tld/manager folder.  I had worked on this extensively before and could not figure out how to get it to work.  It would redirect for the tld and other folders that were created via the “#friendly urls” mod_rewrite rules, but would not for manager.  Anyway, I copied what was set up for valleywideplubming and finally got it working for brinformation.


So, that was the problem.  You HAVE TO log in to the manager using the domain name that you have configured within modx.  Ie:  www.brinformation.com if that’s how it’s set up in modx, or just brinformation.com if that’s how it’s set up.  The [(site_url)] system variable is created via the config.inc.php file which resides in /manager/includes/ and is generated with the following line of code (within config.inc.php)


$site_url .= $_SERVER['HTTP_HOST'];


So, it pulls it from the apache $_SERVER['HTTP_HOST'] variable which is based on what was requested by the user-agent (me in this case.. Or my browser on my behalf technically).  So, since I was putting in “brinformation.com/manager” and it wasn’t getting rewritten properly to www.brinformation.com/manager then when previewing the pages the url was being written correctly with the preceeding www. and so the http_host variable was different between the http://brinformation.com/manager and the http://www.brinformation.com/index.php?id=1 (or whatever page id we’re previewing)




Whew.  I think that makes sense.  Even if it doesn’t, it’s fixed!  Woohoo!

Tags: ,

Firefox 3.6.3 and Move Media Player

I spent a while figuring out what was causing firefox to go up to 99% CPU utilization and Move Media Player was not playing at all.

I found a few other posts through google of people having stability issues with firefox 3.6 in general.  But the particular fix for Move Media Player was to upgrade to the latest version of the player (of course).  But where do you find it?  I was trying to use the Move player to watch General Conference at beta.lds.org/general-conference.  As of 4/8/2010 the version they have you download is not the latest one offered by Move.

To get the most up to date one (again, as of 4/8/2010) you can click here to download.

Tags:

Democracy

This is an example of Democracy Gone Bad

Tags: , ,

Toilet Repair

I hate doing my own plumbing.  You always think you can do it quickly, but it ends up taking up your whole day.  I tell my wife, “I should be able to fix this in 30 minutes.  Definitely no more than an hour max!”  Yeah, right.

You never have all the parts you need.  You end up having to make a MINIMUM of 2 trips back and forth to home depot.  By the time you’re done you would have been better off just having a plumber do it in the first place.  If I have the money then there is absolutely no reason for me to do the work myself.  My time is much more valuable than the money it costs to have a plumber fix it for me.  They are more efficient because they know what they’re doing and my time is better used doing something that I am efficient at.. like designing a new web site or fixing someone’s computer.

Usually I find that when I need a plumber I need them right now.  I searched for emergency plumber using google maps and I saw valleywide plumbing come back as one of the top listed results.  They have great service and are very knowledgeable.  The nice thing is they already had the toilet parts that I needed.  So much nicer than making several trips back and forth to Home Depot.

If you live in Arizona and find yourself needing emergency plumbing services I highly suggest you call Valleywide Plumbing.

Tags: ,

Government assistance and Agency

The “Samuel Principle” is an interesting one.  Not sure how I feel about this, but it is interesting and worth taking note of.


http://www.ldsfreemen.com/the-coming-apostasy-of-latter-day-conservatives/

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: ,

Command line Tips

This has got to be one of the best tutorials I have seen on really helpful command line usage tips for linux: http://www.overclock.net/linux-unix/518232-linux-tips-overclock-your-command-line.html

 
 

Talks about how to move around between foreground, background tasks, how to move them between each and other good command line navigation techniques.

 
 

Documenting MythDora Install – 10.21 (VNC Remote Control with Vino)

Okay, I already went through the install, but did not get any response from the snapstream firefly remote I’m using. The problem has to do with Fedora deprecating lirc_atiusb and now using atilibusb instead.

 

I tried a few things and now yum upgrade or yum anything won’t even work. It hangs on “Loaded plugins: refresh-packagekit”

I tried a few things to fix that, but can’t fix it. I’m starting a new installation and this time I am documenting everything I do.

 

  1. Doing fresh installation
    1. Did all default options.
  2. Fished install and rebooted. Remove DVD so it doesn’t boot to it again.
  3. Go through “Welcome” setup screens.
    1. Choose defaults.
    2. Click on “Setup MythTV” which launches the new web browser based installation options.
    3. Choose “A Master backend with frontend” from the dropdown and then choose “process selections”
    4. Under “MythTV User Creation” change the mythtv password and enable the SUDO checkbox option.
  4. Turn off the default firewall with this command (to allow remote control with Vino)
    1. chkconfig iptables off
  5. Enable remote desktop control with Vino by getting to the desktop (exit mythtv) and then click on the top and clicking at the top “System->Preferences->Internet and network->Remote Desktop”

  6. Uncheck the option to allow connection and set up the security option to prompt for a password:

  7. Then you can use uvnc or any other vnc viewer to remote control the desktop using “ip-address:0″ for the connection string (replace “ip-address” with the ip address of the mythdora machine). Yeah!!!
  8. Run “yum upgrade mythdora” from the commandline after first booting into it after configuring mythTV for the first time.
    1. I ran “yum upgrade” before finding a page on mythdora.org that said to do “yum upgrade mythdora”. “Yum upgrade” upgrades everything. So, I’ll wait and see what happens. It is normal for it to take a long time before it comes up with the prompt for you to enter “y/n” to proceed with the upgrades that are available.
    2. There were 420 upgrades when I ran it:

      It sat for quite a while on “Running Transaction Test” and then again on “Running Transaction”

    3. Then it had 800 transactions to run:

     

    Okay, I went through the whole install again because I posted some things to the forum and had the following exchange:

     

    Snapstream firefly

    Submitted by mbrinson on January 24, 2010 – 7:45am.

    I’m having the same problem, but mine is a firefly RF unit. Worked great under MD5.

    I’ve spent hours searching and trying different things, but no joy.

    My model of receiver is R1000-1.

    The thing that’s strange is that when I go to edit /etc/sysconfig/lirc the file is there, but it is completely empty. I tried adding the “–driver=atilibusb” line to it but I get an error when restarting the lircd service: /etc/sysconfig/lirc: line 1: –driver=atilibusb: command not found

    I was very surprised to find that the file /etc/lircd.conf contained a line saying that it was generated by lirc-0.7(lirc_atiusb) or something like that. I have since overwritten the file with the one from here -> http://www.mythtv.org/wiki/Snapstream_Firefly that is generated by lirc-0.8.4a(atilibusb).

    Still when I run lsmod there is no entry for “lirc_atiusb” or for “atilibusb” as I’ve read in other posts should be the case.

    This is a completely fresh installation of MD10.21. I choose all of the default options and chose my remote from the list of options in the browser-based setup. From everyone else’s posts it’s supposed to just work with the defaults so I was surprised that with the default install I was finding the older version in /etc/lircd.conf

    I ran “yum upgrade” after the first run of mythtv and it all seemed to run fine. I got upgraded to .22 for mythtv but I still can not get anything for my remote. I changed the batteries in the remote so they are fresh but I get nothing when running irw and when I try irrecord I get

    “irrecord: could not get file information for /dev/lirc

    irrecord: default_init(): No such file or directory

    irrecord: could not init hardware (lircd running ? –> close it, check permissions)”

    Anyone have any thoughts?

    Thank you so much! Obviously the WAF is very low right now.

     

    What are the contents of
    Submitted by pisani on January 24, 2010 – 8:21am.
    What are the contents of your /etc/sysconfig/lirc file?
    I believe it should read something like this: “LIRCD_OPTIONS=’-H atilibusb’”
    You can also check to make atilibusb is compiled in (if yum upgrade changed your lirc version) at the commandline with lirc -H –help.
    Ryan

     

    My /etc/sysconfig/lirc file

    Submitted by mbrinson on January 24, 2010 – 8:35am.

    My /etc/sysconfig/lirc file is completely empty.

    I ran the lirc -H command and I got “bash: lirc: command not found”

     

    Sorry, I realized it needs

    Submitted by mbrinson on January 24, 2010 – 8:38am.

    Sorry, I realized it needs to be lircd for the command.

    Here’s what I got:

    lircd -H –device=atilibusb

    Driver `–device=atilibusb’ not supported.

    Supported drivers:

    accent

    alsa_usb

    asusdh

    atilibusb

    audio

    audio_alsa

    bte

    bw6130

    commandir

    creative

    creative_infracd

    default

    devinput

    dsp

    dvico

    ea65

    i2cuser

    irlink

    irman

    livedrive_midi

    livedrive_seq

    logitech

    macmini

    mp3anywhere

    mplay

    mouseremote

    mouseremote_ps2

    null

    pcmak

    pinsys

    pixelview

    samsung

    sb0540

    silitek

    tira

    udp

    uirt2

    uirt2_raw

    usb_uirt_raw

    usbx

     

    Okay, obviously I don’t know

    Submitted by mbrinson on January 24, 2010 – 8:48am.

    Okay, obviously I don’t know what I’m doing. Go easy on me. :)

    I finally found the right syntax and here is the result:

    “lircd -H atilibusb”

    lircd: there seems to already be a lircd process with pid 2024

    lircd: otherwise delete stale lockfile /var/run/lircd.pid

    So I stopped the lircd with “/sbin/service lirc stop” and then ran “lircd -H atilibusb” and then I ran irw and it WORKS!!

    So why wouldn’t this work by default since I used all the default install options for MD10.21?

    More importantly, where do I add this so that it autostarts and is running correctly?

    Thank you so much!!! You are the best!!!!

     

    When you did you install,
    Submitted by pisani on January 24, 2010 – 9:40am.
    When you did you install, did you check the mythdora-updates repo to be active during the install? I think we made a fix for this after the release, and you’d have had to upgraded the mythdora rpm or checked it to update in the installer basically.
    If you missed enabling mythdora-updates it wouldn’t have had the proper fixes when you ran through the setup.
    Also, you could have re-run the infrared device configuration from the mythdora-settings menus.
    Ryan

     

    Thanks for the reply Ryan.

    Submitted by mbrinson on January 24, 2010 – 9:46am.

    Thanks for the reply Ryan. I was afraid to enable any other packages. When you say to enable the mythdora-updates you mean to check that additional repository during the install right?

    I checked a few additional repositories the first time I installed and it said I had some conflicts or something and then I had to re-run the install from the beginning as it errored out with some kind of a bug message.

    I want to be sure I’ve got it set up as stable as possible so if that’s what I need to do then I will re-run the installation from the start and wipe everything out again.

    Thanks again!

     

    No. You don’t need to wipe
    Submitted by pisani on January 24, 2010 – 10:38am.
    No. You don’t need to wipe anything. I was just asking if you did that step or not, which would explain why it didn’t work the first time.
    You should run this from the command line as root however:
    yum upgrade mythdora
    To upgrade to the stable mythdora rpm.
    Ryan

     

    Just to follow up for anyone

    new

    Submitted by mbrinson on January 25, 2010 – 10:34pm.

    Just to follow up for anyone else going down the same road. I went ahead and reinstalled from scratch again and enabled the mythdora-updates package to see if the remote would work by default. It still did not work.

    The key to getting it to work is to copy the updated /etc/lircd.conf file from this wiki page -> http://www.mythtv.org/wiki/Snapstream_Firefly

    After copying that into the lircd.conf file then it did work without me having to add the “LIRCD_OPTIONS=’-H atilibusb’” line to the /etc/sysconfig/lirc file. So choosing to enable the mythdora-updates repository must have allowed it to add that line, but somehow it does not enable the correct /etc/lircd.conf file to be included by default.

    Thanks again for the help pisani. You guys are just incredible. :)

     

    Pasted from http://www.mythdora.com/?q=node/4263#comment-20040

     

For errors with “yum install” hanging on “Loaded plugins: refresh-packagekit” the way I was able to get it moving on again was to deactivate a couple of repositories. I went through the gui interface


and unchecked Fedora 10 – i386, Fedora 10 – i386 – Updates, and Livna for Fedora Core 10 – i386 – Base


Then it started working again.

 
 

Here’s a cool addon that should be installed for music visualizations:

 

ProjectM in Fedora 10/11

With Fedora 10 and 11, ProjectM seems to work through libvisual with MythMusic. There’s no need to do any mods, standard Fedora packages (libvisual, libvisual-plugins, projectM-libvisual) seem to work fine!

 

Pasted from http://www.mythtv.org/wiki/ProjectM

 

Just “yum install

” and it should work. I’m about to try it and will report back.

 

HERE IS THE CRUCIAL lircd.conf FILE

 

# Please make this file available to others
# by sending it to


#
# this config file was automatically generated
# using lirc-0.8.4a(atilibusb) on Mon Nov 24 14:58:45 2008
#
# contributed by
#
# brand: lircd.conf
# model no. of remote control:
# devices being controlled by this remote:
#

begin remote

name lircd.conf
bits 16
eps 30
aeps 100
one 0 0
zero 0 0
pre_data_bits 8
pre_data 0×14
post_data_bits 16
post_data 0×0
gap 147992
min_repeat 5
toggle_bit_mask 0×80800000

begin codes
MAXI 0×812C
MAXI 0×01AC
CLOSE 0×5702
CLOSE 0xD782
1 0×620D
1 0xE28D
2 0×630E
2 0xE38E
3 0×640F
3 0xE48F
4 0×6510
4 0xE590
5 0×6611
5 0xE691
6 0×6712
6 0xE792
7 0×6813
7 0xE893
8 0×6914
8 0xE994
9 0×6A15
9 0xEA95
0 0×6C17
0 0xEC97
BACK 0×6B16
BACK 0xEB96
ENT 0×6D18
ENT 0xED98
VOL+ 0×5E09
VOL+ 0xDE89
VOL- 0×5D08
VOL- 0xDD88
MUTE 0×5F0A
MUTE 0xDF8A
FIREFLY 0×5500
FIREFLY 0xD580
CH+ 0×600B
CH+ 0xE08B
CH- 0×610C
CH- 0xE18C
INFO 0×832E
INFO 0×03AE
OPTION 0×842F
OPTION 0×04AF
UP 0×6F1A
UP 0xEF9A
LEFT 0×721D
LEFT 0xF29D
DOWN 0×7722
DOWN 0xF7A2
RIGHT 0×741F
RIGHT 0xF49F
OK 0×731E
OK 0xF39E
MENU 0×711C
MENU 0xF19C
EXIT 0×7520
EXIT 0xF5A0
REC 0×7C27
REC 0xFCA7
PLAY 0×7A25
PLAY 0xFAA5
STOP 0×7D28
STOP 0xFDA8
REW 0×7924
REW 0xF9A4
FWD 0×7B26
FWD 0xFBA6
PREV 0×802B
PREV 0×00AB
PAUSE 0×7E29
PAUSE 0xFEA9
NEXT 0×7F2A
NEXT 0xFFAA
MUSIC 0×5B06
MUSIC 0xDB86
PHOTOS 0×5A05
PHOTOS 0xDA85
DVD 0×5904
DVD 0xD984
TV 0×5803
TV 0xD883
VIDEO 0×5C07
VIDEO 0xDC87
HELP 0×5601
HELP 0xD681
MOUSE 0×822D
MOUSE 0×02AD
A 0×6E19
A 0xEE99
B 0×701B
B 0xF09B
C 0×7621
C 0xF6A1
D 0×7823
D 0xF8A3
end codes

end remote

Pasted from http://www.mythtv.org/wiki/Snapstream_Firefly

 

Option “UseEvents” “True”

 

Pasted from http://mythdora.com/?q=node/4897

 
 

Outlook Profile backup

I googled for quite some time but could not find anything…

I knew there was a registry key for this but it wasn’t so easy to find….

after digging the net / google for more than 30 minutes, I finally found the way to do it…

Just locate the following key in registry (start – run – regedit):

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook

Then right click on the key, outlook and select option, Export…save it anywhere you want…

and run it while restoring your outlook.

This will restore your old outlook profile with all email accounts and rules.

But, you will have to enter passwords for the accounts again. It does not store the user passwords.

Pasted from <http://www.whoisdeep.com/2006/03/07/backup-email-accounts-in-microsoft-outlook-2003/>

Tags: ,

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

Better Tag Cloud