Wednesday, December 29, 2010

printing to a receipt printer from OpenBravo POS

P had installed a new POS system on a Win7 Lenovo netbook and was having trouble printing to the USB receipt printer. It was printing, but leaving a lot of blank space at the top before printing and cutting the receipt. Finally fixed it by going to the printer properties, and in the paper settings, choosing 'Conserve paper' 'Top and Bottom'. The font is also different from the one seen in his other POS, which runs Linux. Probably because the Linux machine is printing to a driver similar to Generic Text. Trying Generic Text driver on the Win7 box gave the "correct" font, but the layout was awry. Probably an issue with paper settings for that driver, too. Anyway, since the smaller font is OK, he'll probably go with the Epson driver.

Edit: P adds:
Finally was able to get this work with correct font size.

Suggestion from this forum post.

Solution:
Epsons POS website had the latest virtual COM port software which works for Windows 7: TM Virtual Port Driver Ver.5.00aE . Assigned the printer to COM1 through the software and changed the openbravo pos settings to Printer: epson -> Serial -> COM1

Tuesday, December 28, 2010

set mime types in Plesk

Noticed that after the server migration, the pls and asx files were no longer being served from www.radiosai.org - so went into the Plesk control panel,
radiosai.org -> Virtual Directories -> Mime types tab and added
asx - video/x-ms-asf
pls - audio/x-scpls

upgrading ActiveSync and more

A brought a Toshiba Portege for me/A. When I attempted to sync it, it wanted me to upgrade to ActiveSync 4.5 from 4.2. After doing that, syncing from the old phone no longer does Contacts Sync - it says install Outlook for that functionality. So, for now, using ActiveSync merely as a connection mechanism to manually transfer files. Initially internet connectivity using ActiveSync did not work. Then changed the Connection settings on the desktop, "This computer is connected to:", changing the dropdown to The Internet



Also, as this post points out, changed the Remote NDIS host setting on the mobile so that the "Unable to obtain IP address" error stops popping up.

Wednesday, December 08, 2010

gmail pop3 captcha

Found an issue with pop3 not working on our automated bounce processing - fetchmail could not fetch mail from gmail and gapps accounts. At first I thought it was the problem with the issue reported here, and that I had to go to http://www.google.com/accounts/DisplayUnlockCaptcha

Did all that, but actual problem was a change in password from sssbpt.org. Fixed that, and everything started working again.

Tuesday, December 07, 2010

cyberoam failover tweak

By default, cyberoam failover rules checks pings to the default gateway and fails-over if the pings fail. But in our case, the default gateway itself is ususally fine, it is the link to Bangalore which fails. So, it needs to ping the Bangalore end of the link and if that fails, failover. Changed the rule accordingly in cyberoam, works well now.

Monday, December 06, 2010

upload through cyberoam - problem solved

In a previous post, I'd mentioned that the Studio people have problems uploading stuff - ftp / yousendit / vimeo et al. Found a workaround - disable virus / spam scanning in the firewall rules. You can, of course, do this for only the particular host you are uploading from.


That is, clear all the check-boxes in the last line in the image above.

Sunday, December 05, 2010

problems with kindle not connecting to wifi - solved with static ip address

K had some issues with his Kindle not connecting to his wireless router at home. He tried many things including changing the security settings to WPA and even to unencrypted. Still did not connect. Finally he put in a static ip address instead of getting the ip address from the router, and this worked like a charm. So, don't rely on the DHCP server running on routers for connecting mobile devices. I did not even try to connect my Windows mobile to Airport at home with DHCP, since even my Windows laptop had problems with the Airport's DHCP. Static IPs work with no problems.

K was initially turned off since a DNS server IP address is required. You can always give the google public dns ip address of 8.8.4.4 or 8.8.8.8 if your router itself does not do a good job of providing a stable dns server. OpenDNS is also available, 208.67.222.222 and 208.67.220.220

Thursday, December 02, 2010

uploads problems with Cyberoam

The Studio people have problems uploading stuff - ftp / yousendit / vimeo - using the Cyberoam 50ia as the gateway. For all of last month, P was directly connecting a laptop to the gateway directly for uploads. So is there a solution with Cyberoam support, or do we have to make a workaround with another router etc?

Wednesday, December 01, 2010

thumbnail images for saicast

Ran a thumbnail factory this morning for saicast, generating 15 thumbnail images. On DG's guidance, this was my procedure.

Saved http://saicast.org/images/gangacanal.jpg on my system as saicast4x3.jpg

Opened it in Gimp and found the dimensions of the image alone excluding the frame to be 171 x 127

Then, opened the vimeo videos one by one, played them till a suitable frame, paused and hit printscreen, pasted into Gimp, cropped to a suitable 4x3 frame, resized to 171x127, pasted into the selection on saicast4x3.jpg and then exported as whatever.jpg.

Wednesday, November 24, 2010

live streaming with stock laptop

Used the daily-use machine for live streaming on 23 November, with just its built-in soundcard. Reaper was running as something for me to monitor the waveform and also as an archive copy of the stream. Srv ran the mix through his Yamaha mixer from Chennai and used the Alesis compressor from the Studio to give me a compressed mix. My nominal input level for 0 dB for -10 dBV signal was as shown.

I rode the rec-level fader since Srv was monitoring before the compressor. Maybe next time a better choice of compressor settings can avoid my having to ride the faders. Anyway, output level was respectable, near -12 dB RMS, after the first few minutes when I was not riding the faders close enough and the compressor was not set on the output.

Saturday, November 20, 2010

direct download to kindle

Playing around with the Kindle got for A - Latest Generation Wifi. Can download directly to the kindle by browsing gutenberg.org. But can't load to the kindle from email attachments. I think it's because the kindle's experimental browser does not support redirects and most webmail services have a redirect for attachments. Pointing the kindle to the direct link after deciphering the redirect's URL encoding, it loads the content with no issues. This works with the content emailed by yourkindlename@free.kindle.com too.

Sunday, November 14, 2010

smtp timeout errors

After introducing the Cyberoam 50ia as the gateway at the studio, there were some teething troubles. When one of the two redundant links went down, the device would refuse incoming connections on the other link also. The management services would then have to be restarted from the console. Also, occasionally krishna had some smtp timeout issues even after the links were up. These were solved by restarting krishna.

Friday, November 12, 2010

qshape for checking postfix queue

One of the tools for checking the sending of our emails - qshape.
Some results from 5 days back when the problem was first detected:

sudo qshape -s incoming active deferred
shows
T 5 10 20 40 80 160 320 640 1280 1280+
TOTAL 33626 0 0 0 0 0 0 0 4 9645 23977
radiosai.org 32886 0 0 0 0 0 0 0 4 9645 23237
sssbpt.org 740 0 0 0 0 0 0 0 0 0 740
Out of these mails, most of them were yahoo.

sudo qshape incoming active deferred
T 5 10 20 40 80 160 320 640 1280 1280+
TOTAL 33623 0 0 0 0 0 0 0 4 9645 23974
yahoo.com 24602 0 0 0 0 0 0 0 3 6365 18234
yahoo.co.in 7809 0 0 0 0 0 0 0 1 2903 4905
airtelbroadband.in 154 0 0 0 0 0 0 0 0 30 124
yahoo.in 127 0 0 0 0 0 0 0 0 72 55
spml.co.in 82 0 0 0 0 0 0 0 0 20 62
lycos.com 67 0 0 0 0 0 0 0 0 13 54
.... snip .....

Wednesday, November 10, 2010

bug - some files not imported into database

When there is a file with the same download file name (spaces replaced by underscores) being imported, the import script silently fails. The workaround would be to change the download filename of the old file in the database and then do the import.

importing files to downloads without playing them

1. Create playlists for the required files. Don't forget Signature tune. Choose a date in 1985 or something like that.
2. Enter suitable date in /home/sgh/scripts/playlist_import_hardcoded_date.sh
3. Then we can run playlist_import_hardcoded_date.sh to get the csv to the radiosai.org database
4. Then go to http://localhost/mkcsv/csv.php?date=01&month=01&year=1985 (or whatever date) to upload csv
6. Then go to radiosai.org and import the csv of the correct date.

bounce processing for yahoo and new ip address

Found a lot of delays from yahoo mail servers, deferred connections and so on. At first I thought it was just due to the new ip address - found that it was listed in Spamhaus, and sent in a request for removal from Spamhaus.
Contacted yahoo using their bulk mail contact form. Their reply said
After looking into the issue, it appears that your emails may have become de-prioritized due to a number of potential issues with your mailings. Please visit the following URL for information on improving list maintenance:
http://help.yahoo.com/l/us/yahoo/mail/postmaster/errors/postmaster-23.html
http://help.yahoo.com/l/us/yahoo/mail/postmaster/basics/basics-55.html
http://help.yahoo.com/l/us/yahoo/mail/postmaster/errors/421-ts03.html
The last point was about too many non-existent email addresses - and found lots of such errors in mail.log

Digging deeper, this is what I replied to yahoo:
Going through your checklist, and checking out our bounce processing, found that the bounces from yahoo were not being processed! The reason being that yahoo mail servers don't send the bounce messages, our mailer daemon has to send the bounce message, and this was not being sent to user noreply - user did not exist! This meant that more than 100 - 200 bad yahoo accounts have been sent mail from our server for the past several months! We're weeding out the bad ids - done some manually, rest will be processed by the bounce processing mechanism of phplist over the next week.
Actually there were around 400 bad mails of yahoo domains and a few from other domains. Unsubscribed the yahoo ones manually by digging through the bounces one by one using the gmail interface. The others will be caught by the bounce processing in due course.

For getting the bounces to the right place, I just had to create a noreply user, and put the following lines in a file /home/noreply/.procmailrc
MAILDIR=/var/spool/mail/noreply #The location of mail directory
:0
! our.bounces.email.id@gmail.com


After I sent the email to yahoo, they replied, saying in part,
Yahoo! Mail accepts a maximum of 20 messages per SMTP connection. We encourage you to cap the number of messages you send to Yahoo! Mail to fall within this per-connection limit.

My reply to that was:
We're running postfix > 2.3 which does not have a direct way to limit number of mails sent per connection.
http://www.postfix.org/CONNECTION_CACHE_README.html#limitations

Hopefully our server will reconnect OK with yahoo servers on dropping connections - our logs don't show any problems with that. We're still in the process of weeding out bad addresses. Once we finish that, hopefully, we won't irritate the yahoo MX servers as much!


In addition, I have now put
smtp_defer_if_no_mx_address_found = yes
in the /etc/postfix/main.cf - Default was to bounce mail if MX record not found, i.e. if DNS fails. Now changed to wait and retry for upto 5 days or whatever message age time is set.

Friday, November 05, 2010

download link from vimeo

Initially there was a requirement that we make the videos of MoL downloadable. P and I checked out various ways to do it from vimeo itself, since uploading duplicate copies to dl.radiosai.org would be not only tedious, but also tough on the server! Guided by this shell script, where he uses curl or wget to retrieve
http://www.vimeo.com/moogaloop/play/clip:${VIMEO_ID}/${REQUEST_SIGNATURE}/${REQUEST_SIGNATURE_EXPIRES}/?q=sd" > ${VIMEO_ID}.flv
where he gets REQUEST_SIGNATURE and REQUEST_SIGNATURE_EXPIRES from

VIDEO_XML=`${GET_CMD} http://www.vimeo.com/moogaloop/load/clip:${VIMEO_ID}`
REQUEST_SIGNATURE=`echo $VIDEO_XML sed -e 's/^.*\([^<]*\)<.*$/\1/g'`
REQUEST_SIGNATURE_EXPIRES=`echo $VIDEO_XML sed -e 's/^.*\([^<]*\)<.*$/\1/g'`
P made a very elegant PHP5 script based on
$xml = simplexml_load_file("http://www.vimeo.com/moogaloop/load/clip:$id");
$request_signature = $xml->request_signature;
$request_signature_expires = $xml->request_signature_expires;
$downloadurl = "http://www.vimeo.com/moogaloop/play/clip:$id/$request_signature/$request_signature_expires/?q=sd";
Unfortunately our server did not have PHP5, and PHP4.x did not have the simplexml functions. So I modified it to use curl using the code example from this page and using the value_in() example from this page.
$xml = get_html("http://www.vimeo.com/moogaloop/load/clip:$id");
$request_signature = value_in("request_signature", $xml) ;
$request_signature_expires = value_in("request_signature_expires", $xml) ;
$downloadurl = "http://www.vimeo.com/moogaloop/play/clip:$id/$request_signature/$request_signature_expires/?q=sd";
echo "<p align = \"center\">";
echo "<a href=\"";
echo $downloadurl;
echo "\">Right-click here and choose 'Save Link As...' or 'Save Target As...'</a>";
Attempls to avoid the 'right-click instruction' did not work, since the vimeo server sends the video as mp4 without a Content-Disposition attachment header, and redirects don't conserve headers. Finally, of course, the script was not used due to non-technical reasons....

Saturday, October 30, 2010

setting a web page to expire on IIS

This is useful for pages which are frequently updated. If this is not done, visitors complain that old content is seen on the page; we need to keep telling them to refresh the page.
Instead, do as shown in the screenshot below.

Thursday, October 28, 2010

cyberoam configuration

Sat with P configuring the Cyberoam CR50i for quite a few hours - 1-4 on two afternoons and 8-11 last night.

Actually info on what we needed to do was there in the knowledge base, what we were doing wrong was
(a) using the hardware ports to create sources for port forwarding while creating virtual hosts, and
(b) not creating simple Accept firewall rules with the virtual hosts as the destination.

So, first go to Firewall -> Virtual Hosts and create as required:


Then the firewall rules to allow connections.


We had to make a similar rule for Wan also, of course.


One more thing which we needed to do was to disable the Web console of cyberoam from WAN. This was found in the User Manual, blandly located in Firewall -> Local ACL

Wednesday, October 27, 2010

the fickleness of printers

While printing to the USB attached printer, I plugged in an external hard disk to another USB port. And the printer stopped mid-job! And wouldn't resume! Had to restart the computer and the printer to continue printing. So, moral of the story - don't do anything to tick off printers!