Overcoming Twitch.tv sound issues

This journey to streaming has been an interesting one so far. I am by far a “Streamer” having only been doing this for about a week. Every day I am learning so much and I truly am getting progressively better at my streams.

I have conquered the first two of my hurdles. The first was video. I solved that early on with a simple, and small, webcam. It’s basically a potato but I had to start with something and it was what I had laying around. The second was sound and this one was a little more complicated.

At first I was looking online for a DAC to connect to my computer. Then I remembered that I had something that should work setup in my garage. Since its about 32 degrees outside during this time of year, I won’t be hanging out in the garage any time soon so I removed the setup from there and installed it at my desk.

That’s when my first problem started. This was a simple one; I had to get the levels right between my mic, music, and the game sounds. With a live stream it is hard to monitor what you are broadcasting and what the person on the other end of the stream watching is seeing/hearing. I first started to tackle this problem by having my laptop logged into the stream and watching as if I was just another person. Lesson: Be sure to mute the sound or your microphone or else you will get an echo feedback.

The other solution I came up with was to have my wife log into the stream while she was working in the other room and have her listen and give me feedback if things sound strange. I found that this works quite nicely but it requires that you have another person, preferably within close physical proximity, that you can communicate with.

Then I discovered various tools that you can use (the twitch dashboard for instance) that allow you to monitor your stream. These tools and sites mostly let you monitor your bit rate (which is very important) to make sure that you are not lagging on upload during the stream. Unless you have headphones, it is difficult to listen to the live stream while you are actually broadcasting because there is about a 15-20 second lag between you doing something and the stream actually reaching that point.

Using the monitoring sites you can at least be sure that once you have everything dialed in and working, your broadcast is actually running smoothly. The next issue that I ran into may be caused by the cheap DAC that I am using. It came with my mixer and seemed to be working fine in the garage, but now it started to give me problems; the main being a buzzing feedback it generated. If you have ever heard a mechanical hard drive working that is what it sounded like.

This sound was easily heard in some of the streams that I was doing and that’s not good. No one wants to listed to a channel that has bad sound. Keep in mind that no one HAS to watch your channel. By disconnecting the USB DAC, the buzzing sound would stop so that is definitely where the problem was.

I was able to alleviate the buzzing but still be able to use my microphone through the mixer by removing the “input” to the DAC and instead having OBS stream the sound directly from the application of the game I was playing. So even though I was not running the sound through my mixer, and lost some of the controls that afforded me, I produced a very good sounding podcast that was free of the dreaded buzzing.

Those two issues took at least a week for me to completely figure out. Today was the first day that I streamed a decent stream that sounded and looked good. It was also the first day that I streamed the game Rimworld! I have not played the game for a VERY long time and apparently they have added a LOT to the game. I am finding myself having to re-learn almost the entire thing. It is a lot more energetic to play than DF, and I think more entertaining to watch. I may have to switch my focus to that game or even something else that is similar.

Tomorrow I hope to stream even more. I am really shooting for a “full day” stream and would be interested to see how many views I can get doing such a long stream. I think that Rimworld is much better suited to this type of play so I will be sticking with that game for the rest of the week.

I’m Learning Photoshop

There is so much you can do with Photoshop. It is probably the most useful piece of software out there for editing and creating digital artwork and photos. In my quest to create content for my twitch.tv channel I have started to use the program on a daily basis. Which is leading me to a lot of learning.

Photoshop has always been one of those programs I felt like I should know how to use, but never had a strong need for. I’m the type of person who learns from being hands on, on experience and my Photoshop tasks where too few and far between for me to really grasp its workings.

Over the past two days I feel that I’ve fallen in love with the program. It has turned into a creative experience in both my using it and in the things that it allows me to do. Specifically I have been creating banners that have a enamel finish with a shine to them. Doing this in Photoshop has changed my perspective on just how the program works.

I have come up with a maxim for Photoshop: “Let Photoshop do the work”. What I mean by this is you have to think of working with Photoshop like working a machine. In this case the machine would be a complex and powerful one. You can either try to build this machine custom for every project, or you can use the dials and settings on the machine to have it do the work for you with you just entering the parameters. Photoshop does the work for you as soon as you know what parameters to enter and what dials to turn.

Once you find the location of the dials and the position of the parameters, you have the power of the program at your fingertips. There is a wealth of content online in blogs and YouTube on how to do pretty much anything you can think of. The amount of knowledge that is being shared in the community is staggering. I am truly thankful to all of the people out there who share their knowledge with the world.

I am excited that my twitch.tv channel is starting to look good. The custom banners and buttons really makes the page look like you are creating good content. On today’s steam I had 5 or six people watching at one time. This was in-spite of the fact that half way through the stream I checked the audio to find that it was playing a sort of hard drive electronic sound throughout. I’m still not sure how I am going to rectify this as every time I plug in the USB DAC it makes the noise. My first reaction is to get a better DAC that should filter out the electronic feedback from the hard drives.

So that is the full and successful day that I had. I was able to write, stream, blog, and meditate today. The slow and steady road is the one that leads to success. I know that I can do this one step at a time.

OpenVPN – Client working on Linux

I have been having a great time with my new pfsense router setup, especially the OpenVPN remote access server that I have setup on it. Connecting to my home network through my phone has been great for remote troubleshooting and all around fun. Unfortunately,  I was having a little trouble getting my Digital Ocean VPS to connect to over the VPN to my home network. After a few hours, and many google searches with little results I finally figured out the issue. Hopefully this will help out others who are trying to get this working on a headless VPS!

From the pfsense box, you are going to want to export your client configs for the VPS you are wanting to connect. This is pretty straightforward and can be done from the pfsense web interface (VPN|OpenVPN|Client Export). If you run into trouble here, make sure that you have a user setup (System|User Manager). I recommend that you use the “Standard Configurations|Archive option for the export.

Once you have the config files, get them over to your VPS securely. I used SFTP to copy the files over. Now here is where the real fun starts!

Normally to connect to the OpenVPN access server you simply use the following command:

sudo openvpn <config>

Where the <config> is your configuration file (default exported as a .ovpn file). The issue I was running into was that after entering this command the client would start but it would just sit there and no connection to the access server would be made.

To find more info on what exactly was going on I used the verbose flag in the configuration file by adding this line:

verb 3

This showed me that the connection was waiting for the management-hold whatever that is. I think this is used if you are running the client from a computer running network-manager but I’m not sure. Once I found this out I edited the configuration file to comment out the management sections like so:

# dont terminate service process on wrong password, ask again
auth-retry interact
# open management channel
#management 127.0.0.1 166
# wait for management to explicitly start connection
#management-hold
# query management channel for user/pass
#management-query-passwords
# disconnect VPN when management program connection is closed
#management-signal
# forget password when management disconnects
#management-forget-disconnect

Notice that I did not comment out the ‘auth-retry intereact’ line but I’m not sure if it makes a difference.

Once the config file was edited I was able to get the client to get to the point where it prompts for the username and password and everything connected just fine! Hopefully this will help out others who where having this issue. From searching online, I mostly found information on how to connect with the network-manager GUI which is useless in a headless case like this.

 

Migrate FSMO Roles (INFO.DUMP)

I recently installed a few new Server 2012  servers to my existing Server 2003 domain and one of them is going hold the FSMO roles for the forest. Below are my notes that I compiled on how to transfer all the important roles from a Server 2003 machine to a Server 2012 machine. Keep in mind that the processes is the same for Server 2008 migrations as well and will also work when doing 2012 to 2012 migrations.

<Begin (INFO.DUMP)>

To transfer a domain-level operations master role:
—————————————————————————-
1. Open Active Directory Users and Computers: On the Start menu, point to Administrative Tools, and then click Active Directory Users and Computers. If the User Account Control dialog box appears, provide Domain Admins credentials, if required, and then click Continue.

2. At the top of the console tree, right-click Active Directory Users and Computers, and then click Change Active Directory Domain Controller.

3. Ensure that the correct domain name is entered in Look in this domain. The available domain controllers from this domain are listed.

4. In the Name column, click the name of the domain controller to which you want to transfer the role, and then click OK.

5. At the top of the console tree, right-click Active Directory Users and Computers, click All Tasks, and then click Operations Masters.

6. The name of the current operations master role holder appears in the Operations master box. The name of the domain controller to which you want to transfer the role appears in the lower box.

7. Click the tab for the operations master role that you want to transfer: RID, PDC, or Infrastructure. Verify the computer names that appear, and then click Change. Click Yes to transfer the role, and then click OK.

8. Repeat steps 5 and 6 for each role that you want to transfer.
# Note: If you are creating multiple domains you will want the ‘Infrastructure’ master role to be seperate from the ‘Global Catalog’ server. If you are creating a single domain then it does not matter.

Transfer the schema master role:
—————————————————————————-
1. Open the Active Directory Schema snap-in. If you have not already installed the Active Directory Schema snap-in, please see Install the Active Directory Schema snap-in (http://go.microsoft.com/fwlink/?LinkID=209652).

3. In the console tree, right-click Active Directory Schema and then click Change Domain Controller.
# Note: This must be done on the existing scehma master.

4. Click Specify Name and type the name of the domain controller that you want to hold the schema master role.

5. In the console tree, right-click Active Directory Schema, and then click Operations Master.

6. Click Change.

To transfer the domain naming master role:
—————————————————————————-
1. Open Active Directory Domains and Trusts.

2. In the console tree, right-click Active Directory Domains and Trusts, and then click Connect to Domain Controller.

3. In Enter the name of another domain controller, type the name of the domain controller you want to hold the domain naming master role.

Or, click the domain controller in the list of available domain controllers.

4. In the console tree, right-click Active Directory Domains and Trusts, and then click Operations Master.

5. Click Change.

NOTES:
—————————————————————————-
* RID Role: The RID Master FSMO role owner is the single DC responsible for processing RID Pool requests from all DCs within a given domain. It is also responsible for moving an object from one domain to another during an interdomain object move.
* http://msdn.microsoft.com/en-us/library/cc223751.aspx

* PDC Role: Handels password changes, logon authentication master, account lockout, etc.
* http://msdn.microsoft.com/en-us/library/cc223752.aspx

* Infrastrcuture Role: When an object in one domain is referenced by another object in another domain, it represents the reference as a dsname. There is one Infrastructure FSMO role per domain and application NC in a directory.
* http://msdn.microsoft.com/en-us/library/cc223753.aspx

* Instructions to identify operations master roles: http://technet.microsoft.com/en-us/library/cc758669(v=ws.10).aspx
* RID: dsquery server -hasfsmo rid
* PID: dsquery server -hasfsmo pdc
* Infrastructure: dsquery server -hasfsmo infr
* Domain Naming Master: dsquery server -hasfsmo name
* Schema Master: dsquery server -hasfsmo schema

<End (INFO.DUMP)>

Crazy-Bad Windows 8 Metro Chrome crap.

If you can’t tell I have a little animosity towards Windows 8. A while back, before Windows 8 was released, seeing a video put out by M$ talking about how their analytic’s showed that no one was using the “Start Button”. I remember thinking that this was an insightful remark because I know that everyone who uses Windows 7 will launch applications from either the desktop or the “Task Bar” without ever even touching the “Start Menu”.

So in my mind I’m thinking they are going to end-up with something similar to the Mac OS launcher that resides at the bottom of the screen. But OH NO! That would be a good thing and M$ has to always fuck up. So what do they do? They essentially force everyone to use the “Start Button” by 1) making the start menu the default screen when you log in 2) making the start menu full screen!

But I digress….

Today I just want to do a quick post on how to get Google Chrome to open as a window on the desktop rather than full screen as a Metro style app.

In order to do this you have to edit the registry (disclaimer: you can really mess things up when editing the registry. If you don’t know what you are doing then you might want to just leave it alone.)

Here is the key that you need to edit:

HKEY_CURRENT_USER\Software\Google\Chrome\Metro\launch_mode

On my machine I had to create the “launch_mode” DWORD. (Right-click\New\DWORD (32-bit) Value).

Set the value to “0” and then re-open Chrome. It should now open in the sane windows desktop mode rather than the insane Metro mode.

Setup SSL (https) for ownCloud (info.dump)

Here is another info.dump with directions on how to setup SSL on your ownCloud server.  This will greatly improve the security of your server by not allowing an attacker to intercept your password in plain text over the internet. If you are going to be using the ownCloud outside of a private LAN, this is a must!

NOTE: Most of these directions where found here on the ‘Ubuntu Server Guide’ site…

http://ubuntuserverguide.com/2013/04/how-to-setup-owncloud-server-5-with-ssl-connection.html

Server is assumed to be running Linux (Ubuntu 12.04).

Change to ‘root’:
sudo -i

Edit file /etc/apache2/sites-enabled/000-default,  change AllowOverride None to AllowOverride All.

You should edit the section of the file to looks like this:
DocumentRoot /var/www
Options FollowSymLinks
AllowOverride All

You will need to enable apache module mod_rewrite, mod_headers and mod_ssl to enable both modules use the following command:
a2enmod rewrite && a2enmod headers && a2enmod ssl

Restart apache2 daemon:
service apache2 restart

Edit the configuration file /ect/ssl/openssl.cnf:
Change the following lines in the document with the following information:

dir = /root/SSLCertAuth
default_days = 3650
default_bits = 2048
countryName_default = US
0.organizationName_default = "Organization Name"

Create Directory to save the SSL Certificate Authority, in this case make the directory name SSLCertAuth:

mkdir /root/SSLCertAuth
chmod 700 /root/SSLCertAuth
cd /root/SSLCertAuth
mkdir certs private newcerts
echo 1000 > serial
touch index.txt

To generate the Certificate Authority (CA) run the following:
Note: Be sure to enter in your PEM passphrase and log it in a secure location. Also, you should make sure that you fill in the correct information for your cert. The common name will be your sites external site address.

openssl req -new -x509 -days 3650 -extensions v3_ca \
-keyout private/cakey.pem -out cacert.pem \
-config /etc/ssl/openssl.cnf

Create a Certificate Signing Request:

openssl req -new -nodes \
-out apache-req.pem \
-keyout private/apache-key.pem \
-config /etc/ssl/openssl.cnf

Generate the certificate:

openssl ca \
-config /etc/ssl/openssl.cnf \
-out apache-cert.pem \
-infiles apache-req.pem

Copy the files to directory /etc/ssl:

mkdir /etc/ssl/crt
mkdir /etc/ssl/key
cp /root/SSLCertAuth/apache-cert.pem /etc/ssl/crt
cp /root/SSLCertAuth/private/apache-key.pem /etc/ssl/key

Configure HTTPS apache2 web server, create the SSL log and create a new file /etc/apache2/conf.d/owncloud5-ssl.conf to add the SSL virtualhost:

mkdir/var/www/logs
touch /etc/apache2/conf.d/owncloud5-ssl.conf

Edit the file with the following info:

ServerName "Server IP"
SSLEngine on
SSLCertificateFile /etc/ssl/crt/apache-cert.pem
SSLCertificateKeyFile /etc/ssl/key/apache-key.pem
DocumentRoot /var/www/owncloud
CustomLog /var/www/logs/ssl-access_log combined
ErrorLog /var/www/logs/ssl-error_log

Restart the apache2 server:

service apache2 restart

That is it! Now goto your ownCloud page with https:// and you should have a secure connection!

NOTES:

  • You will need to make sure that you have your NAT forwarding port 443 to your server to allow the secure traffic to reach it.
  • If this does not work (EX. You dont get a webpage) you may need to make sure that you have the correct info entered in the /etc/apache2/conf.d/owncloud5-ssl.conf under DocumentRoot /var/www/owncloud. I have seen this location possibly be different if you did not install using the ownCloud repo (see me other post on installing ownCloud for the right way to do it: http://atari911.com/2013/07/29/install-owncloud-info-dump/).
  • You will see a red X over the https://. This is because we are using a “self signed certificate” and it was not verified with a trusted authority. All this means is that the world wide web does not trust you because you are not a big, money hungry corporation. This message can be safely ignored because if you cant trust yourself, who can you trust?

Install ownCloud (info.dump)

Here is a quick info.dump that lays out the commands required for installation of ownCloud 5.0.x on a server running Ubuntu 12.04.

Run the following as root (EX sudo -i):

Add the repository key to apt:
wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/Release.key
apt-key add - < Release.key

Add the PPA:
echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/ /' >> /etc/apt/sources.list.d/owncloud.list

Install:
sudo apt-get update
sudo apt-get install owncloud

That is about it!

Notes:
./var/www/owncloud/data is where the info is stored.
./var/www/owncloud/config/config.php is where the configuration file is located.

Check active internet connections

Every once in a while I will notice the network light on my laptop is flashing when I am not doing anything that I know of online that would cause this. Wouldn’t it be nice to be able to see what programs are communicating with the network?

By using the ‘netstat’ command you can! Just use the following switches to get a nice list of what programs are communicating with what remote server and on what port:

netstat -tunp

You should get an output similar to this:
outputofnetstat

PLEX Media Server

I recently setup PLEX on my home media server. Here I will go over the setup and configuration required to allow PLEX to serve your media files and then push them to your Roku for TV viewing.

There where a few things to note about PLEX:

* I could find no solution for adding authentication to your PLEX server. This means I would not recommend that you point your PLEX server to the outside world. If you do, anyone who knows your IP address could brows and watch your media. Also, this may open up a plethora of attack vectors to your server.

* PLEX is a great solution if you have a ‘headless’ server. Headless means that you only have the server connected via network connection and do not have a monitor attached. In this case I would connect the PLEX server to something like a Roku box (http://www.roku.com).

* It is very important to the PLEX server how you organize your media. Once setup (see below), PLEX does an excellent job of searching various databases for media information and it displays that information seamlessly. Once everything is configured it does all the work for you.

This being said I am going to go over how to install PLEX on an Ubuntu 12.10 (Most other versions of Ubuntu and flavors of Linux should be similar, if not the same) configure it and organize your media files.

Install PLEX:

Installation of PLEX as a breeze because they support Linux from the start so no compiling of source code is required. They also make it easy for Debian based distributions (EX Ubuntu) by including a .deb on their site.

First thing you will want to do is download the package:

Version 0.9.7.28.3 64-bit: 
wget http://plex.r.worldssl.net/plex-media-server/0.9.7.28.33-f80a4a2/plexmediaserver_0.9.7.28.33-f80a4a2_amd64.deb

Version 0.9.7.28.3 32-bit:
wget http://plex.r.worldssl.net/plex-media-server/0.9.7.28.33-f80a4a2/plexmediaserver_0.9.7.28.33-f80a4a2_i386.deb

NOTE: They also have RPM packages for CentOS and Fedora available on the site: http://www.plexapp.com/getplex/

Now that you have the package downloaded on your server you are going to want to install that package:

dpkg -i <package.deb>
Where <package.deb> is the name of the package you downloaded.

This will install the PLEX server onto your system. That’s really all there is to it.

Configuration of PLEX:

Once PLEX is installed on your server you can check to make sure it is running, as well as configure the server by pointing your browser to:

http://localhost:32400/web/index.html

To begin adding content to your PLEX server you will have to point the server to where you have your media stored. You can do this by going to the “My Library” section at the top of the page and clicking on the “+” sign to path a location. When you press the “+” button you will be presented with the following window:
 
1_PLEX Add Library Section
It is important here to point out the different options that you are able to select because each option will tell the server what ‘type’ of media is stored at the location.

For instance, if you point the Movies section of the PLEX server to a folder that contains all of your Simpsons episodes, the server will not display the media in the correct format. It will think that every episode is a movie and will attempt to download movie information about each episode and fail, leaving you with a mess of content and no media info.

You can refer to the Wiki to get a good idea of the proper naming conventions here:
http://wiki.plexapp.com/index.php/Media_Naming_and_Organization_Guide

Once I pointed PLEX’s “Movies” option to the folder that contained all my movies, it picked it up and automatically added the meta data without any special re-naming of the actual sub-folders or video files.

Also, PLEX has dealt with just about every video format and container that I have thrown at it without a problem.