Archive

Archive for the ‘Tech’ Category

Photo Processing

April 26th, 2013 No comments

Trying to make the process of getting my photos off my camera and onto my websites as painless as possible. Four step process:

  1. Extract photos from the Camera onto local file server and laptop
  2. Tag and Select Photos for Displaying on Website
  3. Upload selected Photos to the Website
  4. Keep local photo tags synchronised with Website tags/ratings/comments

Part of Tagging process:

  1. Install OpenCV on local server

Extract photos from Camera

  • Create local directory based on date of oldest photo not processed before.
  • Copy all new photos to this directory with unique name based on date & id.
  • If server available copy photos to server directory.
  • On server tag all files for ‘upload’, make ‘web’ & ‘thumb’ versions of all files and upload to website.

So we now have all files uploaded and available with no user input.

Tag and Select Photos for Displaying on Website

Wherever we decide to tag the photos we need to ensure all updates propagate to all versions of the files.

Assume to tag the files on the local server, as we can make use of local resources and install the relevant applications.

Categories: Photos Tags:

Test

October 29th, 2012 No comments

US | Local

Categories: Website Tags:

Gigaset A580IP Phone

July 24th, 2012 No comments

Best value reliable IP phone I have found although it is now marketed as N300 by Siemens Sold at Amazon ($89.99). It has a number of ‘hidden’ setting detailed in the manual which I can never remember or easily find so I have noted them here for future reference:

  • Changing the pause after line seizure

    MENU -> 7 -> 4 -> 9 -> 1 -> 6

    You can set the length of the pause inserted between pressing the talk key and sending the phone number.

  • Changing the pause after the recall key

    MENU -> 7 -> 4 -> 9 -> 1 -> 1

    You can change the length of the pause if your PABX requires this (refer to the user guide for your PABX).

  • Checking the base station MAC address

    MENU -> 7 -> 4 -> 9 -> 1 -> 5

    Depending on your network configuration, you may have to enter your base station MAC address in your router’s access control list, for example. You can check your base station MAC address.

  • Activating/deactivating first ringer muting

    MENU -> 7 -> 4 -> 9 -> 1 -> 9

  • Activating/deactivating SMS function

    MENU -> 7 -> 4 -> 9 -> 2 -> 6

    If you deactivate the SMS function, you cannot send or receive any SMS messages with your phone.
    The settings you have made for sending and receiving SMS messages (e.g. the numbers of the SMS centres) and the entries in the incoming and draft message lists are saved even after deactivation.

Categories: Telephony Tags:

MythTV Frontend Chosen

June 6th, 2012 No comments

After a few weeks of prevaricating I managed to pick up the Zotac box from Amazon for £280 which seems like a good price for a PC with BluRay support. If I can bring myself to sell the 250Gb hard disk and Wifi mini PC card will bring the price down even further.

Zotac ZBOXHD-ID34BR-B ZBOX ID34BR Mini PC Dual Core Blu-Ray

Type: Personal Computer
Binding: Personal Computers
By: Zotac
Title: Zotac ZBOXHD-ID34BR-B ZBOX ID34BR Mini PC Dual Core Blu-Ray
Price: £341.00
From: Amazon


Since this item was only ‘As New’ condition I wanted to get it up and running as quick as possible so rather than do my usual Gentoo install I opted for the MythBuntu LiveCD. This installed very smoothly and allowed me to test out nearly all the features of the board quickly, just in case I needed to report a fault and return the item.

I have had the system up and running for some time now and it is the perfect Frontend for my requirements. Although it is actively cooled it sits in a wooden TV cabinet so I can’t here the fan at all.

As predicted I am only using 5Gb of the 250Gb hard disk so if I ever get the change to pick up a inexpensive Solid State Drive I will probably swap it out and sell on ebay. This would also improve the already pretty quick (compared to the VIA frontend) boot time.

This upgrade now paves the way to upgrade to Myth version 0.25, and the installation of a dual DVB-T2 receiver card in my server.

Categories: Computers Tags:

US Dollar Cheques

April 12th, 2012 No comments

Banks don’t seem to publish how much their charges for cashing US dollar cheques, after much hand wringing I got the following out of the bank staff at Halifax:

Sterling value of the cheque is < £100 then the charge is £5.

Sterling value of the cheque is > £100 then the charge is the greater of 0.25% or £8 (up to a maximum of £80).

i.e.

£1 – £100, charge is £5
£100 – £3200, charge is £8
£3200 – £32000, charge is 0.25%
£32000 – …, charge is £80.

Categories: Website Tags: , ,

MythTV Frontend

March 31st, 2012 No comments

The time has come to retire my current Myth TV Frontend, it is based on a VIA Mini ITX SP8000 motherboard which has a VIA 800MHz CPU. This has been struggling for some time with the latest upgrades to MythTV, what with the advent of DVB-T2 transmissions in our area and the retirement of the XvMC drivers from Myth it is time to upgrade the frontend.

After a quick survey of the small, low power, low price set top style boxes available three stand out as candidates. Base requirements where:

  • Small profile – needs to be discrete as in the Living room
  • Quiet – No noisy fans when watching recordings
  • Hardware (linux supported) decoding of HD video – HD TV transmissions starting in our area
  • Decent CPU – Just to improve GUI responsiveness, this is a given since I’m comparing with the 800MHz Via chip
  • BluRay support – Help to future proof the move away from DVD
  • HDMI Connection – To connect to the TV, high quality digital signal + fewer cables
  • Pedigree – Ideally some history of supporting Myth Frontend
  • Wired Ethernet – I have a network connection so may as well use it

There are some items that I specifically do not need but they all seem to provide. If I can source a barebones system or sell these items on ebay I can reduce the cost of the system:

  • Wireless Networking – Our WiFi is pretty cluttered already, so would probably disable this anyway
  • Large Hard disk – The Frontend really only needs room for the OS and Apps at the most so I don’t need 250Gb of space
  • Windows OS – Most definitely will not be running Windows, so I would hate to have to fork out for a license.

The following meet the above criteria:

Acer Revo RL100 Desktop PC (AMD Athlon II Neo dual-core processor K325, 2GB RAM, 500GB HDD, BluRay Combo, NVIDIA nForce 520, Windows 7 Home Premium)

Type: Personal Computer
Binding: Electronics
By: Acer
Title: Acer Revo RL100 Desktop PC (AMD Athlon II Neo dual-core processor K325, 2GB RAM, 500GB HDD, BluRay Combo, NVIDIA nForce 520, Windows 7 Home Premium)
Price: £330
From: Amazon



Zotac ZBOXHD-ID34BR-B ZBOX ID34BR Mini PC Dual Core Blu-Ray

Type: Personal Computer
Binding: Personal Computers
By: Zotac
Title: Zotac ZBOXHD-ID34BR-B ZBOX ID34BR Mini PC Dual Core Blu-Ray
Price: £341.00
From: Amazon



ASUS Eee Box EB1501P - Mini desktop PC - 1 x Atom D525 / 1.8 GHz - RAM 2 GB - HDD 1 x 250 GB - DVD-Writer / BD-ROM - NVIDIA Next Generation ION - Gigabit Ethernet - WLAN : 802.11b/g/n - Windows 7 Home Premium 64-bit - Monitor : none

Type: Personal Computer
Binding: Personal Computers
By: Asus
Title: ASUS Eee Box EB1501P - Mini desktop PC - 1 x Atom D525 / 1.8 GHz - RAM 2 GB - HDD 1 x 250 GB - DVD-Writer / BD-ROM - NVIDIA Next Generation ION - Gigabit Ethernet - WLAN : 802.11b/g/n - Windows 7 Home Premium 64-bit - Monitor : none
Price: £520.03
From: Amazon


Categories: Computers Tags:

Digital Switchover

March 7th, 2012 No comments

Following the first stage of the digital switchover at the Rowridge transmitter on the Isle of Wight we seem to have lost Mux C (Dave, Really, E4+1, etc.). The Mux was always marginal (signal) quality at the best of times, now there is no sign of it either on the TV or on the Myth system.

Done a bit of Googling and the following sites are useful for reference:

By the looks of it may be worth installing a new TV aerial, either a Yagi 18A (on the roof) or a XB10 A.

ANTIFERENCE TCX18A AERIAL 18 ELEMENT A BAND

Type: CE
Binding:
By: Antiference
Title: ANTIFERENCE TCX18A AERIAL 18 ELEMENT A BAND
Price: £24.99
From: Amazon


Categories: Computers Tags:

Broadband Migration

July 15th, 2011 No comments

We have moved our internet provider & phone line from Virgin Media to BT Broadband. Thankfully it has been relatively painless, especially as it also knocks out the TV. Rough summary of what needed to be done:

  • Disconnect old router.
  • Connect the new router to the phone line.
  • Wait for router to connect to the internet.
  • Connect laptop to wireless network
  • Browse to the router admin menu and change:
    • Admin password
    • Subnet Address & Router address
    • Wireless password & Wireless Network Name
  • Connect up all wired connections
  • In router admin change:
    • Set all node names and fixed IP addresses
    • Add port forwarding for 5060, 10000-15000, 80 & 443 to server
    • Configure DynDNS
  • Any other wireless devices (Macbook2, Squeezebox) update Wireless config.
Categories: Computers Tags:

Composter

July 12th, 2011 No comments

Amazon1

Amazon1

Amazon2

Amazon

Amazon3

Amazon4

Amazon5

A paragraph full of text. A paragraph full of text. A paragraph full of text. A paragraph full of text. A paragraph full of text. A paragraph full of text. A paragraph full of text. A paragraph full of text. A paragraph full of text. A paragraph full of text. A paragraph full of text.

amazon template=wishlist post&search_links=1&wishlist_type=random&localise=0&cat=local&default_cc=fr]

Shortcode:

amazon asin[fr]=2020479893&
asin[uk]=0340993782&
asin[de]=3548602045&
live=1&
template=multinational

Template:

<div class="al_found%FOUND%">
 <div class="amazon_prod">
  <div class="amazon_img_container">
   %LINK_OPEN%<img class="%IMAGE_CLASS%" src="%THUMB%">%LINK_CLOSE%
  </div>
  <div class="amazon_text_container">
   <p>%LINK_OPEN%%TITLE%%LINK_CLOSE%</p>
   <div class="amazon_details">
     <p>by %ARTIST% [%MANUFACTURER%]<br />
     <b>Price: <span class="amazon_price"> 
%LINK_OPEN%uk# <img height=10px src="%FLAG%uk#"> %PRICE%uk#%LINK_CLOSE%
%LINK_OPEN%FR# <img height=10px src="%FLAG%fr#"> %PRICE%FR#%LINK_CLOSE%
%LINK_OPEN%de# <img height=10px src="%FLAG%de#"> %PRICE%DE#%LINK_CLOSE%
</span></b>
    </p>
   </div>
  </div>
 </div>
<img src="http://www.assoc-amazon.%TLD%/e/ir?t=%TAG%&l=as2&o=%MPLACE_ID%&a=%ASIN%" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</div>

TO DO…

Bugs:
None localised, specific links don’t seem to work?

http://foto.alessandrobagalini.eu/blog/guia-de-compra-nikon/comp-nikon-dsrl-fx/

Issues:
Localised links always work even if ASIN not present at locale

General to do:
test all aspects

Categories: Website Tags:

Macbook Re-install

April 29th, 2011 No comments

Probably going to do a clean install of our macbook, upgrading to Mac OS 10.6.3. Need to re-install:

  • Onyx – Optimisation Utility
  • Mythtv – Media Front end
  • Firefox & Chrome – Browsers + Adblock (Plus V 1.3.6 – easy list
  • X-Tools & X Windows
  • OpenOffice
  • VLC – Media Player
  • Picasa / iPhoto – Photo Organisers
  • BBC iPlayer Desktop
Categories: Computers Tags:

MythTV Upgrade 0.24

April 6th, 2011 No comments

Pre-server upgrade, need to upgrade MythTV, just as I got used to svn, MythtTV has moved to github. Will work out how to do patches later (see Using Git guide, for now grab a snapshot tarball:
wget --no-check-certificate https://github.com/MythTV/mythtv/tarball/v0.24

Make a clean copy. Then on the server and all clients take a copy of the latest revision in /home/mythtv/XXXXX.

Shutdown all clients and the backend using /etc/init.d/mythbackend stop, stop any cron job that auto starts the backend.

On server backup myth database as described on the MythTV Wiki using mythconverg_backup.pl.

Create the new version of MythTV: Run the previous configure recorded in config.log, updated as appropriate. Run make.

Finally shutdown all clients and the backend again. Ensure any local modifications to myth are in ~/.mythtv (i.e. mysql.txt and any menu modifications).

Remove any copies of mysql.txt (/usr/local/share/myth/mysql.txt & /var/run/mythtv/.mythtv/mysql.txt).

  1. cd XXXXX/mythtv
  2. make install
  3. rm /usr/local/share/mythtv/mysql.txt
  4. rm /var/run/mythtv/.mythtv/mysql.txt

Usually a good idea to run mythtv-setup, on macbook start X11, run:

  1. xhost lofty
  2. ssh lofty
  3. su mythtv
  4. DISPLAY=macbook:0
  5. export DISPLAY
  6. mythtv-setup

Restart the server using /etc/init.d/mythbackend start. Check database is upgraded okay, check detected all tuners, listings, recordings and videos. Restart the client and check it is working (live TV, recordings and videos).

Always worried that we are bringing a lot of incorrect settings and unwanted orphan database guff. We could now create a new mythconverg database using the mc.sql file. Restart the backend pointing at the new database, this will populate with working defaults. Run mythtv-setup to add tuner cards, listings provider and channels. Run mythfilldatabase to get listings. Restart client and set up appropriate Video Playback Profile, check live TV works. Import videos, music and photos. Import old database tables – previously recorded programs (oldrecorded), current recordings (recorded, recordedprogram & recordedseek), and supporting tables: (recordedrating, recordedcredits, people, credits).

Once successful, install mythweb on the server:

  1. mv /var/www/htdocs/myth /var/www/htdocs/myth21
  2. cp -R mythplugins/mythweb /var/www/htdocs/myth23
  3. ln -s /var/www/htdocs/myth23 /var/www/htdocs/myth

Git Useful links

Getting MythTV from Github

First install and configure git:

  1. emerge –ask –verbose dev-vcs/git
  2. git config –global –add push.default nothing
  3. git config –global –add push.default tracking
  4. git config –global user.name "Your Name"
  5. git config –global user.email you@example.com

Grab a copy of the repository and swap to the fixes branch:

  1. git clone git://github.com/MythTV/mythtv.git
  2. git checkout fixes/0.24

There does not seem to be a simple method of tracking what revision you have in git? Proposed upgrade process:

  • Take a copy of the installed source cp -r mythtv mythtv_installed
  • Review changes since this build git short-log HEAD..???
  • Get the latest version of the code git pull
Categories: Computers Tags:

Commissioning New Server (Again)

March 29th, 2011 No comments

Time to upgrade the server again, getting numerous failures, so need to re-install the whole system…

Quick Overview of Steps to Commission the Server:

  1. Burn Gentoo 2011.0 Minimal CD, and boot server using it.
  2. Partition Hard Disk
  3. Device      Boot    Start         End      Blocks   Id  System      Mount
    /dev/hda1   *           1           7       56196   83  Linux       [/boot]
    /dev/hda2               8          70      506047+  82  Linux swap  [swap]
    /dev/hda3              71         800     5863725   83  Linux       [/]
    /dev/hda4             801        9729    71722192+   5  Extended              
    /dev/hda5             801        1530     5863693+  83  Linux       [/mnt/portage]
    /dev/hda6            1531        2260     5863693+  83  Linux       [/home]
    /dev/hda7            2261        2869     4891761   83  Linux       [/mnt/root]
    /dev/hda8            Remainder                                      [/shared/]    
    
  4. Follow Gentoo Installation Instructions

  5. Use backed up files from old installation as reference to various steps in the Gentoo install guide (/etc/conf.d/*, /etc/fstab, /etc/make.conf, and so on).

    Ensure kernel has support for all filesystems ext2/3, xfs, nfs server. Ensure drivers built for all key components (use lspci -v to get key ones), correct CPU is chosen, hardware sensors and CPU powersaving.

    Copy across all /etc/portage files before emerging the following packages.

Once complete will have the following services running:

  • apache2
  • asterisk
  • dahdi
  • lm_sensors
  • local
  • mysql
  • mythbackend
  • net.eth0
  • netmount
  • nfs
  • nfsmount
  • ntp-client
  • ntpd
  • sshd
  • syslog-ng
  • udev-postmount
  • vixie-cron
  • xinetd

Use /usr/lib/portage/world as a guide as to what packages to install.

Top level services that need to be installed:

  • MythTV Backend
  • Apache Web Server
  • Asterisk PBX
  • Squeezebox Server
  • MySQL Database

Key components to support the above:

  • LinuxTV V4L-DVB
  • DAHDI

Order of Installation:

Utilties

  • syslog-ng
  • vixie-cron
  • gentoolkit
  • logrotate
  • vim
  • ntpd & ntp-client
  • ssmtp

Hardware Control

lm_sensors – follow installation instructions and install appropriate modules
CPU Frequency control – Use kernel modules if possible, explore /sys/devices/system/cpu/cpu0/cpufreq/

NFS Exports

Install and restore exports file from backup, TODO: Check for portmapper/rpcbind.

  1. emerge –ask nfs-utils
  2. cp /backups/exports /etc/exports
  3. /etc/init.d/nfs start
  4. rc-update add nfs default

Mysql

  1. Install the server: See the Gentoo Docs
    1. emerge –ask mysql
  2. Update /etc/mysql/my.cnf based on previous tweaks (Mark updates with comments!)
  3. Start the server:
    1. rc-update add mysql default
    2. /etc/init.d/mysql start
  4. Import user privileges using this useful script:
    1. mygrants()
    2. {
    3.   mysql -B -N $@ -e "SELECT DISTINCT CONCAT(
    4.    'SHOW GRANTS FOR ''', user, '''@''', host, ''';'
    5.    ) AS query FROM mysql.user" | \
    6.   mysql $@ | \
    7.   sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'
    8. }
  5. Import ‘working’ copy of various databases (asterisk, mail & mythconverg).

Asterisk

See the previous post on Asterisk upgrade.

Also install the latest phpagi

Install sox for increasing gain on voicemail.

Get British audio from Enicomms, put in /var/lib/asterisk/sounds/en_GB

Apache

Install as per Gentoo instructions, and restore backed up www files. (including .htaccess). TODO:

  1. emerge apache
  2. emerge php
  3. /etc/init.d/apache2 start
  4. rc-update add apache2 default
  5. cp -r /backups/www /var/www/localhost/htdocs/
  6. htpasswd -c /var/www/localhost/htdigest username

Download and install, and configure useful tools:

Copy across bespoke tools:

  • Asterisk Manager
  • Share Research

Mythtv

Only really need backend support, but still need all the dependencies, so get portage to add them all. Ensure version we want is enabled in portage, update package.keywords

echo "media-tv/mythtv ~x86" >> package.keywords
emerge --onlydeps --ask mythtv
emerge --noreplace mythtv

Restore /root/.mythtv settings.

Also need xmltv for listings, with imdb support:

emerge --ask xmltv
tv_imdb --download --imdbdir /shared/imdb --prepStage all

Kernel Drivers if possible:

Copy backed up udev rules to ensure known adapter names. cp backups/etc/11-dvb.rules /etc/udev/rules.d/11-dvb.rules

Other Bits n Bobs

  • ctorrent – For downloading torrents
  • lftp – For website backups
  • netkit-ftpd & xinetd – For FTP access
  • dvd+rw-tools – For Backup to DVD
  • git – For access to MythTV repo
  • svn – For access to WordPress repo
  • hdparm – For shutting down drives
  • xfsutils – For xfs maintenance
  • xpdf – To support research note download
  • ethtool – In support of Wake-on-LAN
Categories: Computers Tags:

Media Server Power Consumption

March 23rd, 2011 No comments

Weighing up the pros and cons of upgrading various components, try and capture what we have:

Motherboard –
CPU – AMD Athlon
PCI – Hauppauge Nova-T
PCI – Twinhan
PCI – Nvidia VGA
PCI – Digium Analogue Telephony Card with 1 FXO [5W max]
USB – Hauppauge Nova-T Stick
IDE – HDD
IDE – HDD
IDE – HDD
Fan – 120mm
Fan – 120mm
PSU –

New Server

ASUS P5ND2-SLI Power Consumption 150W(idle) – 220W(load) [1] Manual [pdf] – Manual states power range from 500W to 350W (system consumption) 17 to 25A on the 12V line.

Processor installed is a Pentium 4 with HT support [1], support EIST, max TDP of 85W.

Categories: Computers Tags:

Asterisk Upgrade

October 12th, 2010 No comments

The server is running Gentoo, which will by default only install Asterisk 1.2. Unfortunately it is not obvious that this supports the more up to date dahdi drivers required for the Openvox A400P card that I need to install.

I also could not find anything on the web to recommend a stable version of Asterisk, so I just install the latest ebuild available. To enable installation of dahdi and Asterisk with mysql cdr support I did the following:

  • Save my /etc/asterisk configuration files
  • Save the content of /var/lib/asterisk/agi-bin
  • Update /etc/portage/package.use to enable dahdi support in Asterisk:
    net-misc/asterisk-addons mysql
    net-misc/asterisk dahdi
  • Enable the installation of the latest Asterisk packages, by adding the following to /etc/portage/package.keywords
    net-misc/asterisk-addons ~x86
    net-misc/asterisk-app_notify ~x86
    net-misc/dahdi ~x86
    net-misc/asterisk ~x86
    net-misc/asterisk-core-sounds ~x86
    net-misc/asterisk-extra-sounds ~x86
    net-misc/asterisk-moh-opsound ~x86
    net-misc/dahdi-tools ~x86
    net-libs/libpri ~x86
  • Remove the conflicting version of asterisk-addons:
    emerge --remove asterisk-addons
  • Upgrade Asterisk and install dahdi drivers:
    emerge --ask asterisk asterisk-addons dahdi dahdi-tools
  • Use etc-update to upgrade all the /etc/asterisk files, I just overwrote the old versions and manually re-inserted my config, the important files where:
    indications.conf - 'country=uk'
    modules.conf - load => cdr_addon_mysql.so
    extensions.conf - add my macros and contexts
    sip.conf - add my Outbound SIP Registrations and Providers and Devices, configure network domain
  • Add dahdi to init rc-update add dahdi default
  • Load the kernel modules:
    modprobe dahdi
    modprobe wctdm
  • Configure dahdi:
    dahdi_genconfig
    echo "#include dahdi_channels.conf" >> /etc/asterisk/chan_dahdi.conf
    /etc/init.d/dahdi start
    /etc/init.d/asterisk restart
  • Restore the content of /var/lib/asterisk/agi-bin
Categories: Computers, Website Tags: , ,

Mr. Men Plugin

September 8th, 2010 No comments

I quickly hacked together a WordPress plugin to help friends and family keep track of which Mr. Men books Henry has in his collection. The code is in a pretty ropey state and does not take advantage of all the new WordPress plugin API’s but thought it worth making available in case anyone wants to take it further.

Although it’s called ‘Mr. Men’ wishlist plugin it will take any list of books/CD’s available through Amazon and create a simple tiled array of covers. I grabbed the images and amazon reference numbers (ASIN) values using a simple perl script that accessed the Amazon Web Services API. However that was a while ago and the API has changed quite a bit since then.

Although I started to make it possible to have multiple wishlists but have not finished writing this bit yet.

Available to download from here: Mr. Men Plugin[zip]

Categories: Website Tags: , ,

MythTV Upgrade 0.21 to 0.23 Fixes

August 12th, 2010 No comments

Bit of a nightmare getting the database schema upgraded, and I am reluctant to throw away all my recording history for the last 7 years. The problem I created for myself is that I misunderstood the wiki page detailing how to remove the database corruption, last time I was considering the upgrade. Basically a year ago I converted the database using the instructions in the guide, upgraded to the latest version of MythTV 0.21 – Fixes and assumed that was it fixed.

Alas MythTV has been inserting latin1 encoded characters into the database ever since, so I have a mixture of encoding methods in the database, options are:

  1. Throw away the database, and somehow import the old recordings, or ditch all my old recordings.
  2. Work out when I did the database fix and somehow convert the latter part of the database into the correct encoding method.
  3. Work out when I did the database fix, ditch everything after that point in time.
  4. Convert the whole database into utf8 encoding using scripts.

So lets try the one with the least amount of manual messing about first! Apparently Mysql will attempt to munge incorrectly encoded characters into the correct encoding format when you insert the data. So based on the advice found at Blue Box Group I took a new backup of the mythconverg database, copied it and changed the encoding type from latin1 to utf8. Using the sed script ‘s/DEFAULT CHARSET=latin1/DEFAULT CHARSET=utf8/‘.

This did not appear to convert the characters, tried lots of combinations to try and convert the database with no great progress. Examining the hex dump of some of the UTF sequences did not seem to make any sense, so I’m taking the view that the data is corrupt.

Next attempt involves simply stripping out all the non-ASCII characters and replacing with ‘?’ characters. Easy to do in vi with something like ‘s/[^ -~][^ -~]*/?/g‘.

This will generate a few problems in that the INDEX’s may now exceed the maximum length, so wherever ‘hostname’ is used as a key in the index change it to `hostname`(20). Additionally there will almost certainly be duplicates in the people table, so I removed the line UNIQUE KEY `name` (`name`(41)) where the people table is CREATED. Had to also change the KEY to the oldprogram table to be PRIMARY KEY (`oldtitle`, `airdate`).

Create a new mythconverg23 database with appropriate user privileges and import the modified database. I wrote a short php script to find and remove all the duplicate people from the people table and to remap the credits entries.

To check this was successful recreate the index on the people table with the sql command: ALTER TABLE `people` ADD UNIQUE (`name` ( 41 ));.

Export the database again, change the encoding back to latin1, and import back into mysql.

mysqldump -u mythtv -pmythtv --opt --skip-set-charset \
  --default-character-set=utf8 --skip-extended-insert \ 
  mythconverg23  > mythconverg23_utf8.sql
cat mythconverg23_utf8.sql | \
sed 's/DEFAULT CHARSET=utf8/DEFAULT CHARSET=latin1/ \
      s/`hostname`(20)/`hostname`/' > mythconverg23_latin.sql
cat mythconverg23_latin.sql | mysql -u mythtv -pmythtv mythconverg23

Okay see if we can now upgrade the schema…

mythbackend -v all
Categories: Computers Tags: , , , ,

MythTV Upgrade 0.23

August 8th, 2010 No comments

Not convinced my EPIA SP800 will support the latest version of Myth so I will be taking precautions to allow me to revert to my old configuration (0.21 fixes).

Moving to version 0.23 Fixes Branch, so Grab initial SVN copy, see MythTV SVN

svn co http://svn.mythtv.org/svn/branches/release-0-23-fixes/

This can be updated periodically with svn up as required.

Make a clean copy using svn export release-0-23-fixes/ clean-release-0-23-fixes_XXXXX, where XXXXX is the SVN revision. Then on the server and all client take a copy of the latest SVN in /home/mythtv/XXXXX.

Shutdown all clients and the backend using /etc/init.d/mythbackend stop

On server backup myth database as described on the MythTV Wiki using mythconverg_backup.pl.

Rename the database from mythconverg to mythconverg21 and duplicate the database into mythconverg23. Add appropriate permissions for the mythtv user. Update all mysql.txt files (note the one in /var/run/mythtv/.mythtv) to point to mythconverg21.

Create the new version of MythTV: Run the previous configure recorded in config.log, updated as appropriate. Run qmake mythtv.pro and then make.

Finally shutdown all clients and the backend again. Ensure any local modifications to myth are in ~/.mythtv (i.e. mysql.txt and any menu modifications). Copy .mythtv to .mythtv21 and .mythtv23.

Remove any copies of mysql.txt (/usr/local/share/myth/mysql.txt & /var/run/mythtv/.mythtv/mysql.txt). Create a shell script to swap between version of myth.

  1. rm ~/.mythtv
  2. ln -s ~/.mythtvXX ~/.mythtv
  3. cd XXXXX/mythtv
  4. make install
  5. rm /usr/local/share/mythtv/mysql.txt
  6. rm /var/run/mythtv/.mythtv/mysql.txt

Where XX is either 21 or 23, XXXXX is the directory of the source tree for the appropriate version of MythTV.

Restart the server using /etc/init.d/mythbackend start. Check database is upgraded okay, check detected all tuners, listings, recordings and videos. Restart the client and check it is working (live TV, recordings and videos).

Always worried that we are bringing a lot of incorrect settings and unwanted orphan database guff. We could now create a new mythconverg database using the mc.sql file. Restart the backend pointing at the new database, this will populate with working defaults. Run mythtv-setup to add tuner cards, listings provider and channels. Run mythfilldatabase to get listings. Restart client and set up appropriate Video Playback Profile, check live TV works. Import videos, music and photos. Import old database tables – previously recorded programs (oldrecorded), current recordings (recorded, recordedprogram & recordedseek), and supporting tables: (recordedrating, recordedcredits, people, credits).

Once successful, install mythweb on the server:

  1. mv /var/www/htdocs/myth /var/www/htdocs/myth21
  2. cp -R mythplugins/mythweb /var/www/htdocs/myth23
  3. ln -s /var/www/htdocs/myth23 /var/www/htdocs/myth
Categories: Computers Tags:

Asterisk Revisited

July 18th, 2010 No comments

We recently moved house which involved moving to a new exchange and getting a new phone number. So I took the opportunity to transfer the old number to be the incoming number for the Sipgate account, surprisingly easy and cheap to do.

Strangely as soon as we did this we started getting lots of calls from a phone spammer, so I instated the phonespam filter, which after a few modifications works a treat. Now all calls rated as spam are instantly hung up.

Have also installed Growl on my macbook, and a couple of scripts on the Asterisk box to send call notifications to the laptop. After knocking up a quick script to look up incoming numbers in my address book, it also shows when friends and family are ringing.

So now the incoming dial plan boils down to:

  1. Look up Incoming Number in Address Book
  2. If not recognized filter out Spam calls
  3. Send notification to laptop (& Myth clients)
  4. Dial Extensions

notify (shell script)
notify.php (Notify php application)
lookup.php (Lookup contact agi script)
contacts.php (Contact php library functions)

Categories: Computers Tags:

Asterisk

July 21st, 2009 No comments

Ever since we moved house and subscribed to Virgin Media for our broadband connection I have been amazed at how much call rates are for the phone package we are on. For example over 5p a minute for national rate, 15p for mobiles and 33p for international.

However the 10Mbit broadband is pretty decent overall, and a few test SIP calls proved that it was good enough at prioritisation to give good call quality. This inspired me to get the cheap ATA I bought out of storage and re-instate our ‘black’ phone. The phone is no longer black – having been consigned to the dustbin long ago, but the name has stuck. This gave us much cheaper calls over the internet (1p National, 9p Mobile and 2p International).

I estimate this will save us over £200 a year on call charges, but some stuff still niggled and I wanted better call logging and accounting than SIPGATE provided. So I have install the Asterisk PBX software on the server in the loft to do some more clever stuff.

So I now have the ATA registering with the Asterisk server, the asterisk server has registered with the SIP providers and routes calls according to least cost (Currently it distributes the calls between SIPGATE and VoipCheap). Additionally it will automatically re-direct 0845 and 0870 numbers to cheaper national rate numbers, using the script written by Martin Smith to query the saynoto0870 database.

Once the system proves itself to be reliable, I will be tempted to use this as our main incoming phone number as well. Then I can set up other cool stuff, like host my own voicemail server, set up auto-redirects to other numbers when I’m away from home. Automatically filter out junk and cold calls using the phone spam filter database.

Certain members of the household still can’t remember when to use the black phone and when to use the normal landline (National calls are free at the weekend with Virgin). So am tempter to get a PCI FXO card to allow me to connect and route calls automatically to the landline from the SIP phone.

Categories: Computers Tags:

Gallery Photo Organising

April 15th, 2009 No comments

Been trying to automate the process of sorting my photos and getting them published on my Coppermine Gallery. I had been using the iPhoto CopperExport plugin, but for some reason that does not work with my current web host.

It turns out Coppermine will automatically import IPTC tags into the title, comments and keywords fields, so I’m investigating how to automate this using iPhoto.

Currently Coppermine 1.4.14, which imports the following IPTC tags:


Name......IPTC Tag..IPTC Name
Title.....005.......Iptc.Application2.ObjectName
Caption...120.......Iptc.Application2.Caption
Keywords..025.......Iptc.Application2.Keywords

Unfortunately the version of iPhoto I use does not export the Metadata to the photos, in fact it seems to strip off all the EXIF info altogether. So the current solution is to use some home baked scripts to add the relevant IPTC tags, shrink and rotate the JPEGs and FTP them up to my site. The tools I’m currently using to do the work are ‘convert’ from the ImageMagick toolset, to resize the JPEGs; and exiv2 to add the IPTC tags.

My top to bottom process for processing my photos is this:

  1. Import from Camera (Canon CameraWindow tool), using unique names based on date+ID
  2. Delete obvious duds in CameraWindow tool
  3. In Finder arrange photos into directories (equivalent to Albums/Rolls)
  4. Copy original photos to my server, possibly adding to existing Album directories
  5. Import all changed albums into iPhoto
  6. In iPhoto, for all pictures that I want to publish: Fill in Title, Comment, Keywords, Rating, allocate _Favorite_ keyword.
  7. Using SmartAlbum to select recent Favourite photos, export Metadata using Metadata export plugin
  8. Run my photo processing scripts to:
    • Copy iPhoto Modified photos back to server
    • Create smaller JPEGs ready for Gallery
    • Insert MetaData into Original & Gallery copy of the photos
    • FTP the Gallery versions to web server
  9. In Coppermine, create any required new Albums & Categories, use batch add to import the photos, including Metadata.
Categories: Computers, Website Tags: , , ,