Search This Blog

Saturday 31 July 2010

Save flash (flv) files locally

This requires Safari & WGET

1. From the Safari menu select Window | activity
 This will display a list of current sites that are open.  In the window you want to capture the media file from start it playing.  In the list you'll see a .flv file.  It will probably be the biggest file size.

2. Copy the URL

3. Run a command prompt and find wget.exe


wget <url>/<file-name>
wget http://www.server.com/files/flash.flv

Wednesday 28 July 2010

UCS TACACS bug caused hardware reset

One of our Cisco UCS Fabric interconnect 6100 switches reset itself for no apparent reason.  A call to Cisco TAC, which progressed to dev found a problem caused by too many TACACS authentications causing a memory fault.

We use Zenoss for NMS which authenticates pretty frequently using TACACS .. and so pushed it over the limit.

The only fix is to switch back to local authentication until a patch is released.

Saturday 24 July 2010

Ubuntu 10.04 netbook install on Sony Vaio

I have a really old Vaio,  PCG-TR5MP, I think circa 2004.  I use it really as a travelling backup for my photos and earlier in the year upgraded it to a massive 1Gb RAM and installed Windows 7.  Which worked surprising well and actually better than XP !

Having recently acquired a Mac book which I'll now carry around I thought I'd try one of the netbook versions of Linux on the Sony. Just for giggles.

I've always preferred the Ubuntu distro so went with 10.04 ..

First problem was the Vaio BIOS doesn't support USB boot .. So burnt a CD/DVD.

Boot, install starts, pretty graphics, black screen .... nothing.  Google.  Apparently its an issue with the intel chipset - https://wiki.ubuntu.com/X/Bugs/Lucidi8xxFreezes

To resolve :
1) At the purple screen with a keyboard and stickfigure, press Enter to get to the menu.
2) Hit Enter to select your language, and then press F6 and then Esc.
3) Add "i915.modeset=1" after "quiet splash".
4) Press Enter to boot the LiveCD.
This then installed, but on the first reboot again stuck on the black screen .. so to fix and boot follow :

1) Hold down Shift while booting to enter the GRUB menu.
2) Press 'e' to edit.
3) Add "i915.modeset=1" after "quiet splash".
4) Ctrl+x to boot.

Ubuntu loaded, logged in .... WTF ... the GUI is slow as anything, unusable. 

I then ran :
echo options i915 modeset=1 | sudo tee /etc/modprobe.d/i915-kms.conf
sudo update-initramfs -u
Which I think make the i915 changes permanent ..

and
sudo add-apt-repository ppa:glasen/intel-driver 
sudo apt-get update && sudo apt-get upgrade
Rebooted and the GUI was much better ...

For the hell of it I also did :
sudo add-apt-repository ppa:glasen/855gm-fix
sudo apt-get update && sudo apt-get install dkms 855gm-fix-exp-dkms

I think I did most of this out of order but ultimately I have a functioning install now.

This is why Linux will not win .. sorry Linux people.

Sunday 18 July 2010

Just going out to vacuum the car ...... 11 hours later

What started as a quick inside clean quickly turned into a mammoth car cleaning lasting 11 hours over two days.


I'd bought all the products months ago and never got around to using them.  But today it was out with the wax, clay and all the other expensive things that had never been used.  In for a penny ..


Day 1


Starting with that quick vacuum.  All the inside wiped down, vacuumed and treated with leather and vinyl products.


Washed the outside with Dodo Juice born to be mild shampoo.  Hosed down and clayed with dodo mild clay.  This was actually way easier than I thought it would be and surprisingly little crap came off the car.


Dried the car and cracked open the dodo juice lime prime lite.  Followed the instructions and did a panel at a time and buffed it off.


Wax coat number one.  Another dodo juice product.  Purple haze.  Went on and came off just remarkably easily. 


Its getting late and the wax needs to cure over night so I turned my attention to the wheels.  Really they are the catalyst for this.  When we were in Wales a few weeks ago allot of the roads where being re-surfaced and unbeknown to me tar and stones had welded themselves onto the inside of the wheels like limpets. 


So a quick soapy wash and then to google for 'clean tar from wheels' search.


Day 2


Wax coat number 2 .. 


Wheels.  Other than expensive products, which I'm certainly not against, the best answer for the tar seems to be good 'ol WD40.  Soak a the corner of a rag and start with the elbow grease.  IT WORKS !  Just takes hours.


Once the tar was off then another wash, rinse and dry. Applied some Rim Wax (snigger) and some vinyl dressing to the plastic and rubber seals, and under the bonnet, and the outside of the tires.






And finished ... An epic session.  But I'm actually really pleased with the results and you can actually feel the coating of wax, which I was surprised by.





Saturday 17 July 2010

The car gods shined down on me


Bertie (the boxster) MOT & Porsche 111 point check for the extended warranty.  There was I expecting an enormous invoice but all we got was a PASS & another PASS.  Even the tires will be OK for the 3000 mile French blast in September.

The OPC (Official Porsche Centre) in Mid-Sussex, Burgess Hill have been fantastic throughout the whole process, purchase and after care.  And they didn't slap us with a massive bill, al thought I'm braced for that ..

And in addition we got to spend the day in a Porsche Panamera 4 courtesy car.  The new 4 seater luxury, family market saloon(?).  Whatever its aimed at it was a fantastic car.  I was in gadget heaven and pulled some good looks from passers by.  

Oh, I just looked up price ! .. starting at £66,900 - no wonder we got funny looks with Vanilla Ice cranked up.  Probably thought it was stolen.

Couple of niggles which would bug the crap out of me if I owned one, not that I can afford it ..
  • The warp factor 1 & 2 buttons (Sports & Sports Plus) are on the centre console but on the other side of the shift stick.  They'd be better on the drivers side.  I'm guessing this a RHD conversion cost saving thing.
  • Whatever I tried I couldn't get road numbers - other than seriously main ones, to appear on the sat nav.
  • The fuel gauge takes about 5 mins to really display what's in the tank after filling up.  A pain when you have to get the car back with 'just under full'.


Wednesday 14 July 2010

Microsoft DNS update script - dnscmd

We recently made the decision to use AD DNS internally rather than the mish mash of AD & BIND.  One of the downsides was the inability for bulk load changes.  The DNSCMD command line app is limited.

This is my attempt to fix that with a script.  It deals with creating A & CNAME forward records and cleans up and creates PTR from an input file bulk_load.txt

DNSCMD doesn't deal with existing A records.  The majority of the script deals with finding those and deleting the FWD and REV records.

Feel free to copy, currently its still in test so use with care.

Amendments/suggestions, all welcome .. there are a few hacks in it which I'm sure can be cleaned up.  

And yes it could probably be done on 5 lines in something else.  I just don't know something else.
@ECHO OFF
::        // Paul Regan - 14/7/2010/7/14/2010
::        // This script will take input from dns_bulk.txt, which must be forward zone A or CNAME records.
::        // First check if the entries already exist.  If they do it will prompt to continue.
::        // It will then delete the forward and reverse entries and create the new from the file.
::        // Through-out this script there are a number of hacks due to DNSCMD's inability to produce decent return codes. I rely on
::        // piping STNDOUT through FIND & FC to check FOR response and generate the correct errorlevel
::        // Check the help (/?) for bulk_dns.txt format

IF "%1" == "" GOTO ERROR
IF "%1" == "/?" GOTO HELP
IF "%1" == "?" GOTO HELP

::        // A quick check that bulk_dns.txt EXISTs and confirm its the file to be used
IF EXIST bulk_dns.txt (
    GOTO BULK_EXISTS
) ELSE (
    CLS
    ECHO.
    ECHO.      ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
    ECHO.
    ECHO       bulk_dns.txt is missing !
    GOTO END
)

:BULK_EXISTS
CLS
ECHO.
ECHO     This is the bulk_txt I found ...
ECHO.
TYPE bulk_dns.txt
ECHO.
ECHO.
ECHO.
CHOICE /C YN /M "continue and use this file ? Press Y for Yes, N for No
IF %ERRORLEVEL%==1 GOTO BEGIN
IF %ERRORLEVEL%==2 GOTO END

:BEGIN
::        // Sets the DNS Server to be used from the STNDIN
SET DNS-SERVER=%1

::        // Clean up any old working files
IF EXIST revip.txt DEL /f /q revip.txt >NUL
IF EXIST recorddeleted.txt DEL /f /q recorddeleted.txt >NUL
IF EXIST recordsexist.txt DEL /f /q recordsexist.txt >NUL
IF EXIST rev-recordsexist.txt DEL /f /q rev-recordsexist.txt >NUL
IF EXIST recordcreated.txt DEL /f /q recordcreated.txt >NUL
IF EXIST summary.txt DEL /f /q summary.txt >NUL
IF EXIST doesntexist.txt DEL /f /q doesntexist.txt >NUL

::        // Reset the variable and then extract the zone from bulk_dns.txt & SET.  We do this as the zone will be common to all commands
SET ZONEFILE=
FOR /f "tokens=2 delims=," %%1 IN (bulk_dns.txt) DO SET ZONEFILE=%%1

::        // loop to determin if any records already exist as we need to first delete them. -->
::        // In theory DNSCMD should return :
::        //  0 = host found
::        //  9714 = host not found
::        // in practice it didnt, possibly to do with the FOR loop.  A hack is to pipe the STDNOUT through find.  A DNS hit response includes @
::        // SetLocal / EndLocal deals with variables being used in a FOR loop, allows the FOR loop to return the correct ERRORLEVELs per loop
CLS
ECHO.
ECHO Checking for existing records ............
ECHO.
SETLOCAL EnableDelayedExpansion
FOR /f "tokens=1-4 delims=," %%1 IN (bulk_dns.txt) DO (
        DNSCMD %DNS-SERVER% /EnumRecords %%2 %%1  | FIND "@"
    IF !ERRORLEVEL! == 0 (
        ECHO %%1.%%2,%%3,%%4 >> recordsexist.txt
    ) ELSE (
        ECHO %%1.%%2 Doesn't Exist >>doesntexist.txt
    )
)
ENDLOCAL
::        // Check to see if recordsexist has been created, and action, o/wise jump to create
IF NOT EXIST recordsexist.txt GOTO :CREATE
::        // Display existing host entries and give an opt out prompt using the file generated from the /EnumRecords loop
CLS
ECHO.
ECHO ******  The following host entries already EXIST *******
ECHO.
TYPE recordsexist.txt
ECHO.
ECHO.
ECHO.
CHOICE /C YN /M "continue ? this will delete and then re-create from bulk_dns.txt Press Y for Yes, N for No
IF %ERRORLEVEL%==1 GOTO DELETE
IF %ERRORLEVEL%==2 GOTO BOMBOUT
GOTO END

:BOMBOUT
GOTO END

:DELETE
::        // Start loops to delete existing A, CNAME & PTR DNS entries
::        // DNSCMD returns a 0 FOR /RecordDelete and exactly the same output regardless IF a delete fails or even IF you attempt
::        // to delete a host that doesnt EXIST.
::        // So its pointless doing any errorlevel checks.  We'll assume that we got this far and they EXIST and we'll be able to delete them
CLS
ECHO.
ECHO Deleting forward zone records ............
ECHO.
FOR /f "tokens=1-9 delims=.," %%1 IN (recordsexist.txt) DO DNSCMD %DNS-SERVER% /RecordDelete %ZONEFILE% %%1 %%9 /f
::        // We now need to clean up the reverse records & will create a rev dns working file from the records in recordsEXIST.txt
::        // Parse the txt file and extract the 'A' records to a new txt file.
CLS
ECHO.
ECHO Fordward records deleted, now the rev zone........if no rev zone exists you will see errors during this process.
ECHO.
TYPE recordsEXIST.txt | find "A" >> rev-recordsexist.txt
::        // Parse that txt file and create a another file with the reverse ip host names
FOR /f "tokens=5-8 delims=,." %%a IN (rev-recordsexist.txt) DO ECHO %%d.%%c.%%b.%%a.in-addr.arpa >>revip.txt
::        // Phew, now we can delete the in-addr.net records using this text file
::        // DNSCMD returns a 0 FOR /RecordDelete regardless so its pointless doing any errorlevel checks
FOR /f "tokens=1-6 delims=." %%a IN (revip.txt) DO DNSCMD %DNS-SERVER% /RecordDelete %%b.%%c.%%d.%%e.%%f %%a PTR /f

:CREATE
CLS
ECHO.
ECHO Create foward and rev records.......if rev zones dont exist you may see errors.
ECHO.
::        // And now, finally, create the host entries
FOR /f "tokens=1-4 delims=," %%1 IN (bulk_dns.txt) do DNSCMD %DNS-SERVER% /RecordAdd %ZONEFILE% %%1 /CreatePTR %%4 %%3
::        // Run a quick /EnumRecords check to confirm records where created and then produce a comparison file of that output to bulk_dns.txt
::        // The | find "@" just removes a bunch of white space from STDOUT
FOR /f "tokens=1-4 delims=," %%1 IN (bulk_dns.txt) do DNSCMD %DNS-SERVER% /EnumRecords %%2 %%1 | FIND "@" >> RECORDCREATED.txt
FC recordcreated.txt bulk_dns.txt | FIND /V "Command" | FIND /V "records" >> summary.txt
CLS
TYPE summary.txt | MORE
ECHO.
ECHO You can review the comparison afterwards with summary.txt
ECHO.
PAUSE
GOTO CLEANUP

:HELP
CLS
ECHO.
ECHO.
ECHO      This script takes input from bulk_dns.txt, checks FOR EXISTing records and then deletes and creates A or CNAME records.
ECHO      It will automatically deal with PTR records, there is no need to put them in bulk_dns.
ECHO.
ECHO      ***** "ONLY USE THIS ON ONE ZONE NA OR EU [eu|na].rtdom.net at a time, NOT A MIX .. !" *****
ECHO.
ECHO      bulk_dns.txt FORmat
ECHO      ",,,"
ECHO.
ECHO      eg A Record
ECHO      server,eu.rtdom.net,A,10.2.66.66
ECHO.
ECHO      eg CNAME Record
ECHO      server,eu.rtdom.net,CNAME,lo-inf-999.eu.rtdom.net
ECHO.
ECHO      The FORmat of the script command is dnscmd ""
ECHO.
ECHO      I have generated an example_bulk_dns.txt FOR reference.
IF EXIST example_bulk_dns.txt DEL example_bulk_dns.txt /f > NUL
ECHO anArecord,eu.rtdom.net,10.2.65.13,A >> example_bulk_dns.txt
ECHO aCNAMErecord,eu.rtdom.net,anArecord.eu.rtdom.net,cname  >> example_bulk_dns.txt
GOTO END

:ERROR
CLS
ECHO      *********** FAIL **************
ECHO.
ECHO script /? For help
GOTO END

:CLEANUP
IF EXIST revip.txt DEL /f /q revip.txt >NUL
IF EXIST recorddeleted.txt DEL /f /q recorddeleted.txt >NUL
::        // Removed this so the user can review the hosts that existed and where over written
REM IF EXIST recordsexist.txt DEL /f /q recordsexist.txt >NUL
REM IF EXIST doesntexist.txt DEL /f /q doesntexist.txt >NUL
IF EXIST rev-recordsexist.txt DEL /f /q rev-recordsexist.txt >NUL
IF EXIST recordcreated.txt DEL /f /q recordcreated.txt >NUL


:END

Tuesday 13 July 2010

Adding Google Analytics code to Blogger site

Add the url to analytics and cut and paste the script.

Login to your blog and from the main page click 'design' | 'edit HTML'.  Search the text for /body and insert your code just above it.


Before the final /body tag


</table>
<br clear="all" />
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17416825-2']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</body>
</html>

Adding Google Analytics to PHPBB


Create the profile as normal and past the code snippet into your :


/styles/<your_style>/template/overall_footer.html

Before the final /body tag


</table>
<br clear="all" />
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17416825-2']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</body>
</html>

If your using multiple styles then you'll need to update each .html file
Once done make sure your clear the forums cache in the Admin panel.

Monday 12 July 2010

Chili scovile rating

I've been growing some Scotch bonnets  ....everything above Naga Jolokia are chemical extracts of capsaicin.  So not really chili's

NYC in Summer time


My watch stops @ 40c .. at one point it stopped ..