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
27 Jan 2010

Apple A4

A few years ago Steve Jobs made a bit of a deal about the fact that the chips of the day had terrible power/watt performance. Chips then and now needed alot of power to do their calculations, they ran hot and they were inefficient, in mobile devices this combination is a battery killer. Apple wanted better and bought PA Semiconductor back in 2008 to do better.

apple-a4

“PA Semi is going to do system-on-chips for iPhones and iPods,” Steve Jobs


With the release of the A4 we have seen come to light Apples first home brewed System on a Chip ( SOC ). Running at 1Ghz it’s one of the fastest in the industry and being able to watch Video for 10 hours straight attests to Apple’s claims about it’s power efficiency.

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

© 2018 Green-Light. All rights reserved.