Automating Ember Media Manager

I use Ember Media Manager to scrape information about my TV show collection. However like the “movies” scraper the TV scraper does not have a button to automatically scrape all details. You have to watch the screen and click the default buttons. This is fine if you only want to scrape one TV show, but when you are scraping your whole database it becomes a pain.

Here is a simple AutoIT script which hits the default buttons for you. This script needs to be stated after Ember Media manager. While Ember is running, the script runs in a continuous loop looking for buttons and clicking them.

ConsoleWrite("Starting" & @CRLF)
While WinExists("Ember Media Manager")
   ;ConsoleWrite("Sleeping...")
   sleep(5000)

   ;ConsoleWrite(" Checking Banner")
   if(ControlCommand("TV Image Selection","","[NAME:btnOK]","IsEnabled")) Then
	  ConsoleWrite(" Clicking Banner")
	  WinActivate("TV Image Selection")
	  ControlClick("TV Image Selection","","[NAME:btnOK]")
	  ConsoleWrite(@CRLF)
   EndIf

   ;ConsoleWrite(" Checking Show details")
   if(ControlCommand("Edit Show","","[NAME:OK_Button]","IsEnabled")) Then
	  ConsoleWrite(" Clicking Show details -> " & WinGetTitle("Edit Show"))
	  WinActivate("Edit Show")
	  ControlClick("Edit Show","","[NAME:OK_Button]")
	  ConsoleWrite(@CRLF)
   EndIf



   ;ConsoleWrite(@CRLF)
WEnd
Advertisements

Using netflow/nfsen to recognize internal vs external traffic

You can easily create a filter which can differentiate between the traffic directed to the internet and traffic directed to your other sites.

All my sites are numbered using the RFC1981 address space. This makes is really easy to define an external and internal filter. The internal filter is defined as “traffic from a RFC1991 source to a RFC 1981 destination”. The external filter is the opposite of this.

The nfdump filter are:

Internal: (src net 10.0.0.0/8 or src net 172.16.0.0/12 or src net 192.168.0.0/16) and (dst net 10.0.0.0/8 or dst net 172.16.0.0/12 or dst net 192.168.0.0/16)

External: not ((src net 10.0.0.0/8 or src net 172.16.0.0/12 or src net 192.168.0.0/16) and (dst net 10.0.0.0/8 or dst net 172.16.0.0/12 or dst net 192.168.0.0/16)) and not proto esp

My sites are connected by IPsec and the “not ESP” make sure that you don’t include this traffic in the external filter. This simplistic filter has an issue: for example if you have an inside user (eg guest) that is VPNing back to their office.

These filters can give you some nice graphs as shown below where red = External traffic and blue = internal traffic.

IntvsExt

In this graph you can clearly see that an internal backup is running from Thursday 10th to Sat 12th. Otherwise most of the traffic from this site is directed towards the internet.

 

 

Getting Around SSLv3 being disabled

My original post about turning sslv3 back on is not valid in Firefox V40. The only way I could find around this is to try the following:

  1. Install the SSL Version control plugin into your current browser
  2. Install a old portable edition of firefox from here. The SSL poodle bug was issues in Oct 2014, so its safe to use any earlier edition. I’ve been using v30 which was released on 2014-06-10.

When you install the portable edition, it installs a copy in the folder “FirefoxPortable” on your desktop. You need to close your main browser before firing up this version. There is no interaction between the two version so you can delete and reinstall the portable edition as many times as you like.

Embedding nfsen graphs in other pages

Pre Reading:

Once you have nfsen running and capturing data you might want to embed the graphs into other pages for reporting purposes. In my case I need a created a simplified webpage which showed my manager a basic graph he could understand.

To do this you will need to go to Nfsen and setup the graph so that it shows what you want.

nfsen

Then right click on the graph and select “Copy image location”. If you embed this URL into a webpage you will find that its static and the image will not change.

The URL has the following format:

http://tools/nfsen/rrdgraph.php?cmd=get-detailsgraph&profile=./AtlassianServices&arg=wiki%3Ae-wiki-or-e-support%3Ajira+any+traffic+1440338400+1440570300+1440656700+1440656700+1440656700+576+200+0+0+0

The four large numbers have the following meaning:

  • 1440338400 – Start (of the profile)
  • 1440570300 – Start of the graph
  • 1440656700 – End of the graph
  • 1440656700 – Tstart (start of the time range selection)
  • 1440656700 – Tend (end of the time range selection)
  • +576+200+0+0+0 – Graph size parameters

You can then replace the second number with “end-1d” and third numbers with “now”. This basically means – draw a graph from now till 24hours ago.

http://tools/nfsen/rrdgraph.php?cmd=get-detailsgraph&profile=./AtlassianServices&arg=wiki%3Ae-wiki-or-e-support%3Ajira+any+traffic+1440338400+end-1d+now+1440656700+1440656700+576+200+0+0+0

The new URL can be embedded into a web page and it will display the latest information from the database.

Although I haven’t tried any other options I suspect the parameters will be the same as supported by rrdtool. Try the others and leave me a comment.

Update 15/9/15 :This method only seems to work on the original machine which has a session to NFsen. Peter mentions other methods to extract them but I cannot find and references: http://sourceforge.net/p/nfsen/mailman/message/20697518/ and http://sourceforge.net/p/nfsen/mailman/message/22940378/

Update 18/9/15: You can embed any of the graphs which are shown in in the Graphs tab in NFsen. These graphs are dynamic but you limited to the day, week, month & year graphs.

 

Bit-streaming High Resolution audio using foobar2000

I’ve been wanting a high quality audio setup for a while. Only recently was I able to splurge on bunch of equipment which sounds fantastic. Almost anything would be better than my 15+ year old Sony book shelf speakers. The equipment I have setup is the following:

The amp is connected to a htpc using hdmi output from a Nvidia GT630 video card. The software on the htpc only needs to put the bitstream onto the hdmi because the AMP will do the job of decoding.

I decided to use foobar2000 as my audio player mainly because is free and all the software components I need are easily available. You need the following software

  1. Foobar2000 – Main application, supports FLAC, mp3 out of the box
  2. TouchRemote DACP server – component which allow you to remote control the application using Apple Remote
  3. SACD Decoder – component which allows you to decode super audio CD IOS / DSF files.
  4. WASAPI Output – component which allows direct output of the bitstream

Installing Application and setup of library

Installing the application is pretty easy: “download and double click the executable”. In the “Quick appearance setup” I preferred the Album list + Properties + Visualizations in dark blue.

Image 1

Once the application starts up, change the library view to “by folder structure”. This will display your music library in the same format as you have it stored on disk.

Image 3

Now click file -> preferences -> media library and provide the path to the music.

Image 4

Image 17

Installing DACP Server

Follow the instructions in this youtube video.

Installing SACD & WASAPI components

Download both the files and extract the “foo_input_sacd.fb2k-component” and “WASAPI.fb2k-component” files.  Click file -> preferences -> components and drag & drop both the components into the window. Then restart foobar for these to be recognized.

After the restart click file -> preferences -> playback -> output and change the output from DS (direct sound) to “WASAPI (push) : NVIDIA High Definition Audio”

Image 18

 

Thats all! You should now be able to enjoy your audio.

 

Update  2/Sept/15:

I found that my Nvidia card HDMI negotiations didn’t work too well. Sometimes it would report the yamaha and other times it would report the epson projector as the audio device. This mean that foobar would stall and required the output setting to be changed.

I’ve gone back to DS (aka direct sound).

Sorting photos using Lightroom

I’ve only recently started to use Lightroom (LR). Right now the only task its used for is to sort photos.

The normal way things work in our household is that we use the cameras on the SLR / phone and iPads till the memory runs out. This happens at the most inopportune moment like right before a birthday party or a holiday trip. As time is short I usually connect it up to the PC and drag & drop all the photos to a “ToSort” later folder. After a few months this becomes really messy and impossible to use. This is where light room fits in!

My way of archiving photos is in date order. One folder per year, then one per event with a description. It looks similar to this.

PhotoStructure

I use LR to take all my random photos in the “ToSort” folder and create this structure. So this is how you do it:

1) Start LR and click Import
2) Select a source on the Left (ie the ToSort folder)
3) Ensure the operation is set to “Move”4) Set a destination folder on the right (eg “Sorted”)
5) Ensure the Organize is set to “By date” and the Date format is set correctly. I use yyyy-mm-dd as its easy to sort & store on any file system.
6) Select all photos to process by clicking the Check All button
7) Finally click Import to make it all happen

 

LRImport

 

Now to the best part of this process: If you had multiple cameras at an event (say a SLR and iPhones) then all the photos from these devices will automatically merge into the same date folder!

If you had multiple copies of the same image (because I’ve downloaded them from the device and not bothered to delete them and forgotten that I had copied them already), LR will ask you what you want done.

 

 

 

 

 

 

 

Slow SSH connections

Recently I noticed that my ssh connections would stop for a few seconds before prompting for a password.  It turned out that the SSH command was checking the DNS servers for the Server host key. This would consume some time while the SSH daemon would try get the key from the DNS servers.

12:35PM zzz:~# ssh -v master@myswitch
OpenSSH_6.6.1p1, OpenSSL 1.0.1j-freebsd 15 Oct 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to myswitch [10.202.13.230] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type 1
debug1: identity file /home/user/ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/user/.ssh/id_ed25519 type -1
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1_hpn13v11 FreeBSD-20140420
debug1: Remote protocol version 1.99, remote software version Comware-5.20
debug1: no match: Comware-5.20
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA 41:3b:42:fd:ea:38:c8:27:f2:d4:7a:17:18:16:14:13
DNS lookup error: general failure  --> SSH stall here and does DNS requests (see tcpdump below)
debug1: Host 'myswitch' is known and matches the RSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:473
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent

 

The tcpdump shows that the daemon is doing SSHFP lookups but not getting any responses.

12:38:07.892258 IP zzz.xx.com.55994 > mydns.com.domain: 3790+ [1au] SSHFP? myswitch. (41)
12:38:12.910363 IP zzz.xx.com.33318 > vmydns.com.domain: 3790+ [1au] SSHFP? myswitch. (41)
12:38:17.926115 IP zzz.xx.com.25719 > vmydns.com.domain: 3790+ [1au] SSHFP? myswitch. (41)
12:38:22.965491 IP zzz.xx.com.29942 > mydns.domain: 3790+ [1au] SSHFP? myswitch. (41)

This can be easily turned off by editing /etc/ssh/ssh_config and setting “VerifyHostKeyDNS no”.  After setting this option, SSH skips the DNS lookups and goes straight to the known_hosts file.

 

debug1: Server host key: RSA 41:3b:42:fd:ea:38:c8:27:f2:d4:7a:17:18:16:14:13
debug1: Host 'myswitch' is known and matches the RSA host key.