Local RTMP server with Website

I am starting a mini-series of posts on how to set up Nginx-RTMP and WordPress to create a local version of Twitch.tv. I will post detailed guides on installing and configuring all software required for this project.

Project requirements are as follows:

  • 1 or 2 Linux computers/VMs. All testing has been done with Ubuntu Server 14.04 64bit.
  • Nginx-RTMP with the stats plugin compiled.
  • A working WordPress installation. (not covered in this series)
  • Various command line utilities that will be covered in depth during the guide.

The end product will be a fully functional streaming server capable of handling 1gbps of video traffic, with a custom WordPress frontend for users to use to access the streams. The entire system is automated and requires minimal user input. A basic use-case is below.

Bob wants to stream his Dota game for the entire LAN party to see. The LAN has a limited bandwidth internet connection, so using a service like Twitch.tv is out of the question. However, the LAN execs have configured a local RTMP solution for him to use.

Bob configures his streaming software like he would normally, except he points his stream to the local RTMP server. He uses his gamer handle (b0b) as a stream key. At this point, Bob’s job is finished. He can start playing his game.

On the backend, a script reads that a new stream has started. It checks to see if this stream has been played before, or if this is a new stream all together. If its new, it adds the stream to the local database and creates a page on the WordPress site dedicated to Bob’s stream.  It then runs through every stream that has been registered to the server during the event. If the stream is active, like Bob’s, it updates the page with a JWPlayer configured specifically for Bob’s stream. It also generates an .m3u file with a playlist entry pointing towards Bob’s stream mount point.  Viewers can just navigate to Bob’s page on the WordPress site and start watching from within their web browser.

If some of the previously registered streams are offline, it updates their page with an offline message telling users to check back soon. By using this process, every single page is updated every 60 seconds via a cronjob.

So that’s a basic overview of what this setup can do.  It can listen for, create, and distribute live RTMP streams to viewers automatically and painlessly. And because all traffic is local, no internet bandwidth is wasted for redundant connections to websites like Twitch.tv or hitbox.

I will be making many more posts about how to set this up for your own event, so stay tuned. If you have any questions or comments, please leave a message below.

Part 1 – Install nginx rtmp tutorial here!

Part 2 – Customize WordPress tutorial here!

Part 3 – Finishing the RTMP WordPress Project here!

Part 4 – Virtual Machine Download here!

Strange hosts file entry

For the past week or so I was having random redirect issues. It was actually happening when I was checking this website (willstare.com). I finally had enough and did some scans on my PC. One of them scanned my HOSTS file and spit out a little nugget for me. Somehow I had an entry for pagead2.googlesyndication.com pointing toward 194.145.200.27. That was obviously not supposed to be there, so I did some digging to find out who that IP was.

It turns out it was a website based in the Netherlands called http://www.devianceprojects.com/. I still have no idea how that got there, but I will be more vigilant while cruising the web. I emailed the administrators for that site asking if they had any idea why that entry would be in  my hosts file, but they haven’t gotten back to me yet. I will update this is I get any more information. I have included my hosts file below to show what it looked like.


# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost

194.145.200.27 pagead2.googlesyndication.com 

Ducky Zero Shine TKL review

I got my first mechanical keyboard the other day, a Ducky Zero Shine Tenkeyless. I’m just going to say a few things about it in case you’re interested in buying it.

First of all, it feels great. The craftsmanship is excellent, and it has a decent weight to it. The keycaps are smooth, but they have a little texture so it doesn’t feel like your fingers will slide right off. I have the Cherry MX Brown switches in mine, and they are pretty quiet. All noise is from the keys bottoming out, and this will get better the longer I use the keyboard.

The lighting is nice, but I have a few problems with it that I haven’t been able to figure out. The F1 and F5 keys are used for setting the repeat rate for the key presses. If the keyboard lighting is on at all, those keys are fully lit all the time. I haven’t figured out a way to have them be the same brightness of every other key. It isn’t a big problem though, and if it gets too annoying I just turn off the lights completely.

I am still getting used to the TKL design. I usually use the numpad for entering IP addresses, and for hitting enter when typing in a website that only requires one hand. However, I don’t miss it enough to want a full size keyboard again. My laptop has no numpad either, so it hasn’t been a hard transition for me.

All in all I am pleased with my keyboard. It feels absoultely wonderful to type on, and I think it will last a long time. If you have any questions, please leave a comment below. I’d be happy to help you with them.

SKU DK2087S-BUSALAAB1

Storja Tech Update

MapZTuuJ

Well, it appears that Storja was just another scam. After my first post, many people commented with their own insight on the company. The following is what we have figured out:

  • They posted information about multiple “conferences” where applicants would need to pay $50 for a chance to speak to HR.
  • No refunds were ever given to those who were unable to interview (everyone).
  • All major job posting sites removed their ads, craigslist ended up being the only source of their advertising.
  • Very few people were “hired”, but they never got a paycheck. Checks that were sent out bounced.

So at the end of the day, it looks like Storja was a somewhat sophisticated scam. It got people to hand over personal information (maybe even social security numbers), as well as at least $50. They got a lot of publicity with their wild claims of changing the world, but in the end it was hogwash.

I’m pretty bummed that they didn’t have a revolutionary technology lurking in their labs. I was really looking forward to having TB/s internet speeds for free.

If you have any more information or comments, please leave them below. If you have information about other companies trying to do the same thing, let me know. I like investigating these things, they can be really interesting.

Install Mcmyadmin on Ubuntu 14.04 Server

I followed this guide: https://www.digitalocean.com/community/questions/how-to-install-mcmyadmin-and-start-it-up-for-the-first-time-not-a-question-a-howto-guide

It worked great until the end. Upon running the script, SSH session would get flooded with errors. At first it appeared that they were Java errors, but upon further inspection it appeared to be related to my SSH session itself. I was using SecureCRT, and by default some of the color codes from the Linux terminal are not enabled. Here is the error I was getting.

Running in 64-bit mode.
McMyAdmin Core Exception: Argument cannot be null.
Parameter name: format
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Argument cannot be null.
Parameter name: format
at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
at System.String.Format (System.String format, System.Object arg0) [0x00000] in <filename unknown>:0
at System.TermInfoDriver.set_ForegroundColor (ConsoleColor value) [0x00000] in <filename unknown>:0
at System.ConsoleDriver.set_ForegroundColor (ConsoleColor value) [0x00000] in <filename unknown>:0
at System.Console.set_ForegroundColor (ConsoleColor value) [0x00000] in <filename unknown>:0
at nu.a (a A_0) [0x00000] in <filename unknown>:0
at nu.a () [0x00000] in <filename unknown>:0
at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0

 

As you can see, its all talking about colors. Mcmyadmin attempts to mirror Powershell in its color scheme, and that includes changing the background color to blue. For whatever reason SecureCRT doesn’t allow for this to happen, and the result is a bunch of errors. By switching to Putty, I was able to get the server up without an issue. I’ll include some screenshots below to show what I am talking about.

securecrt
SecureCRT throwing an error while connected.

putty
Putty working fine. Notice the blue background.

I hope this post helps anybody having issues with this problem. I couldn’t find anything online that helped. Comment below if you have questions.

Another change in Hosting

All good things must come to an end. After about 18 months of solid performance, I have left i3d.net for my hosting needs. During that time I uploaded over 83TB of data and had an uptime of 554 days. The server/network were flawless, and it often outperformed servers on other networks in speedtests. I’d recommend i3d.net to anyone looking for a very solid hosting provider in Europe. I just outgrew the plan I was on.

I have now transitioned all services to an ESXi machine located in Quebec. My host, soyoustart is a “budget” provider for the OVH network. The specs are as follows:

Intel Xeon W3520 (4c/8t) 2.66ghz
32 GB ECC Ram
2 x 2 TB SATA HDD
250mbps connection. (I’ve hit 1000mbps on speedtests though)

This server is running 5-6 mostly Linux virtual machines. I am sharing it with a friend and so far we haven’t really been able to slow it down. We’ve had HD Plex streams, thousands of shoutcast listeners, and VPN connections all going and it just keeps chugging along. We are pleased with the service and expect to stay with them for a while.  I feel like it is much easier to manage multiple services if they’re all on their own VM. Updates/restarts aren’t as painful, and the separation of services allows for more security. I’ll update this post if we have major issues with the service.

Storja Tech

MapZTuuJ

An interesting story came up a few weeks ago about a company claiming to have in their possession technology that would revolutionize the telecommunications world. Their claims included free petabyte speed interent access nationwide, free cell phone service among others. The said that Microsoft purchased the right to work with this company for a little over $3 million. 

I have been searching for information regarding this company off and on since their initial claims surfaced, and not much else has been announced. Their primary channels of communication seem to job posting boards and newswire services.

They are having a members only conference today (March 8, 2014) in New York City, but no information has surfaced about the contents of the meeting. It is hard to say what is happening behind the closed doors.

There are many theories behind what/who they are, but at this point I believe they are a group of people trying to make some money and run. They are charging $50 to attend their conference today, and I am sure they will be holding them elsewhere shortly. There are plenty of gullible investors out there that will get overwhelmed with Storja’s claims, and may drop sizable amounts of money on little more than words.

There is no technical way that the technology that they are describing can exist. I do look forward to seeing how it plays out. It is reminiscent of the Andrea Rossi E-Cat saga from late 2011.

 

Fulljoin PPS301 Review

Also known as: SVP XT8PPS, Pocket WiFi PPS Wireless Internet Radio.

Fulljoin-PPS301-Pocket-Size-Internet-Radio

I bought my PPS301 on Ebay for around $50 with shipping. I wanted it so I could listen to radio streams at night while laying in bed, or around the house during the day. I found this radio and it looked like it would suit my needs: It has a built in speaker and it looked pretty similar to the Mutant portable radios. I found it hard to find information on the radio online, as the manufacturer doesn’t have a very good website.

This radio uses the iradio168.com service that is OK. I wasn’t really interested in using a service, but its handy to find all sorts of music from around the world. The main thing I was interested in was programming my custom stations in (Mostly Art Bell streams). The instruction manual was missing the portion that gave directions on how to input custom stations, so I took it upon myself to figure it out.

The first thing I did was find the IP address of the radio, which is displayed in the setup menu on the device. Mine had the address of 192.168.1.181. I tried putting that address into my web browser, but was met with a failed load. I ran a portscan of the address, and found port 23 to be open. I telnetted into the device using putty, and guessed the username/password. For my device the username was root, no password.

putty

root

It runs a version of Linux, so I was able to quickly look around and find what was installed on the device. I noticed that in /home/httpd/ there were files for a website. I kept digging around, and found a little program called boa. I Googled that and found that it is a lightweight web server. YES!  I typed boa in the command line, and refreshed my web browser.

boa1

 

I was greeted by a configuration website that allowed me to input my own custom stations. Now I have my stations saved, and I can find them using the Groups function of the radio. I am very pleased.

boa2

Pros:
Easily connected to my WPA2 wifi, has good audio quality, nice selection of stations (iradio168.com), feels solid.
Cons:
Required workaround to input custom stations.

I am happy with the radio.

Ajaxplorer – Navigation Loaded Start error

Hi all, I have a nice little Ajaxplorer implementation running, and 99% of the time it works perfect. However, every once in a while I get careless and run out of disk space on the drive that it runs off from. This causes the script to freak out a bit and doesn’t let anyone log in. Here is what I did to restore access to my server.

I couldn’t log in, as it would hang on “Navigation Loaded”. In the log I found this cryptic message:

message=array_key_exists() expects parameter 2 to be array, null given

I knew it had something to do with the disk space error, and it was most likely a plugin issue with the login plugin.

FTP (or access the files however you normally would) into your server, and go to the /data/cache/i18n folder. Delete the file en_plugins_messages.ser . Reload the page and you should be able to log in! If that doesn’t work, try deleting the two .ser files in the cache folder. When the page is refreshed all of these files will be regenerated.

Another thing to do while you’re deleting stuff is to check out the /tmp directory on your server (if you have access). Ajaxplorer makes a lot of files here while it zips stuff up, and sometimes things are left over. I found a 17gb zip file in there today that should not have been there. I will be purging /tmp more often now that I know that things aren’t always being deleted.

Good luck! If you need any more help check out the ajaxplorer forums at http://ajaxplorer.info/community/forum/ . They have a really great search function, so USE IT! Enjoy!