Setup MPD on Ubuntu *Music player Daemon*

So what is MPD?

Well, MPD Stands for Music Player Daemon. This is a Daemon  for Linux, Windows or Mac which allows you to play music. Sounds pretty basic right? Wrong! It has full database support, supports anything FFMPEG can play, (mp3, ogg, wma, flac, etc) runs quietly in the background, and supports administration over IP from multiple clients at the same time! It’s quite simple to get setup  and with the same ease and features of say iTunes or Windows Media Player (play lists, shuffle, full search functions) All in all its an amazing powerful little tool.

Lets install it

installing and Configuring (ubuntu based system)

apt-get install mpd

It is going to download 10MB of archives, so you just got to give it a sec to let it complete…(Just be thankful you are not on my university internet…. Yea, a full 4KB/s!)

After that finishes, it will start the daemon with it’s default settings, so we need to edit the config file.

nano /etc/mpd.conf

First off, change the “music_directory” to your actual music directory.

Next, go to “bind_to_address” and enter in “127.0.0.1″. For some reason or another, MPD does not like localhost even though it is the default. Probably an Ubuntu thing…

Continue scrolling down until you get to audio_output. If you plan on using default alsa then it’s all good, it should already be configured. Now, if you want to stream your music over a network and not use alsa, comment out the alsa part by putting # in front of each line of configuration for it, there are a few! Next, pick the protocol that you wish to use and un-comment it. For example, I wanted to use the HTTP streaming server, so mine looks like this:

audio_output {
 type            "httpd"
 name            "My HTTP Stream"
 encoder         "vorbis"                # optional, vorbis or lame
 port            "8080"
 #      quality         "5.0"                   # do not define if bitrate is defined
 bitrate         "128"                   # do not define if quality is defined
 format          "44100:16:1"
 }

Under encoder, select vorbis to use ogg vorbis format, or lame for MP3. Unfortunately, due to patent issues, you are going to have to download and compile MPD  directly from their site for it to work.  The last step is to restart the daemon.

sudo service mpd restart

And that’s it! If you don’t get any error messages, then it should be working!

Advertisements

Monitor tor with arm

nano /etc/apt/sources.list
and at the bottom, add (for Ubuntu 11.10):
deb http://deb.torproject.org/torproject.org oneiric main
You can now proceed to installation:
apt-get install tor tor-geoipdb

Editing the configuration file (torrc)

Installing Tor …

This way also starts it, but the default configuration is not to relay any traffic. We now need to configure is as a relay. The configuration file to edit is usually, as mentioned there, /etc/tor/torrc:
nano /etc/tor/torrc
In this file, the settings you’ll want to look at are:

  • uncomment Log notice file /var/log/tor/notices.log if you want to avoid a notice in ARM (see below for what ARM is)
  • uncomment ControlPort 9051 so that ARM can be used to control and monitor Tor
  • uncomment ORPort and (optionally but recommended, I guess) change its value to some random available port. That’s the port that will be used by other nodes to connect to yours
  • optionally uncomment Nickname and give a name to your node
  • set RelayBandwidthRate and RelayBandwidthBurst. Those are the maximum bandwidth that can be used by Tor constantly and in burst, respectively. For instance:
    RelayBandwidthRate 5000 KB  # Throttle traffic to 100KB/s (800Kbps)
    RelayBandwidthBurst 7000 KB # But allow bursts up to 200KB/s (1600Kbps)

    Beware those values are in Bytes, not bits.

  • if you have a traffic quota (and don’t want to blow it), you’ll want to configure AccountingMax and AccountingStart
  • optionally, you can put your name and (spam protected) e-mail, or even your GPG fingerprint, in ContactInfo. According to the comments it can be used to contact you in case your node goes wild or something.
  • optionally, you can also configure DirPort to mirror directory information on this port.
  • finally, the most important part: choose whether you want to be just a relay or an exit node. To be just a relay, set:
    ExitPolicy reject *:*
    To be an exit node, you can either leave at is, or replace the default exit policy (in order to do the later, do read the instructions carefully). Note that being an exit can bring you trouble because there’s always a risk of abuse, so at least do check your country’s law, the law of your host’s country, and your host’s TOS. But I guess you’re already aware of that anyway.

Additionally, if you want to remotely use your node to enter the Tor network to surf yourself, well, I suppose it can be configured using SocksPort, SocksListenAddress, SocksPolicy accept and SocksPolicy reject, but I haven’t figured out how to do that yet :/

ARM: a terminal-friendly GUI

tor1

Last step, let’s install a nice piece of helper software called ARM (for  node-relay monitoring”), which is basically a nice console-based GUI to monitor and have some control over Tor. On Ubuntu 11.10 it’s as simple as:
apt-get install tor-arm

In order to use ARM, you’ll have to enable Tor control port first. You already entered it in the configuration file (if you followed the guide properly, at least), so we just need to apply the configuration:
/etc/init.d/tor reload

Now you can just type arm to launch ARM and view some neat information about your node, like the traffic graph, inbound and outbound nodes, etc.

 

 

Setup Fast Irssi + TOR sockets and BLOW-FISH encryption #FREENODE

Okay, First lets Install Tor.     * Guide was written using ubuntu*

sudo apt-get install tor

sudo vim /etc/apt/sources.list

add:

deb http://deb.torproject.org/torproject.org precise main
deb-src http://deb.torproject.org/torproject.org precise main

:wq

sudo su

gpg –keyserver keys.gnupg.net –recv 886DDD89

gpg –export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add –

exit

sudo apt-get update

sudo apt-get install deb.torproject.org-keyring

sudo apt-get install tor

INSTALL IRSSI

sudo apt-get install irssi irssi-plugin-otr irssi-scripts screen libcrypt-openssl-bignum-perl libcrypt-blowfish-perl libcrypt-dh-perl

cd /usr/share/irssi/scripts/

sudo wget http://freenode.net/sasl/cap_sasl.pl

CONFIGURE TOR AND IRSSI

sudo vim /etc/tor/torrc

add:

 mapaddress 10.40.40.40 p4fsi4ockecnea7l.onion

:wq

sudo service tor reload

sudo mkdir /usr/share/irssi/scripts/autorun

sudo ln -s /usr/share/irssi/scripts/cap_sasl.pl /usr/share/irssi/scripts/autorun

torify irssi

/script load cap_sasl.pl

/sasl set freenode [USER] [PASS] DH-BLOWFISH

/sasl save

/save

/exit

sudo ln -s /usr/share/irssi/scripts ~/.irssi/scripts

sudo vim ~/.irssi/config

add to line 2:

{ address = “p4fsi4ockecnea7l.onion”; chatnet = “freenode”; port = “6667”; use_ssl = “no”; ssl_verify = “no”; },

:wq

usewithtor irssi -n [USER] encryption

/server freenode

/join #[CHANNEL]