Posted by: amychr | 13 November 2008

setting up MPD

Setting up the Music Player Daemon (MPD) can be easy and fast with a little help. Here’s what to do to get it going after installing it (with apt, emerge, pacman etc):

rm /etc/mpd.conf
(just in case)
vim /etc/mpd.conf
(put in it and change to suit)
music_directory        “~/music”
playlist_directory    “~/music/playlists”
db_file                “~/.mpd/db”
log_file            “~/.mpd/log”
error_file            “~/.mpd/error”
pid_file            “~/.mpd/mpd.pid”
state_file            “~/.mpd/mpdstate”
user                “youruser”
bind_to_address        “127.0.0.1″
port                “6600″
(save it and close)
mkdir ~/music
mkdir ~/music/playlists
(if you need to)
touch ~/.mpd/mpd.pid
mpd –create-db
(if this doesn’t work, check the user in mpd.conf)
mpd

To get it to run on bootup: (for Arch linux)

add mpd to /etc/rc.conf to have it on boot up.
(in the DAEMONS line)

Posted by: amychr | 1 August 2008

Quick pic of the Day

Not bad coming from a 2mp iPhone camera. I’m really surprised at the level of quality a color trueness this camera has. Here’s a pic of the to illustrate:

photo

Posted by: amychr | 15 July 2008

Working on pyStones

I’m still working on finishing pyStone. Its starting to really come together. I think it will be at a stable version in the next few days, so it seems like a good time for a screenshot. Here’s my desktop while I’m working:

Posted by: amychr | 13 July 2008

Py-Stones update

There is a new version of py-stones at my googlecode page today. I fixed the input-line bug and changed the interface some, so check it out.

Posted by: amychr | 15 May 2008

Quick DNS setup guide for Leopard

Ready for a quick setup of DNS server bind on OS X? Here we go! You need admin access rights to do this, so to make it easy, I suggest you do all the file editing in the terminal with vi or pico. This guide is best for a one domain, one IP setup, although it is true for any configuration with some changes. Use this guide if you know nothing about DNS and want to set things up quick or if you know what you’re doing and need to know which files OS X is using.     ….not valid for Leopard Server!

  1. Open /etc/named.conf in your favorite editor (or sudo vi /etc/named.conf)
  2. First change to named.confAdd a foward zone for each do main, like this. The zone is the name of the domain you want to host and the file is what file will have to domain’s configuration in it. You need one for each domain you’re hosting. 
  3. Second change to named.confAdd a reverse zone for each IP subnet which will be used for the domains.Set the zone to the first three digit groups of the subnet, backwards. So, 192.168.0.x will be written 0.168.192. I know, it’s a little weird. In both the foward and reverse files, what file name you choose is really arbitrary. You just have to be consistent. The files themselves will be in /var/named.
  4. Save the changes to named.conf and close the file. The file should look something like this: (if you can’t see the whole thing, copy and paste it into an editor)
  5.  

     

    //
    // Include keys file
    //
    include "/etc/rndc.key";
    
    // Declares control channels to be used by the rndc utility.
    //
    // It is recommended that 127.0.0.1 be the only address used.
    // This also allows non-privileged users on the local host to manage
    // your name server.
    
    //
    // Default controls
    //
    controls {
    	inet 127.0.0.1 port 54 allow {any;}
    	keys { "rndc-key"; };
    };
    
    options {
    	directory "/var/named";
    	/*
    	 * If there is a firewall between you and nameservers you want
    	 * to talk to, you might need to uncomment the query-source
    	 * directive below.  Previous versions of BIND always asked
    	 * questions using port 53, but BIND 8.1 uses an unprivileged
    	 * port by default.
    	 */
    	// query-source address * port 53;
    };
    //
    // a caching only nameserver config
    //
    zone "." IN {
    	type hint;
    	file "named.ca";
    };
    
    zone "localhost" IN {
    	type master;
    	file "localhost.zone";
    	allow-update { none; };
    };
    
    zone "0.0.127.in-addr.arpa" IN {
    	type master;
    	file "named.local";
    	allow-update { none; };
    };
    
    zone "kiwimod.com" IN {
    	type master;
    	file "named.kiwimod.com";
    };
    
    zone "129.234.60.in-addr.arpa" IN {
    	type master;
    	file "named.129.234.60";
    	allow-update { none; };
    };
    
    logging {
            category default {
                    _default_log;
            };
    
            channel _default_log  {
                    file "/Library/Logs/named.log";
                    severity info;
                    print-time yes;
            };
    };

     

     

  6. Save the changes to named.conf and close the file.
  7. Create the foward zone file we specified earlier (named.kiwimod.com) in /var/named. This directory will also contain named.local and named.ca. Just leave these files alone. They are fine as they are.
  8. Open the file in an editor. (Again, sudo is very useful for this.) Type in this, changing the names to fit your site:
  9.  

     

     

    ; DNS for KiwiMod.com
    
    $TTL 86400  ; 1 day
    kiwimod.com.          IN  SOA ns.kiwimod.com. admin.kiwimod.com. (
                              2003040101      ; Serial
                              10800           ; Refresh after 3 hours
                              3600            ; Retry after 1 hour
                              604800          ; Expire after 1 week
                              86400 )         ; Minimum TTL of 1 day
    
    ; name servers
    @	IN	NS	ns.kiwimod.com.
    @	IN	MX	10 mail.kiwimod.com.
    
    ; host to address mappings
    @		IN	A		60.234.129.2
    mail		IN	A		60.234.129.2
    ns		IN	A		60.234.129.2
    ; aliases
    www		IN	CNAME	mail
    amy		IN	CNAME	mail

     

  10. Save and close the file.
  11. Create the reverse zone file (named.129.234.60 or whatever you called it) in /var/named. Edit the file to read:
  12.  

     

     

    ; Reverse lookup for 60.234.129.2
    $TTL 86400  ; 1 day
    129.234.60.in-addr.arpa  IN  SOA ns.kiwimod.com. root.kiwimod.com. (
                                2003040101      ; Serial
                                10800           ; Refresh after 3 hours
                                3600            ; Retry after 1 hour
                                604800          ; Expire after 1 week
                                86400 )         ; Minimum TTL of 1 day
    
    ; name servers
    129.234.60.in-addr.arpa  IN  NS  ns.kiwimod.com.
    
    ; address to host mappings
    2                       IN  PTR kiwimod.com.
    2                       IN  PTR ns.kiwimod.com.
    2                       IN  PTR mail.kiwimod.com.

     

  13. Just change the IP and domain bits to be your settings. The digit 2 in address to host mappings is the last number of the IP address. In this example, only one IP is being used for the domain, but using more than one works pretty much the same way, you just need additional reverse zone files and reverse lookup settings in named.conf.

That’s it. All you have to do now is start up named and see if it worked.
In the terminal, type:

sudo named -c /etc/named.conf

to start up the nameserver. To see if the name is resolving, try digging it:

dig kiwimod.com

or

dig 192.168.your.IP

Use your own IP of course, the IP of the server that is. You should get back some information about the server, like what IP the nameserver has. If not, then something has gone horribly wrong!

Older Posts »

Categories