14 Oct 2010

Moving Contacts from Cpanel SquirrelMail to RoundCube

Migrating old users from an entrenched system like SquirrelMail to Roundcube can be a bit of a problem when it comes to the address book. These are the quick and dirty steps to move a users address book into RoundCube.

  • Add the Address Import/Export plugin to Squirrel Mail
  • Export the Contacts
  • Convert to vCard
  • Import into RoundCube.

Add the Address Book Import/Export plugin

  1. SSH into your box and download and install the Import/Export plugin
    [dirtycode]
    cd /usr/local/cpanel/base/3rdparty/squirrelmail/plugins
    wget http://squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fwww.squirrelmail.org%2Fplugins%2Fabook_import_export-1.1-1.4.4.tar.gz
    tar -xvf abook_import_export-1.1-1.4.4.tar.gz
    rm -rf abook_import_export-1.1-1.4.4.tar.gz
    ../config/config.pl
    [/dirtycode]
  2. Choose option 8. Plugins
  3. Choose the number for  abook_import_export which will move it from avaliable to installed plugins.
  4. S for save
  5. Q for quit

Export the Contacts

  1. Login to the users Squirrel Mail, click Addresses and the bottom of the page will now have an “Address Export” option.
  2. Choose a custom text delimiter and make the box blank. This may not work for a complex address book, so you may have to play around here.
  3. Export and save the file.

Convert to vCard

  1. Visit http://homepage.mac.com/phrogz/CSV2vCard_v2.html and copy and use the site to convert to a vCard
  2. Again this works for a simple address book, one with more complex input will need more complex tools.
  3. Save the resulting file with a vcf extension.

Import into RoundCube

  1. Click “Address Book”
  2. Click the Import Button
  3. Choose your vcf file and import.

Share this
27 Sep 2010

Login, Get Report, Open in Safari, Print, Close

Just a quick and dirty way to login to backend site using curl, grab a protected report file and save to disk, open with safari, print to a preferred printer and close the window.

Perfect for printing out a daily report via a crontab on your mac.

[dirtycode]
#!/bin/bash
curl –cookie-jar /tmp/cjar –output /dev/null
http://www.xxxxxx.ca/login
curl –cookie /tmp/cjar –cookie-jar /tmp/cjar
–data ‘logine=email%40xxxxxxx.ca’
–data ‘loginp=Passw0rd’
–data ‘login=Click to Login’
–location
–output /dev/null
http://www.xxxxxx.ca/login
curl –cookie /tmp/cjar –cookie-jar /tmp/cjar
–output /tmp/report.html
http://www.xxxxxx.ca/printable_report.php?print=new&date=today
open -b com.apple.Safari /tmp/report.html
osascript -e ‘tell app “Safari” to print window 1 with properties {target printer:”Xeorox Phaser 6180MFP-N (a2:46:fe)”}’
osascript -e ‘tell application “Safari” to close (every window whose name contains “Printable Receipt”)’
echo `date` >> invoicePrintOffReport.txt
cp invoicePrintOffReport.txt /Volumes/Office Files/Bookkeeping/
[/dirtycode]

Share this
20 Feb 2010

Google Desktop Centralized Server

Google-DesktopWe have a client who makes extensive use of folders and files to store and processing incoming orders for their business. As they have experienced explosive growth the size of this system has made it harder and harder to find the correct client, or correct order quickly. What would be great for them is a centralized search index of that networked folder. Google’s product for this type of server is a $2500 Google mini, but why when Google Desktop will do this with a bit of tweaking and a third party plugin.

HOW TO: Use Google Desktop as a Centralized Server

You will need:

  1. Download and install Google Desktop.
  2. We’re mapping a network drive so we add the following to our login.bat script, or we create a login.bat and place it startup, however you want to do this.
    [dirtycode]
    net use /delete * /y
    subst z: “E:netshare”
    [/dirtycode]
    The reason is we want to map our local location to be the same drive as the client computer. We use Subst b/c it creates a drive letter that will match our clients drive letter, b/c it’s a substitute path windows will access it natively and not over the network stack, consuming much less resources.
  3. Right click on your Google Desktop icon and visit Google Desktop in a browser. Click “Desktop Preferences” and under “Don’t Search These Items” enable all you local drive except the Z drive we made earlier. Not seeing the z drive … did you run you bat file?
    • Copy  the url that google takes you to initially, http://127.0.0.1:4664/?s=xxxxxxxxxxxxx, you need the xxxx part to give to your clients.
  4. Next we install DNKA and run through the defaults with that. They should all be acceptable.
  5. Finally we need a user logged in for google desktop to work. So we enable auto login for this computer/server. Choose a user that has only the permissions the majority of your staff use, if you have protected folders under the index drive and you login as Administrator those users will see those file, they will see cached copies of them within google desktop. Either add them to the don’t index list or auto login as a more restricted user.
    • Open Regedit
    • Goto : HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon
    • Open/Create : DefaultUserName – Enter your username
    • Open/Create : DefaultDomain – Enter your domain if you have one
    • Open/Create : DefaultPasswordyour password
    • Open/Create : AutoAdminLogonset to 1
  6. For good measure I also set the screensaver password lock and set the timeout to 1 minute. So the screen will lock pretty quickly after a reboot.
  7. Edit the host file on your computer and add “127.0.0.1       desktop.google.com”, this prevents google desktop from calling home and automatically updating to a non working version.
  8. Lastly take the url you saved in 3 and change the 127.0.0.1 part to the ip or host of the machine you installed google desktop onto. http://theserver:4664/?s=xxxxxxxxxxxx, give this to you users and have them bookmark it. You’re all setup.
Share this
25 Jan 2010

New Boxee Beta 0.9.20.10408, script updated

Boxee has released a new public beta and the script links have been updated to take advantage of that. Just re-run the script with the same option you used last time.

If you used latest last time use latest again, if you didn’t you don’t need to add it. As far as the version of boxee is concerned you are always updated to the latest version when you run the script. This is what we’re beta testing after all.

Also, if you experience crashs or problems you should collect your debug logs and post them on the forums.

Follow me on Boxee and Twitter : hillbilly1980

Share this
22 Jan 2010

Boxee Bleeding Beta Baby

Check Out the Updated Post

Looks like there is alot of interest in getting Boxee Beta on the Apple TV. While we’re still waiting for an official release from Boxee I have updated our script with a few new features.

Latest:

Latest will use the latest component software instead of what’s considered most stable. Right now that is firefox 3.6 and the beta2 of adobe flash. These two upgrades will fix for the most part choppy web video. Though an occasional crash of Boxee has been seen with this combination. Running the script again without the option will downgrade your software back to the official adobe and firefox 2.0.20.

[dirtycode]

wget -m -nd http://www.green-light.ca/cmn_external/app/boxee/beta/BoxeeBetaInstallScript.sh

sudo sh BoxeeBetaInstallScript.sh latest

sudo reboot now

Nitotv — Settings — Install Software — Smart installer.

[/dirtycode]

  • when you use latest it installs nitrotv if you dont’ have it, you NEED to run the smart installer for adobe beta to work, else it hangs when loading. Once you reboot go to Nitotv > Settings > Install Software > Smart installer.

Auto -Update:

The script now detects if there is a new version of itself and downloads and runs that.

Share this
19 Jan 2010

Installing Boxee Beta on AppleTV

UPDATED: Script and Instructions in new post.

This is a little more fun then work but we’ve just upgraded our AppleTV in the office to Boxee Beta. Since Boxee Beta is not officially out yet for AppleTV I thought I’de post some condensed instructions.

The instructions have been tested and work completely on AppleTV Os version:

  • 3.0.1
  • 2.1

1. When you upgrade your AppleTV from 2 < 3 these setups will be wiped out, maybe upgrade now if you need to. Goto Settings > General > Updates and download and apply.

2. Create a patch stick, again if you haven’t already patched your Apple TV, this will give you the ability to run the installer script.

3. Open a terminal on your computer and run the following.

[dirtycode]

ssh frontrow@appletv.local

wget -m -nd http://www.green-light.ca/cmn_external/app/boxee/beta/BoxeeBetaInstallScript.sh

chmod +x BoxeeBetaInstallScript.sh

./BoxeeBetaInstallScript.sh

[/dirtycode]

When prompted the password should be frontrow.

4. Launch Boxee after the restart, Remove the Movies folder from local sources, or else you will be stuck in scrapers dooom. Settings –> Media –> Local Sources –> Movies

The hard work in this script is the work of Jim Willy over on the Boxee Forum. I have made some changes to automate more of the steps and move the location of some of the files that get downloaded to our own server since they were offline when I first tried to follow the instructions.

Upgrades:

Run the script again, if no new Boxee is out your just going to reinstall the same one again. Maybe i’ll try and make it smarter but not at the moment.

[dirtycode]

ssh frontrow@appletv.local

./BoxeeBetaInstallScript.sh

[/dirtycode]

Fix something Broken:

Pass the script the reinstall option, it will redownload and reinstall all the required components.

[dirtycode]

ssh frontrow@appletv.local

./BoxeeBetaInstallScript.sh reinstall

[/dirtycode]

Best of luck, and sorry but no warranties, this beta after all.

Keith

Share this
13 Dec 2009

Encrypted Monitoring with Zenoss

For years we have been using  Zenoss to monitor our managed systems with great success. One of its key features is the ability to use SSH to monitor remote servers. SSH by its very nature has been subject to  far more scrutiny over it’s life then protocols like WMI and SNMP, it is by its very nature meant to be exposed to the internet. By tunneling our monitoring over SSH we are able to leverage that security for our customers and our own peace of mind.

Getting SSH tunneling working in  Zenoss has always been a bit more work then it needed to be. Here is how we accomplish it, these instructions are valid as of version Zenoss 2.5, we’re monitoring an Ubuntu server in this example.

Assume: Ubuntu 9.04, Zenoss 2.5 installed via deb package.

  1. First you are going to need to install the required zenpacks to monitor your Ubuntu server completely. The Ubuntu ZenPack needs you to create the container /Devices/Servers/SSH/Linux/Ubuntu before you install it.
    1. You need the Linux Monitor, Linux Monior Add-on and Ubuntu Zen Packs.
    2. Install them in the order I’ve listed them previously by going to Settings > Zenpacks > Click the menu Arrow on the left and select “Install ZenPack…”.
    3. It’s counter intuitive but you have unzip the file before you upload it or else the install will fail , giving you a head scratching error.  Zenoss could do more to either auto unzip the ZenPack for you, or at least make the message somewhat informative as to why it’s failing.
  2. Once you’ve installed all ZenPacks you can begin to add the device you would like to monitor. Click “Add Device”  and fine the “Easy Add..” in the top right corner.
  3. After adding the hostname select “Linux Server (SSH)” and type in your ssh login details.
  4. Find the Device in the Device list and move it into the /Devices/Servers/SSH/Linux/Ubuntu class.
  5. Navigate to the device and select “Manage” > “Model Device”, this will allow you to collect rudimentary information.
  6. Return to Zenoss and Model the device again, twice. The first pass will identify the Linux distribution, the second will gather specific information for that distribution.

That’s it, in less then 10 steps. Rinse and repeat as required.

Updated: to remove steps involving installation of python monitoring scripts as per Matt’s comments below.

Share this

© 2018 Green-Light. All rights reserved.