Traditionally if you wanted to use multimedia content, you would download the media and then play it with a local program. That is all fine and well, but what if you have several systems such as the ps3, xbox360, Roku, and a host of other devices. Instead of copying the files all over the place, we can use a server and keep the media all in one place.

One way to serve the media is to use what is known as upnp. This protocol now comes pretty standard on most servers. Think that Roku uses something called Plex, Plex can also be installed on traditional servers last I looked. What usually happens you point your device to the upnp server and the server will list the media files for access. Pretty nifty!

Don’t usually have much video to store, but lately I have been downloading quite a few files. Wanted a way to take advantage of upnp. We use XBMC to view or listen to media. Xmbc will even go to the internet to allow you to view video. We also make our own videos that we would like to access. Now to decide what to use. As I said most servers now support upnp.  We have a file server that uses Freenas. It is perfect place for us to store all the videos.

Time to traverse the intranet to see what the freenas server has. Forget what I called the system. No problem as I have a couple of programs that will find the system for me. Let use see what computers are up on the net and then see what IPaddresses (internet telephone numbers) are listed in the router’s phone book, Source code for the programs is available.

$ pingall.sh
64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=0.557 ms
64 bytes from 192.168.1.99: icmp_req=1 ttl=255 time=5.12 ms
64 bytes from 192.168.1.115: icmp_req=1 ttl=64 time=0.073 ms
64 bytes from 192.168.1.128: icmp_req=1 ttl=64 time=0.525 ms

$ nslookup.sh
1.1.168.192.in-addr.arpa    name = softserv.
10.1.168.192.in-addr.arpa    name = router2.
20.1.168.192.in-addr.arpa    name = router3.
31.1.168.192.in-addr.arpa    name = oesrvr1.
98.1.168.192.in-addr.arpa    name = printerland.
105.1.168.192.in-addr.arpa    name = oeorgan01.
106.1.168.192.in-addr.arpa    name = typo1.
115.1.168.192.in-addr.arpa    name = oedt01.homelinux.com.
122.1.168.192.in-addr.arpa    name = chumbino.
125.1.168.192.in-addr.arpa    name = amd800.
127.1.168.192.in-addr.arpa    name = oemsrvr01.
128.1.168.192.in-addr.arpa    name = freenas.homelinux.com.

Freenas there it is. “128.1.168.192.in-addr.arpa    name = freenas.homelinux.com”
I’ll just use the ipadress to save typing.
Logged in.

Ok now I can log in.  We want to add the service for having the server deliver content to media clients.  There it is upnp.

Let’s click the enable button and then add the additional required information.  Most all upnp servers will require this same information. What do we want this system to be know as on the network?  We can use the default port of 49152. Where do we want to keep the listing of files of what iis on the server. Usually you want this separate from the files themselves for more security.  Where do we want to keep the files on the server?  Yes we probably want transcoding. in other words we want the server to make the media content ready for what our media devices can handle. Etc. etc. We can push the save and restart the server button. (Make sure no one is use the server when you do this or they could lose data.)

That was easy. No cryptic commands to type in. You just point clock and add a little information. Now just go back to your streaming device and choose the server for the media you want to access.

Have fun!

Note: the latest version of Freenas is version 8. We are running the server on an old Pentium II with Freenas 7 which is good enough for our needs. You will want to use something newer in terms of equipment. IF you have one of the recent off the shelf from a retail store nas units, they should have support for upnp.
———————————-

Raspberry Pi to get Android 4.0 Ice Cream Sandwich (popular touchpad operating system) .  Talked about the Raspberry Pi (SOC or system on a chip computer) before in an earlier article. According to several news sources such as  http://www.zdnet.com/raspberry-pi-to-get-android-4-0-ice-cream-sandwich-7000001980/.  Although Icecream is not the latest version of Android, it is still new enough to be very viable. Hopefully Android version 4.1 will be available soon.

What is really interesting is that you can already run an optimized version of Debian linux (http://www.raspberrypi.org/downloads) on the unit. With a composite video out port, you can connect it to most portable DVD players (with composite input) or older composite monitors. That means you can have a computer for under fifty dollars.  Since you can easily strap the Raspberry Pi behind a portable dvd player or a low cost portable touch screen, it as a home made touchpad will be surely competition for all the commercially sold  touchpads out there costing hundreds of dollars.  Stay tuned!

Update: As someone reminded me, you can make your own tv set top box and use the software you like. You can even modify it the way to work the you want. Roku and the rest could be history soon.

Note: we are on the waiting list to get a unit. Review and hacks are coming.

———————————-

We need a way to know what device (i.e. computer) is what and or who. That is why we
need an internet telephone book. The internet is in some ways still is
like a telephone network. You can key in the phone number of someone to
call or you can use the phone book to lookup their phone number. The
internet is sort of the same, but now the directory assistance is built
in so to speak. The internet uses an internet protocol address instead
of a phone number, to identify which computer is which,

The Google internet protocol address is: 173.194.64.106 in this case.

Computer directory assistance:

$ nslookup http://www.google.com

Server:        x.x.x.1

Address:    x.x.x.1#xx

Non-authoritative answer:

http://www.google.com    canonical name = http://www.l.google.com.

Name:    http://www.l.google.com

Address: 173.194.64.147

Name:    http://www.l.google.com

Address: 173.194.64.105

Name:    http://www.l.google.com

Address: 173.194.64.103

Name:    http://www.l.google.com

Address: 173.194.64.104

Name:    http://www.l.google.com

Address: 173.194.64.99

Name:    http://www.l.google.com

Address: 173.194.64.106
$ dig http://www.google.com

; <<>> DiG 9.7.0-P1 <<>> http://www.google.com

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24576

;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:

;www.google.com.            IN    A

;; ANSWER SECTION:

http://www.google.com.        538147    IN    CNAME    http://www.l.google.com.

http://www.l.google.com.    248    IN    A    173.194.64.106

http://www.l.google.com.    248    IN    A    173.194.64.103

http://www.l.google.com.    248    IN    A    173.194.64.147

http://www.l.google.com.    248    IN    A    173.194.64.104

http://www.l.google.com.    248    IN    A    173.194.64.99

http://www.l.google.com.    248    IN    A    173.194.64.105

;; Query time: 12 msec

;; SERVER: 192.168.1.1#53(192.168.1.1)

;; WHEN: Thu Nov 24 19:28:07 2011

;; MSG SIZE  rcvd: 148

If I typed in  the Google’s internet address, i would be able to get to site. To remember all the internet addresses you might want go to is an extraordinary task. So the internet has directory assistance built in. I just used Google’s web site name to get to their
site. That is, it goes to a DNS (Domain name server is an internet equivalent of directory assistance) to translate the website name to an internet address and then your browser goes to that numerical address. It usually happens so fast that you may not realize what is going on. Since we will not access the real internet, so for our internet we will be setting up a crude form of directory assistance of your own. That is unless you want to remember all the numbers.

One last detail:

Like the phone book, the names are listed in a certain way. Usually the
last name and the first name. for the internet, this is an over
simplification, but the websites can have two or more parts.

http://www.google.com breaks up into:

www –  world wide web

google – the name of the domian

com- the type of domain it is. .com is a commercial site usually.

Other extensions:

org – non-profit

gov – governmental unit, and etc.

More info at http://en.wikipedia.org/wiki/Domain_Name_System


Your computer also has it’s own telephone book. It us generally known as the hosts file (lmhosts on some systems). They basically have the ipaddress and the host name. So if you wanted to add to your telephone directory, you would have to go to every computer and add the information manually.  Generally you have one ipadress for each host. Typical examples of hosts files you might run into:

For Windows XP or for Windows Server 2003

#
# 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

127.0.0.1       localhost

For Windows Vista or for Windows Server 2008

#
# 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

127.0.0.1       localhost
::1             localhost

For Windows 7

#
# 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 handle within DNS itself.
#       127.0.0.1       localhost
#       ::1             localhost


ForMac:

127.0.0.1 mydevsite.local
192.168.1.222 ads.shadycompany.biz

For Linux:

127.0.0.1 localhost
127.0.1.1 oedt01
192.168.1.31 oesrvr1  www.thesoftserv.com www.thefoodhistory.com
 www.myposgarage.com www.ohmygalleries.com www.misslizziesworld.com www.oesrvr1.com
 www.yourdrsmedicalrecords.com www.meetthekentgeeks.com www.theeddiesplace.com
 www.theeddiestable.com
192.168.1.120   oesrvr3
192.168.1.106 typo1
192.168.1.99 printer
192.168.1.115 oedt01
192.168.1.110 robopet
192.168.1.127  oemsrvr01
192.168.1.128 texttop

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

For the most part all of the hosts files are alike. In the Linux file we see quite a few hostnames associated with one ipaddress. Why? oesrvr1 is a web server and has several hostnames to support. This is typical of a web server having virtual hosts. The web server will direct you to the correct web page based on the url, you have typed in. Oh yes, I said there was an easier way to keep up with the computer’s phone numbers. Generally you do not want the to have your local phone numbers in thebig internet telephone book. Most commercial home routers have the ability to keep your local internet addresses saved. That way you do not have to list the ipaddresses aka internet telephone numbers on every computing device. You also do not have to memorize the ipaddresses either. Just go to the services tab (if you are running DD-wrt) or the equivalent and you can enter in the information for your equipment.

You need to know one more piece of information to do this. You need what is known as the Mac (media access control) address. Nothing to do with Apple computing, though their computers also have these addresses.  Every network card or device get assigned a unique number so that you can tell what type of network card you are using is.  Just go to your network icon and get the properties. You can also get the same information from the command line by either using ipconfig or ifconfig depending on the system you are using. Sometimes the mac address is known as the hardware address (HWaddr). The format is usually six sets of two numbers with a colon to separate each set of two hexadecimal numbers . I have used a fake one here.

$ sudo ifconfig eth0      Link encap:Ethernet  HWaddr 00:ff:e1:35:b4:c3

inet addr:192.168.1.115  Bcast:192.168.1.255  Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

RX packets:375639 errors:0 dropped:0 overruns:0 frame:0

TX packets:244524 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:503291368 (503.2 MB)  TX bytes:26630166 (26.6 MB)

Interrupt:18 Base address:0xb000lo        Link encap:Local Loopback

inet addr:127.0.0.1  Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING  MTU:16436  Metric:1

RX packets:5216 errors:0 dropped:0 overruns:0 frame:0

TX packets:5216 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:591225 (591.2 KB)  TX bytes:591225 (591.2 KB)

Your router will generally have an input screen asking for the mac address the hostname you want to use and then the ipaddress you want to use.  On a home router, you will need to know the network you are on. Generally it is the first three numbers of the ipaddress. Actually it is more complicated than that, but you can research it.  For the address of this unit 192.168.1.115,  192.168.1 is the network. Your router will have this information.  In this what is known as a class C network, you can use addresses 2-254 for your devices for the fourth number. If you have more than 250 devices, you probably need more sophisticated networking equipment.

I would go to the router and use (enter)
Mac address: 00:ff:e1:35:b4:c3
Host: oedt01
ipaddress:  192.168.1.115
Save that information in the router. That means next time anyone can use oedt01 to address that machine instead of having to remember 192.168.1.115.
What if I wanted to know someone elses mac address such as texttop? On a linux machine:
$ ping texttop

PING texttop.homelinux.com (192.168.1.128) 56(84) bytes of data.

64 bytes from texttop (192.168.1.128): icmp_req=1 ttl=64 time=0.594 ms

64 bytes from texttop (192.168.1.128): icmp_req=2 ttl=64 time=0.284 ms

64 bytes from texttop (192.168.1.128): icmp_req=3 ttl=64 time=0.273 ms

64 bytes from texttop (192.168.1.128): icmp_req=4 ttl=64 time=0.247 ms

^C

— texttop ping statistics —

4 packets transmitted, 4 received, 0% packet loss, time 3004ms

rtt min/avg/max/mdev = 0.247/0.349/0.594/0.143 ms

eddie@oedt01:~$ arp -a

texttop (192.168.1.128) at 00:32:d5:3c:b1:22 [ether] on eth0

textserv (192.168.1.1) at 00:42:28:5b:22:ac [ether] on eth0

You could then take the mac address (00:32:d5:3c:b1:22) and go to http://www.coffer.com/mac_find/ and find out what kind of network card they are using. For instance Dell computers have used 3Com cards a lot. Where I used to work, people would like to come in and use our network for their own purposes. On a network, a computer known as the DHCP server keeps all the information about what is connected. Since we only used one kind of network card, it was easy to see who was definitely not supposed to be connected to the network. They were investigated quickly. You will want to keep a list of all the connection information of your computers and devices for security reasons.
One last hint, you may want to segregate the ipaddresses for your equipment. For example:
192.168.1.1 – 192.168.1.30 would be for routers.
192.168.1.31 – 192.168.1.75 could be for servers.
192.168.1.90 – 192.168.1.99 could be for printers,
192.168.1.100 – 192.168.1.254 would be everything else.
Easier to tell which equipment has failed by ipaddress. You know where to access the equipment in a hurry.

———————————-

Several computers for the price of one. You can not beat a deal like that. Actually you will still have only one computer but we will use the power of the system to allow it to run what is known as virtual machines or computers within a computer. Actually this has been done for a long time, but only now is the general community starting to take advantage of it.

A little history first. It used to be if you wanted to use more than one operating system on your computer, you had to do what is known as dual or multi-boot. You had more than one operating system you could use, but only one at a time. Remembering when I was a tech, the college I was working for wanted to get rid of their unix server. They wanted each student to have their own  ‘nix system to work with. So we took a machine with already installed Microsoft product and squeezed in Linux operating system install. Linux was going to be taught to get to know Unix. When the students started up the computer for their access, you had a choice of Redhat 7 (original version prior to Fedora) and the Microsoft product. Dual boot systems can be a bear to support, though now it is a lot easier with Grub2 (booting software).

One real killer in this is that Microsoft is requiring software on newer equipment to boot the computer that will severely hamper running other operating systems.  They say it will make the system more secure. Microsoft software seems to be the only software that needs it so far. Linux and other operating systems are robust enough not to need it so far. Many people think this is just a ploy to lockout competitors. If an operating system worked correctly to begin with, the special boot software would not be needed.

Moving ahead, operating systems developers saw the need to run more than one operating system (virtual machine) at once and avoid all the dual booting. Newer more powerful computing equipment aided in making virtual machines much easier. There are a quite a few products such as VirtualBox and Qemu to accomplish this.  General you will have a program that acts as a director. That means your computer will be a host to other operating systems.

 
One advantage of  having the virtual machines is that you can experiment with new software. You might want want to experiment with Linux without having to redo or reinstall your computer. The director allows you to use a file as if it was a disk partition on your system. That way can make multiple copies of the file. If you destroy one copy for what ever reason, you can easy just use another copy. As for my self I will set up a virtual machine of a new version of Linux or a Microsoft So see how well they work with existing software. As a tech, I had to install software for students to use. Every time a new version of  Microsoft operating system came out, quite a bit of the existing software no longer worked. With a virtual machine software could have been tested before installing the new operating system for production, And on the other hand we could of used the virtual machine to keep using the existing software running till updates could be installed to solve problems.
Another advantage of having virtual machines along the same lines is that you can set up a sandbox. A sort of virtual machine play area where you can experiment installing software. See what the issues are. You can use them for dealing with testing and finding solutions for malware. In fact a lot of people use a sand box to get on the internet. On servers , they are also known as jails.  So if malware destroys the virtual machine, the host system is not affected. They also can be done for computer forensics. You want to know what has been done to a machine by a specific person or persons. A picture or copy if you will of a users hard drive is loaded into a virtual machine to collect evidence of a possible crime. That leaves the original machine undisturbed and intact in case other investigation work needs to be done.
 

Where some real advantage can come into place is with servers. You do not have to have all the software on one server. Sometimes software can cause conflict, so if I can have a virtual machine for specific purposes such as one for a mail server, one for a web server, one for a media server, and etc. You can update fix issues on an individual servers without affecting the rest.That means less downtime.  On big issue with running virtual machines is the amount of memory you need. The fancy mouse environments (GUI – graphical user interface) take up a lot of space (aka ram). If you can run a server well as any computer without the GUI, you are at an advantage, You can then run more virtual machines on the same amount of hardware!  More return on investment.

Sometimes the gui-less environment is called the command line. Linux, Unix, BSD, Novell, and a host of other operating systems have done this all along in being able to run without a gui. The command line makes remote access so much easier. You can control a computer from half way around the world with just a keyboard. Microsoft prided themselves on having an environment for using the mouse. Even they have allegedly relented and their new servers will be able to be operated from the keyboard only.  System administrators have a joke about the gui-ed environment when they want people to become part of their team. “Mouse jockeys need not apply!”

We have no problem with the gui environment, but it is so much easier to document, let computers control themselves with batch/shell files, and the ability to use reduced resources. Ironically, not so long ago when the gui environment first became available, people screamed bloody murder about have to use a mouse and how it slowed them down. Here we come full circle again. Reminds me of the dos days.

In any case, have talked too much. Just wanted to give a blurb about virtual machines. By the way, you can combine the gui and the command line to make things so much easier. Cut from a web page and paste in right into the command line. Heaven.

———————————

One of my favorite new little programs is mpd. What does it do? It is a music player that you can control remotely from the command line.  You can leave a set of speakers connected to the host machine then control it remotely. To install:

$ sudo apt-get mpd mpc

The you will want to set the music directory
$ sudo vim .etc.mpd.conf

Change the music directory to where your music is:

# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon’s online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory “/media/storage/music”

and then you will need to change from local host to the ip or the hostname of your machine.

# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon.
#
# For network
# bind_to_address “localhost”
bind_to_address “typo1”

Set the port to use.
# And for Unix Socket
#bind_to_address “/var/run/mpd/socket”
#
# This setting is the TCP port that is desired for the daemon to get assigned
# to.
#
#port “6600”
port “6601”

Then on a remote machine you want to install a control program.

$ sudo apt-get install ncmpc

to invoke the program you append the host name and the port to use.

$ ncmpc –host=typo1 –port=6601

———————————-

Testing QPopper

The easiest test for QPopper is to connect up to it via a telnet session and see if you can get a response. Figure 17 shows a sample session.

Figure 17: Testing QPopper

doug@solaris 12 % telnet localhost pop-3
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
+OK QPOP (version 2.2) at solaris starting.  <630.897723195@solaris>
USER doug
+OK Password required for doug.
PASS PPPPPPPP
+OK doug has 0 messages (0 octets).
QUIT
+OK Pop server at solaris signing off.
Connection closed by foreign host.

——————————————–

Poached chicken with mushroom sauce over a bed of rice and peas.

Good day.

Advertisements