Tech Talk & Other Thoughts

Some nerd talk by Brian and other random thoughts

This is a follow up to setting up my Dell M1730 laptop up with Ubuntu post as I configure it to be a decent media server.

VNC

The keyboard on the laptop is broken. I had to buy a cheap USB keyboard so that I could get the installation done. Now that it is installed I plan to just VNC into the computer to do everything (or SSH when command line execution is sufficient).

Since Vino comes with Ubuntu I went with that. It defaults to port 5900 and I wanted to change it to use the alternative port using dconf-editor as noted here. Also it is REALLY slow and after a bit of reading I found that checking the ‘ disable_xdamage ‘ option fixed things. I’ve read that this isn’t the most bandwidth efficient way to do things, but I’m happy with the result for now.

(Update: 12/14/2014)  I’ve upgraded to the next version of Ubunut (v???) and it wiped out my VNC settings. So instead of vino this time I used x11vnc.  In just a few minutes of using it, x11vnc appears to be much much more response.  I’m not sure x11vnc is going to keep the settings after a reboot, but for this boot I’m much happier with my VNCing experience

 

SSH

This was pretty easy to setup. I already forgot what I did here, but never-the-less it works using Putty from my windows laptop.

I was just reading about exporting displays using Xming, X-win32, or Exceed and may give that a try some other time.

Wake up on LAN (WOL)

My ethernet card supports WOL and it is easily enabled in the Power Settings. Note, the wake up only works if Ubuntu is in standby mode and not fully shutdown.

I also configured my dd-wrt router in the Administration->WOL section to enable the WOL for this computer.   Now when I put the computer into Suspend (not shutdown) I can go into the DD-WRT webpage and through the WOL section click the “Wake Up” button. The webpage shows the following (actual MAC address replaced with XXs) and the computer wakes up

Waking up XX:XX:XX:XX:XX:XX with 192.168.1.255:7...

The next thing that I wanted to setup is to be able to wake up this computer from an external IP. Right now the only way I can click the “Wake Up” button is to be on the internal LAN and I’ve blocked public access to this page. After tinkering around for a day I’ve discovered there isn’t any simple thing out there that I’m looking for. What I really want to be able to do is from any computer (i.e. no special software) turn on the media server. Since there isn’t anything good out there right now I’m going to take this up as a new project and will post about this whenever it is working.

 

SAMBA

I setup SAMBA to get to the drives over the network on my windows laptop. This is a good guide http://www.noobslab.com/2012/03/configure-samba-sharing-between-ubuntu.html. I setup access a bit different for my own network, but this helped a lot.

 

XMBC

I’ve relocated my laptop along with an external drive so that it is connected directly to the LAN.  With XMBC I plan to watch many of my movies through the PS3 since this is the normal way that we watch bluerays too.  For this I’m more interested in stability than the latest and greatest so and the setup is pretty easy once you get to the right link in XMBC.

 

sudo apt-get install python-software-properties pkg-config
sudo add-apt-repository ppa:team-xbmc
sudo apt-get update
sudo apt-get install xbmc

Then I learned this really isn’t a DLNA server and isn’t what I need.  I have it working, but I’d really like to play my videos through the PS3.

 

PS3 Media Server

I use PS3 Media Server on my windows machine and it works great so I set out to use this on Ubuntu. Here is my starting point: https://help.ubuntu.com/community/Ps3MediaServer. I did a manual install to get 1.72 since in 1.71 ,the ppa version, there is a bug. After I got it loaded I tested it on a few videos. MKVs seemed to work, but some some AVI files (like my Lord of the Rings) did not have audio. Other AVI files worked and I wasn’t too sure what the difference was between the working and non-working files. So I decided to look for another option.

Mediatomb

There was a lot of talk about Mediatomb, so I installed that. But after opening things up it looks confusing and I wasn’t really interested in figuring this out (though I’m sure it is pretty good).

Universal Media Server (UMS)

So onto option C, Universal Media Server (UMS). UMS is just a branch off of PS3 Media Server which is nice since I’m already familiar with it. I got the tarball from http://www.universalmediaserver.com/ and extracted it to /usr/sbin with the ums-2.2.0 default folder. I noticed that there was a error about mediainfo so I did an install

sudo apt-get install mediainfo

With it open on the default setting I did a few tests and all the files worked including the all important Lord of the Rings videos. I then made a few slight changes to the defaults, but am really happy that this work right out of the box, so to speak. I set UMS to start minimized, force the network to use eth0 rather than the wireless card, set the max bandwidth to 0, and added the movieinfo plugin.

With that my media server if pretty close to being in working order. I’ve discovered that there is an issue with the DVI output that looks like will take some time to get it working or perhaps will never work. But that is another post.

Tags: , , , , , , , , , , , , ,

Well shortly after posting about how I got my router loaded with DD-WRT and had all my USB drives working I discovered that my USB drives were no longer working.

After poking around a bit I found there were errors generated when the automount script was executing. In particular I was seeing:

root@BLT_ROUTER:/opt/etc# service automount status
cannot touch `/opt/etc/nomount': Input/output error
S35automount: Create /opt/etc/automount
cannot touch `/opt/etc/automount': Input/output error
I can not write /opt/etc/automount, abort

When I went to the directory I saw the following (most files removed to keep the list short)

root@BLT_ROUTER:/tmp# ls -al /opt/etc
total 1608
drwxr-xr-x 16 root root    4096 Dec 12 18:20 .
drwxr-xr-x 23 root root    4096 Nov 15 08:15 ..
drwxr-xr-x  3 root root    4096 May  5  2011 asterisk
??????????  ? ?    ?          ?            ? automount
...
??????????  ? ?    ?          ?            ? nomount
-rw-r--r--  1 root root   35782 May  5  2011 nzbget.conf
-rw-r--r--  1 root root     104 May  5  2011 p910nd
drwxr-xr-x  2 root root    4096 Feb 23  2012 php.d

A quick search found this forum post where it was suggested to Stop automount (service automount stop) and then delete the two files.

This worked to delete the files, but when I rebooted the router only the /opt share came up. I messed around with this for quite a while and realized that something wasn’t right with the USB drives. So I disconnected them from the router and rebooted the router. Next I unplugged the USB drives power cord (where I noticed that one of the drives was unplugged, probably from when I was adding setting up my media server). After a short while I plugged in the drives power cord and the USB cable back into the router.

After another reboot the automount script came up correctly, however it lost my custom mounting assignments. So I edited the /opt/etc/automount file in the same manner that I posted earlier. Next I did restarted the automount and samba services

service automount stop
service automount start
service samba stop
service samba start

Finally, I’m backup and running.

Tags: , ,

Here is a recap of an old project. following this straight through won’t be enough to redo what I’ve done, but the websites and hints that I followed are linked throughout this post.

I bought a Belkin PlayMax 600HD router from Best Buy because I read in some review that I could do port forwarding (needed to setup my own server at home).  Well after a lot of time in the settings and several emails to Belkin it turns out that this feature isn’t built in.  So after a friend told me about dd-wrt I decided to give it a shot after reading a lot of forums to see if my router would work.  This forum post on dd-wrt.com is about my router.

For the most part I followed the instructions from teh dd-wrt site: http://www.dd-wrt.com/wiki/index.php/Installation

Start by doing a 30/30/30 reset. The text below is copied from the dd-wrt website.

Hard Reset (aka 30/30/30 reset):

The following procedure will clear out the NVRAM and set dd-wrt back to default values:

  • With the unit powered on, press and hold the reset button on back of unit for 30 seconds
  • Without releasing the reset button, unplug the unit and hold reset for another 30 seconds
  • Plug the unit back in STILL holding the reset button a final 30 seconds (please note that this step can put Asus devices into recovery mode…see note below!)

This procedure should be done BEFORE and AFTER every firmware upgrade/downgrade.

Do not use configuration restore if you change firmware builds (different svn build numbers).

I got my files from ftp://ftp.dd-wrt.com/others/eko/V24-K26/

  • dd-wrt.v24-15508_NEWD-2_K2.6_mini.bin
  • dd-wrt.v24-18946_NEWD-2_K2.6_mega.bin

My Router is advised to only use the TFTP: http://www.dd-wrt.com/wiki/index.php/TFTP_flash

First I flashed the 15508 mini and then a 30/30/30 reset.  Even though I’m advised to use TFTP I used the webpage GUI  to flash the 18946 mega and followed up with a 30/30/30 reset.  I’ve found that Firefox has issues with webpage GUI and have reverted to Internet Explorer for all setting changes and flash updates.   I actually tried several different version and sizes for my router and sometimes had issues with enabling SSH or other weird things.  I even had a problem with the 18946 mega for a while, but after a lot of time trying different things I believe that I simply didn’t get a good flash from either not doing a 30/30/30 reset properly or something else.  But in the end the 18946 mega works for me.

In the system settings I now see:

Router Name: BLT_ROUTER
Router Model: Belkin F7D4301 / F7D8301 v1
Firmware Version: DD-WRT v24-sp2 (04/07/12) mega – build 18946M NEWD-2 K2.6 Eko

There is a ton of configuring to do that I’m not going to get into because I either don’t remember what I set or I’m concerned about leaking potential security details.  Things that I’ve added are Wake up on Lan (WOL) for my media server, SSH is a must to get into the file system from within the network, port forwarding (see below) and sharing the two USB drive connections over the network (see below)

Port Forwarding

I had a heck of a time getting port forwarding to work for computers within the LAN.  Here is a post I placed on the dd-wrt forum about this topic:

 

Here are several websites that I referenced read and found useful along the way

In the end I added the following to the firewall section in the Administration->Commands section

insmod ipt_mark
insmod xt_mark
iptables -t mangle -A PREROUTING -i ! `get_wanface` -d `nvram get wan_ipaddr` -j MARK --set-mark 0xd001
iptables -t mangle -A PREROUTING -j CONNMARK --save-mark
iptables -t nat -A POSTROUTING -m mark --mark 0xd001 -j MASQUERADE

I’ll have to say I’m not entire sure I understand what is happening, but it works so I’m not complaining.  Now I’m able to see this website both internal and external to my network.

NAS USB Drives

I have two 1TB USB drives attached to my router the following are the steps that I took which mostly comes from following this sites instructions which also uses the dd-wrt sites instructions of Optware, the Right Way.

 

Format the hard drives
(I did this at another time and didn’t record my steps)
Enable USB at Services->USB
and enable the following parameters:
Core USB Support
USB Storage Support
Automatic Drive Mount
Disk Mount Option = /opt

Save then do a reboot

Check Services->USB to see the Optware and Swap loaded

Disk Info
--- /dev/discs/disc0/disc 
Block device, size 931.5 GiB (1000204886016 bytes) 
DOS/MBR partition map 
Partition 1: 930.5 GiB (999128297984 bytes, 1951422457 sectors from 2055) 
Type 0x07 (HPFS/NTFS) 
NTFS file system 
Volume size 930.5 GiB (999128297472 bytes, 1951422456 sectors) 
Partition 2: 1 GiB (1073741824 bytes, 2097152 sectors from 1951424512) 
Type 0x0F (Win95 Ext'd (LBA)) 
Partition 5: 767 MiB (804257792 bytes, 1570816 sectors from 1951424512+2048) 
Type 0x83 (Linux) 
Ext2 file system 
Volume name "/Optware" 
UUID 0A911958-F81C-51AA-E421-3C2F22FBB048 (Reserved) 
Volume size 767 MiB (804257792 bytes, 196352 blocks of 4 KiB) 
Partition 6: 255 MiB (267386880 bytes, 522240 sectors from 1952997376+2048) 
Type 0x82 (Linux swap / Solaris) 
Linux swap, version 2, subversion 1, 4 KiB pages, little-endian 
Swap size 255.0 MiB (267378688 bytes, 65278 pages of 4 KiB) 
Status: Mounted on /opt 
Status: Not mounted 
Status: Not mounted 
Status: Not mounted

Next SSH into the router and verify the /opt partition is mounted

root@BLT_ROUTER:~# mount

rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
none on /dev type devfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
ramfs on /tmp type ramfs (rw)
devpts on /dev/pts type devpts (rw)
devpts on /proc/bus/usb type usbfs (rw)
/dev/discs/disc0/part5 on /opt type ext2 (rw,noatime)

Check for router connection to the internet

root@BLT_ROUTER:~# ping google.com

PING google.com (74.125.239.7): 56 data bytes
64 bytes from 74.125.239.7: icmp_seq=0 ttl=55 time=17.870 ms
64 bytes from 74.125.239.7: icmp_seq=1 ttl=55 time=17.222 ms
--- google.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 17.222/17.546/17.870/0.324 ms

Next download the optware prep script

root@BLT_ROUTER:~# wget -O /tmp/prep_optware http://wd.mirmana.com/prep_optware

--2012-11-11 21:53:33--  http://wd.mirmana.com/prep_optware
Resolving wd.mirmana.com... 212.123.145.69
Connecting to wd.mirmana.com|212.123.145.69|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 25381 (25K) [application/octet-stream]
Saving to: `/tmp/prep_optware'

100%[========================================================================================================================================>] 25,381      48.4K/s   in 0.5s

2012-11-11 21:53:34 (48.4 KB/s) - `/tmp/prep_optware' saved [25381/25381]

Now run the prep optware script. I choose Y for all questions

root@BLT_ROUTER:~# sh /tmp/prep_optware

Then I did a reboot

root@BLT_ROUTER:~# reboot

Check free space on optware partition

root@BLT_ROUTER:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
rootfs                6.3M  6.3M     0 100% /
/dev/root             6.3M  6.3M     0 100% /
/dev/discs/disc0/part5 755M 360M 359M 51% /opt

Now install Samba 3.5 (or anything greater than Samba 2) so that it works on Windows 7. I followed this for the most part

First, create backups of original files

root@BLT_ROUTER:/opt/etc/samba#    cp /opt/etc/samba/smb.conf /opt/etc/samba/smb.conf.copy
root@BLT_ROUTER:/opt/etc/samba#  cp /opt/etc/init.d/S80samba /opt/etc/init.d/S80samba.copy

Then turn off the existing Samba service

service samba stop
service samba off

and then install Samba (I added Samba 3.5

ipkg-opt remove samba2 
ipkg-opt install samba35
ipkg-opt install samba35-swat

After doing this I saw an error:
After removing file and starting noticed and error

grep: can't load library 'libpcre.so.1'

I simply ran updates/upgrades to fix the problem

Update OTWR
ipkg update
ipkg upgrade

Other in some forums had posted the following symbolic link fix, but my update above seemed to do the trick:

	
ln -s /opt/lib/libpcre.so.1 /opt/lib/libpcre.so.0

With Samba 3.5 now isntalled it is time to get it configured for the USB drives. First check partitions to determine which name to setup the mounts to.

root@BLT_ROUTER:~# more /proc/partitions
major minor  #blocks  name

  31     0        192 mtdblock0
  31     1       7936 mtdblock1
  31     2       6405 mtdblock2
  31     3         64 mtdblock3
  31     4        128 mtdblock4
   8     0  976762584 sda
 8 1 975711228 sda1
   8     2          1 sda2
   8     5     785408 sda5
   8     6     261120 sda6
   8    16  976762584 sdb
  8 17 975699964 sdb1
   8    18          1 sdb2
   8    21     921600 sdb5
   8    22     136192 sdb6

SDA1 and SDB1 are my external 1TB USB drives. Plug in each one one at a time to determine which block size belongs to which harddrive. The following is just another view of the above.

root@BLT_ROUTER:/mnt# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4d0b4b49

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      121471   975711228+   7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2          121471      121602     1048576    f  W95 Ext'd (LBA)
Partition 2 does not end on cylinder boundary.
/dev/sda5          121471      121569      785408   83  Linux
/dev/sda6          121569      121602      261120   82  Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x11c21da9

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      121470   975699964+   7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sdb2          121470      121602     1059840    f  W95 Ext'd (LBA)
Partition 2 does not end on cylinder boundary.
/dev/sdb5          121470      121585      921600   83  Linux
/dev/sdb6          121585      121602      136192   82  Linux swap / Solaris
root@BLT_ROUTER:/tmp# blkid
/dev/sda1: UUID="D4DC4E64DC4E414A" LABEL="1TB ExtnDrive" TYPE="ntfs"
/dev/sda5: LABEL="/Optware" UUID="0a911958-f81c-51aa-e421-3c2f22fbb048" TYPE="ext2"
/dev/sda6: LABEL="Swap" UUID="5d705f77-397f-868e-cf52-545be358059c" TYPE="swap"
/dev/sdb1: UUID="FC0C24480C23FBF0" LABEL="BackupDrive" TYPE="ntfs"
/dev/sdb5: LABEL="Optware" UUID="9515a4ae-351b-f102-a517-a196dcb45fa8" TYPE="ext2"
/dev/sdb6: LABEL="Swap" UUID="1bb9e834-1bf9-d98b-0a1f-d8bac631f5c5" TYPE="swap"

Next, edit /opt/etc/automount to set the USB drives mount point to the desired location, as I didn’t care for the default too much. Leave /opt as is. I changed my USB drive partitions to /tmp/mnt and /tmp/mnt2

root@BLT_ROUTER:/opt/etc# more automount
/opt 0a911958-f81c-51aa-e421-3c2f22fbb048 ext2
/tmp/mnt D4DC4E64DC4E414A fuseblk
/tmp/mnt2 FC0C24480C23FBF0 fuseblk
/tmp/d 9515a4ae-351b-f102-a517-a196dcb45fa8 ext2

Next configure the samba configuration files to include the USB drives.  Make sure the workgroup is the same as your windows computers (default is WORKGROUP)

I changed the hosts allow and interfaces lines, though I don’t recall why now

hosts allow = 192.168.0.0/16 10.0.0.0/8 172.16.0.0/12 127.0.0.0/8
interfaces = 192.168.1.1/24 192.168.1.1/255.255.255.0

Enable WINS Support

wins support = yes

Then in the share definitions section I added the text below to assign the Windows share name to the desired path. All the other default shares are commented out.

[BackupDrive]
path = /mnt
valid users = www-data nobody root
public = yes
guest ok = yes
;BT
read only = no
;
writable = yes
printable = no
force user = root
create mask = 0765

[1TBDrive]
path = /tmp/mnt2
valid users = www-data nobody root
public = yes
guest = ok
read only = no
writable = yes
printable = no
force user = root
create mask = 0765

[homes]
   valid users = %S
   read only = no
   browseable = no

[Optware]
path =/opt
force user = root
read only = no
guest ok = yes

Save the config file and restart Samba

service samba stop

Everything should be up and going.

Tags: , , , , , ,

I’ve set out and installed a full working version of Ubuntu 12.10 on my Dell XPS M1730.

To kick things off my keyboard died on the laptop which makes it impossible to do anything during boot up.  After a lot of work trying to get it working again, I gave up and bought a cheap USB keyboard.

I started out by having my computer setup with a RAID 0 with one master partition running Windows 7 64-bit.  After many failed attempts at getting the hard drive partitions setup for Ubuntu I undid the RAID which wiped out windows 7.  I’ll have to re-install Windows 7 hopefully in a dual boot at a later time.

Once the partitions were wiped out I used a USB boot version of Gparted to setup the partitions  as noted in link, but I made boot partition bigger after reading a few other articles (besides the size is so small it doesn’t really matter)

 
Boot Ext4 512MB
Swap Swap 4GB (4096MB)
Home Ext4 remainder of hard drive minus 80GB for later use in Windows 7

 

 

During my install of Ubuntu the screen would just flash colors.  A quick search found that this is really common with Nvidia graphics cards.  I combined a few options suggested on the internet by setting some custom install options.  Press any key when the keyboard logo appears at the bottom of the screen to get to the install menu, go down to install and press F6 then add the following after the ‘–‘with a space befoe the text”nouveau.blacklist=1 vga=771″

I get an error that the blacklist and 1 are invalid options, but when I try an install with just vga=771 I get the flashing colors.  So I’m not sure what the noeveau argument is doing, but it does enough to get the display to work properly.  I didn’t try installing with just the nouveau parameter and without the vga parameter.

With that I could continue with the install.  In the install I choose to manually select the partitions to use.  By double clicking each partition I was able to designate the /boot, swap, /home specifically.

After the install I restarted the computer and had the flashing colors all over again. I followed this article to get things working.  Right after the bios boot, but not before, hold down the shift key.  At the grub menu select Advanced Options then the recovery mode option

I selected the network option and then yes as directed.  Some text scrolled for a while and then is seemed like things just stopped but without taking me to the GUI screen to choose root.  I pressed up and some garbage text was displayed.  I think I followed this by Enter and then a Ctrl-ESC.  This caused more text to be displayed and then rather than going back to the GUI it went into Ubuntu without the flashing colors.  From there I opened up an Xterm window and proceeded to do the commands from the link (pasted below for my information)

sudo apt-get update
sudo apt-get upgrade
sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current nvidia-settings

With that I was now have a Ubuntu setup on my Dell XPS M1730.

This computer will be my media player and I don’t plan to physically use it much especially now that the keyboard is broken.  Things that I’d like to get setup are VNC, SSH, VPN, Samba, XMBC, and iTunes (I really like the genius playlist editor).  I’ll be posting a later blog about this. (Update: 12/29/2012:  Here is the post about the media server)

 

Tags: , , , ,

About a month ago I got a virus on my computer and in my infinite wisdom I used a registry scanner to help clean up the issue.  This scanner also decided to delete some files that allowed my website to work.   I should have just rolled back my windows 7 to the last registry backup, but too late the damage was done.  For the life of me I couldn’t figure out which files it wiped out as it didnt’ have a log of the actions it took.

So I embarked on re-setting up my apache server.  I didn’t keep any of the installation files I used the first go around so I ended up downloading the files all over again. I got apache from Apache Lounge.  I found 64-bit version of php at http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/  and don’t forget about the extensions needed on the same webpage.  And MySQL from their own website. Lesson 1:  Save the installation files for future re-use.

Well of course apache, php, and mysql all had updates that caused various issues.  This being my first real upgrade I discovered something quite important that is noted in all the installation files.  First backup the apache and php config files.  Then start with the generic config files (httpd.conf and php.ini-production) and then add back in my unique settings.  I initially tried to just start with my old configuration files and then add in the new default settings, but this is really messy and not the way to do it.

In apache, Order commands are depreciated are now depreciated  as noted in these two links (1 and 2) so I had to make several updates to the httpd.conf file to correct this.  Additionally, several changes were made to the LoadModule selections.

 #new for 2.4.3 update
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule allowmethods_module modules/mod_allowmethods.so
###This is needed for SSL to work in update
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
#changed with 2.4.3 update
#LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_core_module modules/mod_authz_core.so
#changed with 2.4.3 update
#LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_core_module modules/mod_authn_core.so

With the updates I was/am having issues with wordpress so I updated that again too to version 3.4.2 and still noticed the problem with numeric links and have blogged about it here.

But after all of that I appear to be back up and working.  I did notice during this whole process that the use of Location in the httpf.conf file to make sure certain webpages use https rather than http was not case sensitive.  I’m still working on this and hope to post about it again when I understand things, but for here is a link the my forum post about the topic

Tags: , , , , , ,

« Older entries § Newer entries »