linux: What does hash -r do?

linux: What does hash -r do?The hash utility shall affect the way the current shell environment remembers the locations of utilities found as described in Command Search and Execution. Depending on the arguments specified, it shall add utility locations to its list of remembered locations or it shall purge the contents of the list. When no arguments are specified, it shall report on the contents of the list.

The following option shall be supported:

**-r**: Forget all previously remembered utility locations.

Posted in Server Admin | Tagged , | Leave a comment

windows system32 host location

windows system32 host locationClear and simple. The path for the `windows system32 host location` is `c:\windows\system32\drivers\etc\hosts` on most systems.

On linux systems it is in `/etc/hosts` so that part makes sense to me, but I have no idea why it is in the drivers folder.

**Remember** if you want to edit the hosts file you may need to have “administrator access” which can be done by right clicking “Notepad” and choosing “Run As Administrator” and then opening the file with Notepad. Otherwise you might be able to view the file but you will get an erro when saving it. Make a backup before you start

##Other windows system32 host location

###Windows 95/98/Me

c:\windows\hosts

###Win2k, Windows NT/2000/XP Pro

c:\winnt\system32\drivers\etc\hosts

###Windows XP Home

c:\windows\system32\drivers\etc\hosts

Posted in Tech Opinion | Tagged , , | Leave a comment

Streaming RMTP

Streaming RMTP

example of a rmtp player

Streaming video has a format known as rtmp or `Real Time Messaging Protocol` which allows videos which are viewed via flash based players (desktop and some android – sorry iOS / iPhones!) to pull their video source in “streaming” through a protocol url like rtmp://sXXXXXXXXXX.cloudfront.net/cfx/st

‘rtmp’ is what you mean when you say ‘rmtp’ but the correct version is actually rtmp

Posted in Tech Tips | Tagged , | Leave a comment

ffmpeg: Convert .mpg / .mov to .ts for Amazon Cloudfront

I just finished writing up a short article describing how to convert h.264 files into .ts files for Amazon Cloudfront streaming with HLS (HTTP Live Streaming)

It is not a difficult process although you need to have the latest version of ffmpeg.

For more details about converting mov files to ts files for HLS streaming, check out [How to use HLS (HTTP Live Streaming) with Amazon CloudFront](https://techblog.willshouse.com/2013/02/25/using-hls-http-live-streaming-with-amazon-cloudfront/)

Posted in Uncategorized | Leave a comment

How to use HLS (HTTP Live Streaming) with Amazon CloudFront

I have a mp4/h.264 video that is a around 300mb. I would like users to be able to watch it on both desktop browsers and mobile devices. I have the video file stored on Amazon S3.

I have two cloudfront sources enabled – one for download and one for streaming.

I know I can use something like VideoJS to play the file with the ‘video/mp4′ source being the “download” cloudfront source which, I believe, plays while the file is being downloaded – I think this is called “progressive download” but it is not true streaming.

I also realize that I can use something like JWPlayer and the “streaming” cloudfront source to give users on a desktop device, or a device that supports flash, the RTMP streaming experience.

The problem I’m facing is poor performance on iOS devices – especially ones with limited bandwidth.

From what I’ve been reading HTTP Live Streaming (HLS) seems to be the only “streaming” protocol that iOS devices really support. And as far as I can tell, Amazon Cloudfront only natively offers RTMP streaming of uploaded mpeg/h.264 files (not HLS).

Amazon has a [Live Smooth Streaming tutorial](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/IISLiveSmoothStreaming4.1.html) for use with Amazon CloudFront which appears to be, in a nutshell, a Windows IIS server running Adobe Flash Media Server and pushing out the HLS stream via Amazon Cloudfront.

So, my questions were:

1. If I want to push H.264/mpeg4 files “streaming” to iOS devices or HTML5 players, is the “right” way to do this to use HLS?

2. Can I push out stored H.264/mpeg4 files via HLS or does it actually need to be a “Live” feed of video?

3. Do I need to use a Live Smooth Streaming server to do the previous two points?

4. Do I need wowza? I have seen [wowza](http://www.wowza.com/) which appears to sell licenses to use their HLS streaming software at $5/day or something like that but I would really like the solution to be tied into AWS / self-hosted if possible.

###What I determined about HLS and Amazon CloudFront

1. Yes iOS devices and HTML5 only currently support HLS as the streaming protocol
2. HLS uses a link to a `.m3u8` filel which is a playlist of `.ts` files which are `transport stream` files. Basically the device can download “chunks” of the larger file in `ts` format depending on which section is requested. After a chuck is downloaded a user can track to the position they want and will get close to it depending on the “I” frame that is closest to the tracking point. You can add more “I” frame points but it increases file size and someone said it could potentially decrease quality. In short, use `.m3u8` and `.ts` files and it does not need to be an actual live stream
3. The Live Smooth Streaming server is actually for “live” broadcasts and so it is not needed for HLS of stored files
4. wowza is not needed

##How to use HLS with Amazon CloudFront (step by step)

– Assuming you have h.264/mpeg4 (`.mov`) files, use `ffmpeg` to convert them into several `.ts` files. You can even convert them into sets of `.ts` files at different resolutions and with the beauty of HTML5 and your `.m3u8` file you can list the resolutions available and the device will pick the biggest one it can utilize fully (i.e. if the screen only supports 640×480 resolution it won’t pick the 720p version). You will probably need to get the latest version of ffmpeg from the github repository and build it yourself in order for it to be able to handle the `.ts` type of files. This is also true if you use a Ruby on Rails wrapper or gem like [streamio-ffmpeg](https://github.com/streamio/streamio-ffmpeg) which actually just “forks” a process of ffmpg to do the conversion and get video information etc.

I got some help with syntax on the `ts` conversion with ffmpeg from [stack overflow](http://stackoverflow.com/questions/8767727/transcode-and-segment-with-ffmpeg/10047372#10047372) which shows how to do the ts conversion:

./ffmpeg -v 9 -loglevel 99 -re -i sourcefile.avi -an \
-c:v libx264 -b:v 128k -vpre ipod320 \
-flags -global_header -map 0 -f segment -segment_time 4 \
-segment_list test.m3u8 -segment_format mpegts stream%05d.ts

And also how you need to compile ffmpeg to get the support for doing the conversions:

export PKG_CONFIG_PATH=”/usr/lib/pkgconfig/:../rtmpdump-2.3/librtmp”

./configure –enable-librtmp –enable-libx264 \
–libdir=’../x264/:/usr/local/lib:../rtmpdump-2.3′ \
–enable-gpl –enable-pthreads –enable-libvpx \
–disable-ffplay –disable-ffserver –disable-shared –enable-debug

– Create a `.m3u8` playlist of your `.ts` encoded chunks of your video which will become the HLS (HTTP Live Streaming)
– Upload them to your server – probably an Amazon S3 bucket which could be linked to CloudFront for fastest downloads. Set up the CloudFront distribution to use “download” and not “streaming” because “streaming” is only for the RTMP (or is it RMTP?) video format which is only supported by flash players
– Feed the `.m3u8` playlist file to your HTML5 video tag / video player.

Both the JWPlayer and VideoJS players appear to support HLS Live Streaming.

I did the conversions on an Ubuntu 12.04 box and upgraded ruby to 1.9.1 / 1.9.3 to test out `streamio-ffmpeg` but all I really needed was the latest version of ffmpeg which I cloned using `git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg` – visit the ffmpeg page for more details.

Posted in Web Development | Tagged , , , , , , | 2 Comments

Using VideoJS with YouTube

I have been using VideoJS for some streaming videos and mp4 videos, but also wanted to pull YouTube videos into the player along with the other videos I had on the site. First of all, the working example. Then, the list of problems ;)

### VideoJS and Youtube Example

###How to replicate the Youtube and VideoJS integration:

First, clone or download [this fork of videoJS](https://github.com/jhurliman/video-js) and build it.

Next, place this in your webpage’s `` (needs to be there to work with older browsers). Also fix the odd character after the href in the first line (sorry about that) and make sure the path points to the correct location for the files.

And then place this in your document’s ``:

There is also an example file in the `dist` directory which will only be created after you “build” the fork you have cloned from github.

### VideoJS and Youtube Problems With Integration

I tried simply giving VideoJS the URL to the YouTube video but that didn’t workout so well.

Here are a few things that might help you out with playing You Tube videos in Video JS:

1. There is a [pull request](https://github.com/zencoder/video-js/pull/157) for changes that would allow VideoJS to work with YouTube. A few problems with it are:
* Has not been pulled in
* Both the Video JS maintainer and the pull requestor have become busy with other projects so it might not get pulled in ever, but it is mentioned that it would be better to have this as a plugin. I’m not even sure if VideoJS is set up to allow plugins easily at this point, which is a shame because I really like VideoJS
* You can also get the [jhurliman’s fork of VideoJS](https://github.com/jhurliman/video-js) which actually DOES WORK TO PLAY YOUTUBE VIDEOS but unfortunately hasn’t been kept up to date with the regular videoJS and so normal videos don’t play well and the Javascript API was causing me problems :( …. BUT it does work to play YouTube videos with VideoJS which is very encouraging
2. You will find several places on the VideoJS forums where people have submitted patches and changes which allow it to work with youtube. Since nothing has been officially pulled in I find that it is quite difficult to fathom maintaining this functionality with snippets of code from pastebin
3. VideoJS has a GitHub repo and ACTUALLY DOES have a [YouTube branch](https://github.com/zencoder/video-js/tree/feature/youtube)! Cool! But it has not been updated in several months and sort of looks like it is not being maintained. I tried switching to this branch in Git and merging changes into the Master branch but with limited success.
4. The main difference with the syntax of videoJS and youtube is in the video style – the one that I’ve seen a lot is: `type=’video/youtube’` for the `` tag. There are two pieces of code below showing this as well as how to change that with the JavaScript API. It worked mostly fine for me for Youtube Videos with jhurliman’s fork but it wasn’t stable enough for me to be comfortable using it in production mode.

##VideoJS and Youtube Code Samples

This is how you set up a You Tube video using the VideoJS branch by jhurliman:

Notice the big difference is the `type` paramater in the `source` tag.

Next, this is how you *should* be able to load videos and specify their “type” with the javascript api:

myPlayer.src([{ type: ‘video/youtube’, src: ‘http://www.youtube.com/watch?v=v1uyQZNg2vE’ }]);

And for an mp4:

myPlayer.src([{ type: ‘video/mp4’, src: ‘http://video-js.zencoder.com/oceans-clip.mp4’ }]);

Again, I had luck with Youtube video only with the `jhurliman` branch, but then when I tried to use mp4’s with it I would get a lot of javascript errors. I hope this is a feature that is pulled into VideoJS soon because I love the player and love that it is open source.

A few other things that I wish VideoJS could have:

* Support for IE8 and maybe even IE7 – or at least a graceful fallback, warning, or link to download the video
* HLS Support – looks like this will be important soon

Posted in Tech Tips, Web Development | Tagged , , , | 1 Comment

[Solved] 6176 – Quickbooks cannot get the address of the server.

Quickbooks cannot get the address of the server.

We recommend you download the Quickbooks Connection Diagnostic Tool which can access and possibly correct the problem. If the problem continues, contact Support for assistance.

`Error codes: (-6176, 0).`

How do I resolve this?

[Solved] Quickbooks cannot get the address of the server.

###Quickbooks cannot get the address of the server Solution

I called into Quickbooks and they asked if I was running a multi-user version of Quickbooks and I told them I was not. They asked if I was running Windows 8, Windows 7, or Windows Vista. I told them I was running Windows XP.

They asked if I was using Quickbooks 2013 or Quickbooks 2012 and I told them I was using Quickbooks 2011 – which they then asked me if I wanted to upgrade for 20% of at a price of $149 and I told them I did not want to upgrade.

I asked if they could help with the problem and they asked me to set up remote access for them to look at the problem. I asked if they could just tell me what to do. What they said was to open up the task manager by pressing Control+Alt+Delete and then kill all processes starting with `qb` – for me that was just QBW32.EXE that fixed the issue:

[Solved] Quickbooks cannot get the address of the server.

I asked if there was anything else that could be done and they told me to update the software, which is already at revision “R12P” which can be confirmed by pressing “Control+1” or “F2” when quickbooks is open:

[Solved] 6176 – Quickbooks cannot get the address of the server.

Posted in Tech Tips | Tagged | Leave a comment

Uncaught SyntaxError: Invalid regular expression: /(^|\.)fb(\.|$)/: Stack overflow

Uncaught SyntaxError: Invalid regular expression: /(^|.)fb(.|$)/: Stack overflowToday I was trying to use `fancybox` with `jQuery` and `bootstrap` while doing some website work. While trying to do some looping functions, like creating a gallery I started getting this error in the console:

Uncaught SyntaxError: Invalid regular expression: /(^|\.)fb(\.|$)/: Stack overflow

I did a lot of searching and found that error is typically caused by things like javascript variables that contain invisible characters like `\u200B` and maybe the `^M` windows line ending.

After searching through a lot of my files for the site I realized the problem was in one of the libraries I was using: Bootstrap

As far as I can tell there is an issue in Bootstrap version 2.3.0 that causes this. I switched from using this Bootstrap url (2.3.0):

netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js

To instead using 2.2.2 which is at:

netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js

The error went away and fancybox / fancyapps started working just fine again.

Posted in Tech Tips | 7 Comments

Gillette Razor Lineup

Gillette Razor Lineup

Fusion ProGlide Power Razor

Fusion ProGlide Power Razor

star

Fusion ProGlide Razor

Fusion ProGlide Razor

star

Fusion ProGlide Styler

Fusion ProGlide Styler

star

Fusion ProGlide SilverTouch Power Razor

Fusion ProGlide SilverTouch Power Razor

star

Fusion ProGlide SilverTouch Manual Razor

Fusion ProGlide SilverTouch Manual Razor

star

Series Protection Shave Gel

Series Protection Shave Gel

star

Fusion Razor

Fusion Razor

star

MACH3 Turbo Razor

MACH3 Turbo Razor

star

M3 Power Razor

M3 Power Razor

star

MACH3 Sensitive Razor

MACH3 Sensitive Razor

star

Mach3 Razor

Mach3 Razor

star

Posted in Marketing | Tagged | Leave a comment

How to Select a jQuery UI tab with Javascript

How to Select a jQuery UI tab with JavascriptThe documentation for jQueryUI tabs is a bit cryptic. It was not immediately clear how to Select a jQuery UI tab with Javascript, but I got it working with this little bit of code:

$( “#tabs” ).tabs( ‘select’, “#profile” );

`#profile` is the `id` of the tab you would like to select, and `#tabs` is the element you set up the tabs on by calling `$( “#tabs” )`

You may also have to use `jQuery` instead of `$` if you have `noConflict` mode enabled, the tabs need to be initialized first (as previously mentioned), and it is possible you will need to put all this info inside the ‘jQuery document ready’ wrapper:

jQuery(function($){
$( “#tabs” ).tabs( ‘select’, “#profile” );
});

Posted in Tech Tips, Web Development | Tagged , , | Leave a comment