Monday, 21 February 2011

Music Maps

So I have been on a rant to identify new bands and music to listen to within a spesific genre. This led to me search for ways of finding "related bands" of known bands to me.
Although services like youtube an last.fm can do this I wanted an interactive map and found the following:


http://audiomap.tuneglue.net/
http://www.music-map.com/
http://liveplasma.com/

Wednesday, 6 October 2010

Syslog-ng server on Ubuntu

Well once you know what to do it is actually easy to get it going, however there is a few things you need to know:

  • Remote logging needs to be enabled on the server

  • Firewall needs to accept traffic for syslogs

  • on the client logs need to be forwarded to the syslog server

  • a log filter need to be created on the client


So a typical / basic setup that forwards everything to the servers default log destinations e.g. /var/log/syslog will look as follows:

Server side:
Basic config change to get the server accepting remote logs:
uncomment:
         udp();
Client side:
The most basic setup to forward all logs to the syslog-ng server:

destination server { udp("192.168.0.1" port (514)); };

log {
        source(s_all);
        destination(server);
};

I am also sending logs from my Mikrotik device to the syslog-ng server as follows:

[user@Mikrotik] > /system logging action print
Flags: * - default
 #   NAME                      TARGET REMOTE                                  
 0 * memory                    memory
 1 * disk                      disk 
 2 * echo                      echo 
 3 * remote                    remote 192.168.0.1:514                           
[user@Mikrotik] >

[user@Mikrotik] > /system logging print       
Flags: X - disabled, I - invalid
 #   TOPICS                          ACTION                          PREFIX   
 0   info                            memory                                   
 1   error                           memory                                   
 2   warning                         memory                                   
 3   critical                        echo                                     
 4   warning                         remote                          mikrotik

Happy logging.

Tuesday, 5 October 2010

To test if a port is open on linux

Well I wanted to test if a linux box is ready to receive syslog log files remotely and used netcat / ccat / nc for the purpose.

It is a server/client application whereby you run the server in listen mode and then start the client on a different host and connect to the server, it can create both tcp and udp connections.

I had some trouble with the syntax on Ubuntu 10.04 Lucid Lynx and hence will post the commands that worked for me:

Server:

user@server:~$ sudo nc -l -u 514


-l : is for listen
-u : is for udp

Client:

user@client:~$ nc 192.168.0.1 -u 514


where 192.168.0.1 is the ip of the server
If it connects you can then type anything in the client and it will display in the server window confirming the port is available and no firewall is blocking teh traffic, hence you can move to the application layer.

Thursday, 8 July 2010

how to keep program running after closing ssh session

I first tried <command> &  - but that only put the program in the background when disconnecting it terminted the job

I then tried nohup <command> & detaching it supposedly from the terminal but it did not work either

 I then found a program called screen

sudo apt-get install screen 


To start an shell app just type

screen -Amd command



Once it's running, press Ctrl-a (control and a at the same time), then press d

to re-attach to it later, login with ssh and type

screen -r 

Friday, 22 January 2010

MythTV - DSTV Channel Changer

LIRC

So the first step was to get LIRC up and running on Mythbuntu; this was quite easy as the default installation do enable lirc, I only selected " Enable an IR Transmitter" and selected a bogus Serial lirc device.

ir tx

This created all the relevant configuration files.

I then searched the net for the lircd.conf (remote command reference file) for my spesific decoder

digsat_uec-dsd-820_thb(DSD820 aka DSTV DualView Decoder).

 I did not find the spesific file but found one for the UEC DSD910 decoder.

digsat_uec-dsd-990_thb

The DSD910 remote file (general.conf):

#
# this config file was automatically generated
# using WinLIRC 0.6.5 (LIRC 0.6.1pre3) on Wed Sep 10 15:36:20 2003
#
# contributed by Guy Antony Halse <guy-lirc@rucus.ru.ac.za>
#
# brand:             Multichoice
# model:             DSD910
# supported devices: Digital Satellite Decoder (DSTV Decoder)
#
# Multichoice is a South African Satellite TV company offering their
# own branded decoders.

begin remote

  name  dsd910

  bits           13
  flags RC5|CONST_LENGTH
  eps            30
  aeps          100

  one           962   808
  zero          962   808
  plead         992
  gap          113485
  toggle_bit      2
      begin codes
          power                    0x000000000000160C
          red                      0x000000000000162C
          green                    0x000000000000162B
          yellow                   0x000000000000162A
          blue                     0x000000000000162E
          1                        0x0000000000001601
          2                        0x0000000000001602
          3                        0x0000000000001603
          4                        0x0000000000001604
          5                        0x0000000000001605
          6                        0x0000000000001606
          7                        0x0000000000001607
          8                        0x0000000000001608
          9                        0x0000000000001609
          0                        0x0000000000001600
          radio                    0x0000000000001625
          tv                       0x000000000000162F
          mute                     0x000000000000160D
          teletext                 0x0000000000001624
          information              0x000000000000162D
          up                       0x0000000000001612
          left                     0x000000000000161D
          ok                       0x0000000000001622
          right                    0x000000000000161E
          down                     0x0000000000001613
          menu                     0x000000000000161C
          exit                     0x0000000000001631
          tvguide                  0x0000000000001635
          progup                   0x0000000000001620
          progdn                   0x0000000000001621
          volup                    0x0000000000001610
          voldn                    0x0000000000001611
      end codes

end remote
 

This file was copied to the relevant directory in /var/lib/cache/lirc/....

The next step was to change the config in /etc/lirc/hardware.conf

#Chosen IR Transmitter
TRANSMITTER="dsd910"
TRANSMITTER_MODULES="lirc_dev lirc_serial"
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE="/dev/lirc0"
TRANSMITTER_LIRCD_CONF="dsd910/general.conf"
TRANSMITTER_LIRCD_ARGS=""

After that I started the lirc again:

sudo /etc/init.d/lirc start

This was then tested with the following command:

sudo irsend SEND_ONCE dsd910 information

This worked and showed the "information banner".
This was tested on TV1.

Still to do is to  add and test TV2 ir and to enable a change channel script in Mythbuntu.

Thursday, 14 January 2010

Bind Dynamic DNS Updates

I saw a request to update Bind via a command line rather than Webmin for the ease and speed of a command line; So I embarked on investigating this.

Firstly it seems that there is not a lot of dynamic update or command line update scripts available or the people just don't want to share ???

I stumbled across nsupdate, an application that is part of the Bind suite.
This is a command line tool to add dynamic updates to an DNS server.

for this to work you need to update the specific zone file with at least the following configuration:

zone "example.com" {
type master;
file "/etc/bind/example.com.hosts";
allow-update {192.168.0.0/24; };
journal "/var/lib/bind/example.com.hosts.jnl";

};
For dynamic DNS you need:
allow-update
journal

then to add an entry to the DNS server:
from within the 192.168 ip range :

user@pc:~$ nsupdate
> zone example.com
> update add guest1.example.com. 86400 A 192.168.0.10
> send
> quit

your syslog on your DNS server will log all updates

Tuesday, 15 December 2009

Mythbuntu - BTTV Driver

The following settings woked for my PowerColor BT878 capture card:

lspci
04:00.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
04:00.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

And the settings:
rmmod bttv
rmmod tuner
sudo modprobe bttv card=70 tuner=1



Wednesday, 9 December 2009

Can't ping FQDN in Ubuntu

I created a local DNS zone ending in .local and experienced weird DNS behaviour; dig worked 100%

It seems the avahi-daemon interferes with the normal resolving process. It’s DNS caching borks the normal functionality

The fix:


# shut it down
sudo /etc/init.d/avahi-daemon stop
# stop it starting at the next reboot by removing the startup links
sudo update-rc.d -f avahi-daemon remove
Removing any system startup links for /etc/init.d/avahi-daemon ...
/etc/rc1.d/K86avahi-daemon
/etc/rc2.d/S50avahi-daemon
/etc/rc3.d/S50avahi-daemon
/etc/rc4.d/S50avahi-daemon
/etc/rc5.d/S50avahi-daemon


Sunday, 1 November 2009

Cacti - Mikrotik Signal Strength Graph for client connection

[caption id="attachment_174" align="aligncenter" width="603" caption="cacti signal strength graph"]cacti signal strength graph[/caption]

Well it took me some time and confusion to get this graph going; at the end of the day it was a configuration error and the misuse/confusion between different templates found on the net.

In summary this is the correct parameters:

Cacti version: 0.8.7e
Mikrotik Router OS: 4.2

Device:

  • Added device with SNMP v1 & Mikrotik Template

  • Make sure the Associated Data Queries - Mikrotik - Wireless - Client is working.


Data Sources:

  • Selected Data Template - Mikrotik - Wireless - Signal Strength ( NOT Mikrotik - Wireless - RegTable Signal Strength)

  • Custom Data - Index Value - This is the numerical value (e.g. 4) corresponding to the wireless interface index id you want the signal strength measured for.

  • Custom Data - Index Type - ifIndex


Data Queries:

  • Use the Mikrotik - Wireless - Client data query located at <path_cacti>/resource/snmp_queries/mikrotik_wireless_client.xml and make sure the Data input method is: Get SNMP Data (indexed)


That should do the trick.

Where did I go wrong:

I had to add a new device for this to work, but once working I could duplicate the graph and associate it with the correct device. - don't know if this is a cacti bug or not?

I used the RegTable signal strength data template in error

Wednesday, 21 October 2009

LNB

Well after some investigation it was found that a LNB don't last forever and can be an piece of equipment that can give you a lot of headacke

Dual polarisation LNBs


The LNB shown above has one wire going into the waveguide to pick up vertical polarisation. If the input waveguide is circular is can support two polarisations and it can be arranged for there to be two input probes at right angles, thus allowing two alternative polarisations to be selected (vertical or horizontal), either one or the other. Dual polarisation LNBs may commonly be switched remotely using two alternative DC supply voltages. e.g. 13 volts makes it receive vertical polarisation and 19 volts make it receive horizontal polarisation.


LNB supply voltages


The DC voltage power supply is fed up the cable to the LNB. Often by altering this voltage it is possible to change the polarisation or, less commonly, the frequency band. Voltages are normally 13 volts or 19 volts. Perfect weatherproofing of the outdoor connector is essential, otherwise corrosion is rapid. Note that both the inner and outer conductors must make really good electrical contact. High resistance can cause the LNB to switch permanently into the low voltage state. Very peculiar effects can occur if there poor connections amongst multiple cables to say an LNB and to a transmit BUC module as the go and return DC supplies may become mixed up and the wrong voltage applied across the various items. The electrical connections at the antennas between the LNB and the BUC chassis are often indeterminate and depend of screws in waveguide flanges etc. Earth loop currents may also be a problem - it is possible to find 50 Hz or 60 Hz mains currents on the outer conductors - so be careful. Such stray currents and induced RF fields from nearby transmitters and cell phones may interfere with the wanted signals inside the cables. The quality and smoothing of the the DC supplies used for the LNBs is important


How to test an LNB


Check with a current meter that it is drawing DC current from the power supply. The approx number of milliamps will be given by the manufacturer. Badly made or corroded F type connections are the most probable cause of faults. Remember that the centre pin of the F connector plug should stick out about 2mm, proud of the surrounding threaded ring.

Use a satellite finder power meter. If you point the LNB up at clear sky (outer space) then the noise temperature contribution from the surroundings will be negligible, so the meter reading will correspond to the noise temperature of the LNB, say 100K (K means degrees Kelvin, above the 0 K absolute zero temperature). If you then point the LNB at your hand or towards the ground, which is at a temperature of approx 300K then the noise power reading on the meter should go up, corresponding to approx 400K (100K +300K).

Note that LNBs may fail on one polarisation or on one frequency band and that the failure mode may only occur at certain temperatures.

[gmap]