Posts Tagged ‘weird problem’

how to set Youtube default to use Adobe Flash player – fixing weird problem with youtube displaying videos using HTML5

Tuesday, January 29th, 2013

 

Youtube change html trial to Adobe Flash Player - how to change Youtube videos be played with Adobe Flash Player

I'm just coming from being a guest to dear friends. They're having a bit old hardware PC running Windows XP and some old ATI Radeon model video card. A video was played in youtube so I noticed the video is displaying very slow. The PC hardware was good enough to play videos with no delays and image chops, so I give it a check.
My guess was something is wrong with Video driver and to make driver is installed okay I take a look in:
Control Panel -> System -> Hardware -> Device Manager

For my surprise there all was fine, so my next guess-es were:

  • Mozilla Firefox Browser is out of date
  • Computer resolution is set to too high for the old video adapter hardware
  • Something is wrong with Adobe Flash Player
  • Computer has Viruses or Spyware loading CPU creating the video lags
     

I check Mozilla Firefox and it was latest version; Help -> About Firefox As of time of writting Firefox 18.0.1 The computer Monitor was a huge 21 inch LCD HP display and Windows was configured to display on a very high resolution ;

1280×1024 (32 bit Colors)

I've earlier, seen old Computer hardware creating similar video delays and chop issues with Played videos thus to see if this will solve the issue lowered down video resolution 1024×768 with 16 bit color depth.  Video continued to be showing slowly in every few seconds and display "choppy", so I excluded it as cause.

To make sure something is not wrong with Flash Player, I check in browser about installed plugins by typing in URL Address bar;

about:plugins

Very surprisingly the Flash Player was not installed! I hurried and install – googling, "install flash player" and following the trivial install procedure.

Then I give Firefox a restart and tested video with Alexander Nevsky Russian Movie (which btw is an interesting one to see for people who value art and history). The movie chops continued, I checked Flash version clicking on the video again just to determine, weirdly still Youtube was displaying videos usiong HTML5 (WebM) format!

I check once again if flash player is properly installed in about:plugins and weirdly all seemed fine I had on the PC properly working installed Adobe Flash 11.x.x. Now this was weird ?

For a first time I had a situation, where even though I installed Flash Player, Youtube continued to show videos using HTML5 WebM (open source video format). Now I should say I'm a big fan of HTML5 and open technologies, so HTML5 is great, the only problem is it still not production ready so for ordinary user Flash Player is still better – Flash's video buffering is much better, its compression is better, it is less buggy etc. etc.

It took me a bit of pondering Why Youtube was showing videos in HTML5 instead of using the Installed and working Flash Player?? After about 5 minutes of googling, I came to conclusion the person who fixed their Software, some months before had on purpose choose Youtube to be displayed with Experimetnal HTML5. I was not sure how to check if HTML5 is set as a default player in Youtube, so looked on the net, The page to change it is found by googling for "youtube html trial".

The URL to tune this as of time of writting is on;

https://www.youtube.com/html5


youtube change html trial set youtube to use adobe flash player screenshot pciture Windows

 

I had to click on;

Leave the HTML5 Trial  – to stop using experimental Youtube HTML5 support

After a FF restart and lowered resolution to 1024×768 in 32 bit color depth, video started playing nice & smoothly 😉

Check and Restart Apache if it is malfunctioning (not returning HTML content) shell script

Monday, March 19th, 2012

Check and Restart Apache Webserver on Malfunction, Apache feather logo

One of the company Debian Lenny 5.0 Webservers, where I'm working as sys admin sometimes stops to properly server HTTP requests.
Whenever this oddity happens, the Apache server seems to be running okay but it is not failing to return requested content

I can see the webserver listens on port 80 and establishing connections to remote hosts – the apache processes show normally as I can see in netstat …:

apache:~# netstat -enp 80
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 xxx.xxx.xxx.xx:80 46.253.9.36:5665 SYN_RECV 0 0 -
tcp 0 0 xxx.xxx.xxx.xx:80 78.157.26.24:5933 SYN_RECV 0 0 -
...

Also the apache forked child processes show normally in process list:

apache:~# ps axuwwf|grep -i apache
root 46748 0.0 0.0 112300 872 pts/1 S+ 18:07 0:00 \_ grep -i apache
root 42530 0.0 0.1 217392 6636 ? Ss Mar14 0:39 /usr/sbin/apache2 -k start
www-data 42535 0.0 0.0 147876 1488 ? S Mar14 0:01 \_ /usr/sbin/apache2 -k start
root 28747 0.0 0.1 218180 4792 ? Sl Mar14 0:00 \_ /usr/sbin/apache2 -k start
www-data 31787 0.0 0.1 219156 5832 ? S Mar14 0:00 | \_ /usr/sbin/apache2 -k start

In spite of that, in any client browser to any of the Apache (Virtual hosts) websites, there is no HTML content returned…
This weird problem continues until the Apache webserver is retarted.
Once webserver is restarted everything is back to normal.
I use Apache Check Apache shell script set on few remote hosts to regularly check with nmap if port 80 (www) of my server is open and responding, anyways this script just checks if the open and reachable and thus using it was unable to detect Apache wasn't able to return back HTML content.
To work around the malfunctions I wrote tiny script – retart_apache_if_empty_content_is_returned.sh

The scripts idea is very simple;
A request is made a remote defined host with lynx text browser, then the output of lines is counted, if the output returned by lynx -dump http://someurl.com is less than the number returned whether normally invoked, then the script triggers an apache init script restart.

I've set the script to periodically run in a cron job, every 5 minutes each hour.
# check if apache returns empty content with lynx and if yes restart and log it
*/5 * * * * /usr/sbin/restart_apache_if_empty_content.sh >/dev/null 2>&1

This is not perfect as sometimes still, there will be few minutes downtime, but at least the downside will not be few hours until I am informed ssh to the server and restart Apache manually

A quick way to download and set from cron execution my script every 5 minutes use:

apache:~# cd /usr/sbin
apache:/usr/sbin# wget -q https://www.pc-freak.net/bscscr/restart_apache_if_empty_content.sh
apache:/usr/sbin# chmod +x restart_apache_if_empty_content.sh
apache:/usr/sbin# crontab -l > /tmp/file; echo '*/5 * * * *' /usr/sbin/restart_apache_if_empty_content.sh 2>&1 >/dev/null