• About
  • Archives
  • Categories
  • Archive for the ‘Geek’ Category

    Reset Apple OS X password


    2011 - 09.09

    I don’t know about you but administering Macs is a whore of a job. The good stuff though is the bottom end of it being a BSD/Linux system you can do stuff like reset the admin password when a user brings you their Mac from home and begging you to help:

    Power on the Mac, push and hold AppleKey+S and it’ll boot in to single user mode (God/Root)
    Do ‘mount -uw /’
    Do ‘rm /var/db/.AppleSetupDone’ (Makes the OS think it hasn’t been initiated yet)
    Do ‘shutdown -h now’

    Upon power up you are greeted with the OS thinking it’s all new and shiny. Register a new account (not one that exists) and bang, you have a new admin account and can reset the password to the old one if you wish.

    Find & Update legacy mailboxes


    2011 - 09.05

    I don’t know about you, but I still create my users using an old VBS script. It creates the users fine but the Exchange Server is 2007 so it creates a legacy-mailbox type which can’t be used from OWA.

    Easy fix, in PowerShell, search and apply mandatory properties to fix them. You can take this on the end of a VBS script if you call it from a PowerShell prompt:

    Get-Mailbox -server SERVERNAME -RecipientTypeDetails LegacyMailbox | set-mailbox -applymandatoryproperties

    Simple, eh?

    MP4 Encode and Streaming


    2011 - 08.08

    One of the things that I’ve found recently is there is an awful lot of people who struggle to use the FLV file format (yes, that means anyone who invested in something Apple-ish!). For those of us that need to be cross platform, we’ve been forced to change to newer formats.

    Luckily, most browsers now allow for directly embedding content in to the HTML but you’ll need to get it in to the right format first. This script which uses FFMPEG will do just that, and spit out a lovely HTML and MP4 file for you to upload to your site and use instantly.

    Here ya go: mp4encode

    You can play about with the HTML section as much as you like to make it generate pages on the fly. Trust me, this script has been mightily useful. Ok, so the BASH scripting probably isn’t all that and I could tidy it plenty, but it suits my needs and maybe can be adapted for yours!

    BESx Service Start Order


    2011 - 08.07

    I’m posting this more for my own benefit as I can never remember which order the Blackberry Enterprise Server services are supposed to start in, but here they are:

    BlackBerry Administration Service – Application Server
    BlackBerry Administration Service – Native Code Container
    BlackBerry Mail Store Service
    BlackBerry MDS Connection Service
    BlackBerry Dispatcher
    BlackBerry Attachment Service
    BlackBerry Controller
    All of the remaining services for BlackBerry Enterprise Server Express components

    MS Exchange 2007 Host, File Distribution & Transport Service Failures


    2011 - 08.07

    That was yet another waste of 3 hours of my life, thanks Microsoft for ruining my Sunday afternoon.

    I don’t know about you, but I have to run a nasty Exchange 2007 set up in my company environment. Awhile ago I did some updates and not until today did I bother to reboot it. Upon doing so I found that the MS Exchange Service Host, File Distribution, Replication and Transport Service Search services failed to start back up.

    After a Hell of a lot of looking about and realising I’ve already done the security certificate ignore by adding clr.microsoft.com 127.0.0.1 to my servers hosts file; I was well and truly stumped.

    Everything looked right, I increased the start up times on the services to 60000 as suggested but to no avail, and it’s just these sodding services.

    Turns out, you need to have .config files in the Exchange\Bin directory for all of the services now and to make sure that they start, they all need this magical directive:

    <generatePublisherEvidence enabled=”false”/>

    Not only that, the services that I needed to edit, some didn’t even have .config files.

    The best source of advice I found was here: http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_23823109.html (scroll to the bottom).

    failed to create drawable – Empathy


    2011 - 05.18

    I’m a big user of Empathy, it’s a great app. It connects to world+dog so when I rebuilt a PC recently with LMDE (Debian Testing via Mint) I was kinda irate to find that it didn’t work once installed.

    When running on the command line I got this:

    failed to create drawable.
    Unable to select the newly created GLX context

    Turns out that is you have MesaGLX and libclutter-1.0-0 on Debian and Ubuntu with your standard 2D driver, GTK apps such as Empathy won’t start.

    My fix was quite easy, I installed the NVidia and NVidia-glx binaries and used those in my system rather than the opensource nouveau drivers. Not only did this have a massive performance increase, the GLX issues went away.

    BESx 5 & The RefreshGALUsingMAPI Error of Doom!


    2011 - 05.11

    So my boss messages me to say his Blackberry is playing up and randomly sending some emails, receiving some emails, not syncing the calendar, etc.  The usual fix is to sign in to Bes Manager, find the user, find the device and then push a full sync.  After having done this three times and the same issues occurring I noticed something very odd.

    The Users account had marked itself for Blackberry Services removal.  No one else has access to this service so that intrigued me but also worried me.  At the same time, my blackberry also started to play up.  I deleted the users account, waited 5 minutes for it to clear and tried to re-add it but to no avail, it claimed the user still existed.  At this point I decided it would be best to restart all the Blackberry services.  In to Admin/Services.  I stopped all the Blackberry ones, then tried to restart them.  This is where all BESx failed monumentally.  All of a sudden in my eventlog I started to see this repeatedly:

    MailStoreExchange::RefreshGALUsingMAPI – Error in HrFindExchangeGlobalAddressList, result=0×80004005.
    [ODBCRecord:DeleteRecord] No rows found to delete.  SQL = “DELETE FROM MsAddresses WHERE MailStoreDomainId = ? AND SequenceNumber > ?”.
    [ODBCRecord:DeleteRecord] DATA = “MailStoreDomainId[1] SequenceNumber[0] “.

    Well that was not a good sign, and then to add to fold this one started appearing too from MS Exchange 2007:

    * Source: MSExchangeSA
    * Event Log: Application
    * Type: Error Event
    * Event ID: 9385
    * Microsoft Exchange System Attendant failed to read the membership of the
    universal security group ‘/dc=com/dc=Domain/ou=Microsoft Exchange Security
    Groups/cn=Exchange Servers’; the error code was ’8007203a’.
    The problem might be that the Microsoft Exchange System Attendant does not
    have permission to read the membership of the group.

    If this computer is not a member of the group
    ‘/dc=com/dc=domainname/ou=Microsoft Exchange Security Groups/cn=Exchange
    Servers’, you should manually stop all Microsoft Exchange services, run the
    task ‘add-ExchangeServerGroupMember,’ and then restart all Microsoft Exchange
    services.

    Now between Microsoft and Research In Motion’s technical support, I got underway trying to resolve the issues.  First thing I did was log in as the BesAdmin account locally and try and sort out the MAPI config in the way RIM suggest.  Firstly stopping all the Blackberry Services, I fired up regedit, drilled down to HKEY_CURRENT_USER\Software\MicrosoftWindows NT\CurrentVersion\Windows Messaging Subsystem\Profiles, and deleted it!  Cue the absolute horror as the server hung for over 20 mins and regedit just sat there saying NOT RESPONDING.  I eventually bit the bullet and killed the regedit process, dove back in to the registry, expanded out the profiles subkeys and time consumingly deleted each subkey (over 100 for some reason) which took ages.

    Next I fired up the Blackberry Server Configuration Tool, Blackberry Server Tab, and hit Edit MAPI.  I whacked in the server and the mailbox name and hit Check Name…. To be confronted with an error stating that the mailbox can not be found.  Highly frustrated I came to the conclusion that it wasn’t BESx all at fault here so started down the “let’s fix MS Exchange 2007 first” route.

    Fixing error 9385 isn’t actually all that difficult it turned out.  After checking all the permissions and discovering that Microsoft tell you to move the server back to the USERS OU on the A/D, it turns out you need to move the server to the Computers OU and then restart the Microsoft Exchange System Attendant service.  Once this is done, Error 9385 will disappear.

    By resolving this, it also resolved my issue with MAPI not being able to look up the BES ADMIN mailbox.  I got that sorted, and restarted the Blackberry services.  Let the EventLog Viewer become awash in:

    agent x: will not restart – reached the maximum of 10 restarts per 24 hours.

    &

    MailStoreExchange::RefreshGALUsingMAPI – Error in HrFindExchangeGlobalAddressList, result=0×80004005.

    I obviously hadn’t quite cleared the RefreshGALUsingMAPI issue.  A lot more research led me to the fact that the Global Catalog (GC) was probably not defined in the registry under the MAPI profile area.  Regedit up, back down to Profiles and then in to:

    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\BlackBerryServer\dca740c8c04210 1ab4b908002b2fe182

    Add a string value called 001e6602 and set the value to a FQDN of a Global Catalog server.  Go back and stop all your Blackberry Services.  Now start them all back up, making sure the Blackberry Controller and Blackberry Dispatcher services come up first.  Fingers crossed it should all be resolved!

    Removal of Fake Viruses and Trojans in Windows Vista/7


    2011 - 05.05

    There’s been a right spate of nasty viruses going about recently which generally get in via scripting on a website and then take over your machine.  They start hassling you about buying antivirus products and fake scan your PC and show you are very infected.  The fact of the matter is, you’re not actually that infected but since your new little virus buddy has disabled Run, Task Manager access and cmd prompt, you will feel well and truly stumped.

    Alas, you have nothing to fear if you have the slightest competence with a PC and hopefully with the command prompt.  A lot of people these days are all about the GUI, bad man, it’s bad.  You need to get some quality command line time.  Here’s the quick fix to rid yourself of the latest influx…

    Reboot your PC, before the Windows boot loader appears, get tapping on your F8 key so you can get your secret boot menu.  Choose from Microsofts carefully selected choices wisely, you want SAFE MODE with COMMAND PROMPT.  You don’t need a GUI, GUI’s are for kids, cripples and people that like their tea with milk and honey.

    Wait for lovely presented command window to appear.  Now here’s the easy task, you need to hunt down and destroy the virus.  Generally people don’t keep executables in their home folders, which is really handy as we’re about to remove any that may exist there.  Do the following and hit enter at the end of each line.

    cd \users

    You should now see your command prompt looking like C:\Users>

    dir *.exe /s /a

    This will search all files and sub-directories looking for executables.  Should it return with something like “aasdrwerwdf.exe” then you are infected.  Easy fix, let’s run a delete:

    del *.exe /s /a

    Generally that’ll give you the all clear, but some of the little bastards hide in another area, called ProgramData.  This is a hidden directory.

    cd \programdata

    dir *.exe /s /a

    If you found any .exe files then

    del *.exe /s /a

    That is about it.  Reboot your computer and you should be good to go.  I recommend you ditch Windows if you can, try Mint Linux Debian Edition (LMDE) and you’ll stay free from this hassle.

    Avidemux 2.5.4 libADM_UKGtk.so or libADM_UIQT4.so error


    2011 - 04.21

    I’ve recently just installed Avidemux 2.5.4 from a tar ball on to a Linux Mint Debian distribution.  After the install, I tried to launch avidemux2_gtk and avidemux2_qt4 and was presented by:

    ./avidemux2_gtk: error while loading shared libraries: libADM_UIGtk.so: cannot open shared object file: No such file or directory

    and

    ./avidemux2_qt4: error while loading shared libraries: libADM_UIQT4.so: cannot open shared object file: No such file or directory

     

    Long story short, I thought something was a busted.  It seems that on Debian based systems (that’ll include Ubuntu varients) you’ll need to run

    sudo ldconfig

    to allow you to launch the application.

    VLC distribution via Group Policy


    2011 - 04.19

    VideoLANs VLC is one of the most powerful and in my mind, one of the best media players out there.  It’s opensource but they drive a lot of development of the H.264 codec which is prolific in just about every way.

    One of the big annoyances how ever is, how the Hell do you roll this puppy out to Enterprise class networks… skipping the bull, how to roll to Microsoft Active Directory PCs??  Well there’s no MSI running around and I couldn’t be bothered to create one so I opted with a little script logic, whacked it in to GP under PC Start Up script and Bob, he is your Uncle.

    Download the latest VLC from www.videolan.org, grab the ZIP pack and extract it.  Dump the VLC directory on to your server share in another directory called VLC (\\server\apps\VLC\VLC).  Make a copy of VLC.exe in to C:\program files\VLC\ and then create a shortcut from there in to c:\programdata\Microsoft\Windows\Start Menu\Programs\Media\ (this is a hidden folder).  Cut and paste your link you’ve created in to \\server\apps\VLC\.  Now time for the script, copy and paste in to a text file via notepad:

    @echo off

    if exist  “%programfiles%\vlc\vlc.exe” goto end
    :: Copy VLC to Program Folder
    xcopy \\server\apps\vlc\vlc “%programfiles%\vlc” /f /h /r /y /e /i

    :: Copy shortcut to Start Menu\Media
    copy \\server\apps\vlc\*.lnk “%programdata%\Microsoft\Windows\Start Menu\Programs\Media\” /y

    :end

    Now I don’t need my script to be very intelligent.  This literally checks to see if the VLC folder exists in Program Files and if it does, quits; else it copies over what it needs to install.  Save this in to \\server\apps\vlc and call it VLCInstall.cmd.

    Fire up your GP Editor, new policy, VLC_Install, Settings Tab, Right click, edit, Computer Config, Policies, Windows Settings, Scripts, Startup.  Browser to your script, mine is at \\server\apps\VLC\vlcinstall.cmd and click ok, and close back out.  Link your policy to your group with a test PC and give it a whirl.

    Script logic wise, if you’re being clever, use version numbers for the VLC, a la \\server\apps\VLC\VLC119 and you can then test for versions and install newer ones that way, or drop a text file in to “%programfiles%\vlc” called 119.txt, 120.txt, etc and check if it needs to be copied in again that way.