Wednesday, April 30, 2014

slow loading of website via cloudflare

From a few weeks back, our website at media.radiosai.org started loading slowly, even though we had enabled Cloudflare CDN. There were also some times when the site was reported as down, though the server did not show any outage. Checking with Internap, our hosting providers, found no issues at their end. Used MTR - "My TraceRoute" tool to check packet losses. Apparently 1% packet loss at their main router for UDP packets was acceptable.

Then checked with CloudFlare support. After traceroute checks, one of their recommendations was to set the expiresby attribute to one month. Checking that in our apache2.conf, found that it was set to just 1 second after access! Changed it to one hour, and site became fast again :)

Saturday, April 26, 2014

making bhajanstream playlists

PB shares his method of creating bhajanstream playlists from supplied 30 minute m3u files.

1. The received m3u file is in extened m3u file format. Collect all of
them into a folder

2. Run the script extm3u_to_m3u_batch.sh  This script converts the
extened m3u files to simple m3u files with the required path.
(currently the path is /local/audio24)

3. Add these files to BhajanPlaylist_files folder (in scripts dir)
with the proper filename sequence

4. Run the script make_bhajan_playlist.sh to make the required 31 days
random playlist using the m3u files in the  BhajanPlaylist_files
folder. The output of these files are in /home/sgh/bhajan_m3u

5. Open them in xmms to set to the correctly to 24 hrs + few mins duration files

6. To replace to the correct path use the following code

sed -e 's/\/local\/audio24\//\/home\/sgh\/audio\//' -i /home/sgh/bhajan_m3u/*

Sometime later the above steps can be combined to one script.

Monday, April 21, 2014

some still image After Effects techniques

There are a few ways in which I have used low resolution still images (and videos) on the dome. One way was detailed in an earlier post. Another way was to use a starfield image as a background in a fisheye dome-master, move the small rectangular image to the bottom of the fisheye so that it suffers least distortion on the dome, move the anchor point to the centre of the background image, and rotate the rectangular image so that it appears at a different place on the dome rather than front centre. To move the anchor point, the tool is the "Pan behind" tool, which looks like a circle.

Another technique was to exploit the fact that after mirror warping, the bottom centre 640x480 pixels can be used almost un-distorted. So, using a warped 1920x1080 starfield as background, animating stills (or videos) across the bottom, fading them in and out within the 640 pixel boundary. For doing this with a large number of images, copy-pasting attributes like position and opacity is useful. Just move the time marker to the first of the keyframes, click on Position, Ctrl-C to copy, click on Position on the layer where you want to paste, and Ctrl-V. 
  

Friday, April 18, 2014

file limit workaround on Ubuntu 10.04 Lucid

We'd been seeing graphs like this:

for listener number statistics (using Shoutstats) on our Icecast streaming server at radiosai.org. PB correctly diagnosed this as being due to the server not accepting new connections after 1000 connections were reached. The server limits in the icecast xml file were set to 2048. PB correctly pointed out that this was due to a user limit issue.

Checked the error log and found lot messages like:

WARN connection/_accept_connection
 
accept() failed with error 24: Too many open files

We have to set ulimt (user limits) as suggested here

Currently it is set to 1024 on our server.

But after setting the limit to 4096 and restarting the server, still the problem persisted:

Checked the icecast limit as suggested here

It still shows Max open files as 1024


which says to use ulimit -S 4096 as the relevant user to change per session. But doing that and running the script to start our icecast using nohup still did not solve the issue. Max open files still reported as 1024 when doing cat /proc/pid_of_icecast/limits

Finally PB found the solution: which was, edit /etc/security/limits.conf by adding the lines 
relevant_username         hard    nofile      65536
relevant_username         soft    nofile      65536
and also editing /etc/pam.d/common-session to add the line 
session required pam_limits.so 
at the end. And then, after a reboot, instead of directly logging in as relevant_username, either log in as root and then do su relevant_username, or do an su to become root, and then su relevant_username. After doing that, ulimit -n returns 4096, and starting our icecast now, it can open more than 1024 files. 



Thursday, April 10, 2014

Heartbleed patch

Internap sent us an email with the OpenSSL vulnerability info, link to http://heartbleed.com/  and so on. Actually this does not affect us, since we don't use any https pages. Still, have done this update for krishna and server1 .

apt-get update && apt-get install openssl

Sunday, April 06, 2014

checking out Kolor Eyes

Some of the IMERSA talks mentioned Kolor Eyes as a preview tool. Checking out the "spherical" view on Kolor Eyes, found that it is a bit different from what we get using the polar co-ords tool of Gimp.

Kolor Eyes screenshot below, zoomed in a bit to get more of sky, rotated to make it similar to the Gimp screenshot.


Gimp screenshot below.


This difference is because what we're seeing in Kolor Eyes is a "Little Planet" view and not a Fisheye view. This page has a discussion on the different projections. Kolor Eyes hosting has an option for Fisheye view also. 


Saturday, April 05, 2014

hand pump for bicycles - mini review

N got a hand-pump. But it needed some work before it could be used. The nozzle had to be opened, and the washer had to be turned around to fit our type of cycles.


The pump itself is small and light, but because of its lack of tubing, the ergonomics of hand pumping are a bit awkward. My arms are clearly not strong enough. So this pump is not useful for me. Floor pumps are fine for me, though. 


The usage of the pump also had a gotcha. The nozzle has to be fixed to the cycle tube's valve, and the pump has to be locked as below, for effective pumping. 






applying for a passport in India

Now the procedure for applying for Indian passport applications has been made online, and many Passport Seva Kendras (PSKs) have been opened, so the whole process is more transparent and less of a hassle. The website passportindia.gov.in gives most of the required info, in a user-friendly manner. My own experience was as follows.

Applied online, filling up the form online over the course of a couple of days, and found at the last step that Hyderabad Begumpet office, where I wanted to go, was giving out appointments the very next day. Since I had to book Tatkal railway tickets to go to Hyderabad, chose to wait for a Thursday morning before making payment and booking an appointment, so that I could go to Hyd on Thu evening, reach there on Fri morning for a morning appointment.

The Begumpet PSK was near the American consulate, so there was a big rush of US Visa applicants also nearby! The passport office entrance was to the side, the security guard was allowing only those who had appointments within 15 minutes to come and stand in line, was asking the others to move away. One potential issue is that only the person who has the appointment is allowed inside (except for invalids etc) - so, in general, it would be a good idea to meet up with someone else and apply together, because when one is alone, waiting for the tokens to be displayed on the screens can be a chore. The queue was only around 10 minutes, then after a brief security check, we have to hand over initial documents like School Leaving Certificate photocopy for getting a token number and a temporary file.

As the passport portal shows, the process is in three counters, A, B, and C. Counter A for entry of details, documents scanning, checking spelling, finger print scanning, taking of picture etc. Counter B - another check of the documents. Counter C - final approval. for After getting the token, we proceeded to counter A almost immediately, with our token numbers being displayed on the video screen there. But after that, our wait for counter B was almost two hours! The waiting area is air-conditioned, but one has to be alert for the token numbers to be displayed on the screen. There's a coffee/snack bar, and washroom facilities in the waiting area, but once in, we can't go out. At Begumpet, the A and B sections have lots of counters - 20+, C section has comparatively fewer - 10 or so.

Counter B to Counter C waiting time was only 15 minutes or so, and the whole process was finished in around a couple of hours. A's father finished his passport renewal at Calicut in just an hour, so it depends on the centre and how busy it is on a given day. The initial counters are manned by TCS folks, professional and quick. Counter C is the Govt. of India official who gives final approval, checking the docs for a final time. Then we just have to collect a receipt at the exit - a short 2 minute queue for this - and then leave after another security check.

The police verification was the main cause of delay - had to call the policeman, a friend's acquaintance - several times, since he was busy with the elections coming up. Once he came and checked the documents, had to give him another set of photocopies and two photographs, a week later the passport portal status showed that the passport has been sent for printing. Another week later, the passport was in my hands. The postman also needs a photocopy of address proof before handing over the passport. The whole process took 5 weeks. 

Friday, April 04, 2014

emulating home button press on Android with ssh

On the HTC Wildfire which I'm using as a demo piece, installed SSHDroid and was successful with implementing the act of pressing the Home button, though the button does not work, by running
am start -a android.intent.action.MAIN -c android.intent.category.HOME
as given at this stackexchange post. And as mentioned in the comments here, the
input keyevent 3
command does not work in ssh shell, probably due to some path or permission issues.

2:1 equirectangular to angular fisheye

Checking out the IMERSA live action photography talk at fddb, the speakers talk about VideoStitch - trying out their demo videos, found that it renders output to 2:1 equirectangular format. The IMERSA speakers mention using the NAVEGAR Fulldome plugin for AE for converting this video to fulldome domemasters.

Checking Andrew Hazelden's Photoshop actions pack demo images, found that I can get the same result using Gimp's Filters -> Distorts -> Polar Co-ordinates


Since this view is supposed to be closer to a sphere than a hemi-sphere as we need on the dome, we would probably need to cut out some of the grass in the picture. Original 1600 x 800, probably close to 360 degrees by 360 degrees field of view,


Leaving in a little bit of grass, cropping to 1600 x 450 or so, (also rotated to get the mountains to foreground)


Cropping to 1600 x 400, technically should be close to 360 x 180 degrees FOV,





Wednesday, April 02, 2014

exposing the wireless key on XP

I got hold of an HTC Wildfire mobile phone with a cracked screen and non-functional home-menu-back buttons, for use as a demo piece for radiosai. Usable, since the touchscreen works. When trying to make it connect to Wifi, it showed connected for whatever password I entered, if I used a static ip. But actually it was not connecting. Finally used WirelessKeyView from Nirsoft and entered the correct wireless key. Then it connected with DHCP with no issues.