Archive

Archive for the ‘Linux’ Category

Setting up MPD and Ncmpcpp in Arch Linux

December 15, 2009 Leave a comment

Just to echo Linux.com’s starting line in “CLI audio players for Linux”: What would life be without music? That’s the number 1 thing every self-respecting 21st Century man does in his free time—lip-sync to Britney Spear’s mp3 playing off their computer at eardrum shattering volume. Alsa is also the first thing I install in Arch Linux. Not X, not openssh or anything fancy. Just a good command line audio player with the ability to play mp3, ogg and streaming Internet radio.

Even if you’re running some instance of X like: Gnome, KDE, Xfce or some other window manager, there are reasons why you might want to use a command line audio player even though there are GUI audio players like Audacious, Rhythmbox and Amarok:

  • You cannot or will not install X :D
  • You are using an old computer with limited resource
  • You’re crazy

The last point doesn’t really count as a reason, but I have been trying to learn the Linux command line for the longest time. Even though my 4 year old Toshiba laptop with 1Gb RAM can do Gnome or KDE with relative ease, I’m challenging myself to make my way around Linux using only the command line—for education purposes—not as if I’m such a whiz with an obscure OS like Linux. :p

Ncmpcpp is the frontend for MPD featuring a ncurses TUI(Text User Interface). Instead of typing something like:

archer@oldlappie ~ # mpc search artist 'Lisa Ono' | mpc add
archer@oldlappie ~ # mpc play

You can have something like the image below to easily manage your playlist, browse, add, play, delete and even download lyrics for singing along when your favorite song is playing.

ncmpcpp interface

Lyrics window for your sing-along pleasure:
ncmpcpp lyrics

Even if you’re a little lost when you launch ncmpcpp for the first time, help is just a keystroke away:
ncmpcpp help

MPD has features other than the more obvious ones I’ve listed above. I installed MPD on Arch Linux, so this post contains notes on how I got MPD and ncmpcpp rolling on my chosen distro.

MPD installation notes

1. Installing mpd, mpc and ncmpcpp
2. Configuring mpd
3. Starting mpd and playing from ncmpcpp

1. Installing mpd, mpc and ncmpcpp

Install using Arch Linux’ package manager(pacman) as root:


root@oldlappie ~ $ pacman -S mpd mpc ncmpcpp

That’s it! easy peasy, japaneasy.

2. Configuring mpd

create your mpd directory: /home/[user]/.mpd

archer@oldlappie ~ # mkdir .mpd

Copy mpd.conf.example from /etc to your .mpd directory:

archer@oldlappie ~ # cp /etc/mpd.conf.example .mpd/mpd.conf

Edit /home/[user]/.mpd/mpd.conf using your favorite editor. I’ll be using vim:

archer@oldlappie ~ # vim .mpd/mp.conf

uncomment and make your mpd.conf file reflect as below:


music_directory "/home/[user]/music" # where you store your music
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
error_file "~/.mpd/mpd.error"
pid_file "~/.mpd/mpd.pid"
state_file "~/.mpd/mpdstate"
user "[user]"

audio_output {
type "alsa"
name "My ALSA Device"
}

Make the ‘playlist’ directory as specified in your mpd.conf:

archer@oldlappie ~ # mkdir .mpd/playlists

That’s about it for configuring mpd for a local user. We’ll have to update mpd’s database before it’ll read, display and play the audio files in your directory.

archer@oldlappie ~ # mpd --create-db

That will start your mpd and you can test if it’s working by adding and playing songs with mpc:

archer@oldlappie ~ # mpc search artist 'Lisa Ono' | mpc add
archer@oldlappie ~ # mpc play
Lisa Ono - I Wish You Love
[playing] #47/62 0:01/3:49 (0%)
volume: 85% repeat: on random: on single: off consume: off
archer@oldlappie ~ #

Ncmpcpp doesn’t require too much configuration, but if you’re going to use ncmpcpp’s in-built tag editor, add your music directory to ‘~/.ncmpcpp/config’.

mpd_music_dir = "/home/[user]/music"

Start ncmpcpp by entering ‘ncmpcpp’ in the command line. That should show you an empty playlist. Top most menu bar will should you the different mode ncmpcpp is capable of. If you’re unsure of the key-bindings in ncmpcpp, hit F1 or ‘1′ to get into help page. Minimal commands you should know.


        Up k        : Move Cursor up
        Down j      : Move Cursor down
        Page Up     : Page up
        Page Down   : Page down
        Home        : Home
        End         : End

        Tab         : Switch between playlist and browser
        1 F1        : Help screen
        2 F2        : Playlist screen
        3 F3        : Browse screen
        4 F4        : Search engine
        5 F5        : Media library
        6 F6        : Playlist editor
        7 F7        : Tag editor
        0 F10       : Clock screen

   Keys - Global
 -----------------------------------------
        s           : Stop
        P           : Pause
        >           : Next track
        <           : Previous track
        f           : Seek forward
        b           : Seek backward
        Left -      : Decrease volume
        Right +     : Increase volume

        t           : Toggle space mode (select/add)
        T           : Toggle add mode
        |           : Toggle mouse support
        v           : Reverse selection
        V           : Deselect all items
        A           : Add selected items to playlist/m3u file

        r           : Toggle repeat mode
        Z           : Shuffle playlist
        i           : Show song's info
        I           : Show artist's info
        L           : Toggle lyrics database
        l           : Show/hide song's lyrics

        q Q         : Quit


Hope you will enjoy using mpd and ncmpcpp as a low footprint audio player.

A Short Update

December 14, 2009 Leave a comment

Finally got Samba, Ssh, Proftpd and other random stuff working. Haven’t got time to talk about it—been really busy with work recently. Still, I’ll have to note down the steps: Installing, configuring before I forget them all. I’m writing this post from Windows 7 by ssh-ing into my Linux box—editing in Charm 1.9. :)

Later.

Categories: Linux

Posting from Command line – Charm 1.9

December 10, 2009 Leave a comment

Just installed Charm 1.9—a really great commandline blogging tool I canme across in the past. Had some trouble using it with python 2.6 a few days ago but I’m not giving up yet. If you see this post, it means I’ll be posting from Charm from now on.

Categories: CLI applications

Note to Self – Compiling Finch only flags

December 10, 2009 Leave a comment

Compiling Finch without pidgin from source in Arch Linux.

./configure --disable-gtkui --disable-vv --disable-meanwhile --disable-avahi --disable-nm --disable-tcl

Edit: There’s no sound playing from finch. I guess I’ll have to live with it—not a big problem.

New Project – Reviving the old one

December 7, 2009 Leave a comment

Mentioned in the previous post that I have an old hand-me-down computer sitting on the floor. It’s a 5 year old desktop on speed–Pentium 4 1.6GHz, 1 Gb RAM, 2x 80 Gb Hdd, a wireless PCI card. It’s a no-brainer this ‘old’ ‘puter will run Ubuntu with ease, CLI Arch Linux at a blazing speed, wireless connection on steriods. There is however the issue of a password protected BIOS of which the previous owner had forgotten all about. The wireless card is also short of an antenna.

What’s a little bit of challenge? There are more Linux tinkerers who had installed Linux on 486, or Pentium with 128Mb RAM, etc. I’m not going to let something as small as a locked BIOS stop me.

For now, I have to get busy with a crazy influx of year end work. Still, next thing to do >> Find a way to unlock the BIOS.

Categories: General Rants, Life, Linux

Back for more command line goodness

December 5, 2009 Leave a comment

It’s been more than a year. I’m back for more CLI, command line,
anti-X(Not really, since I’m a photographer and need windows. :P)
goodness. So, what’s the Distro of the month—proud to say that
I’m still very much in love with Arch Linux even though I’m guilty of
pining after Ubuntu.

I’ll never be a Linux guru but I guess the title of Linux
tinkerer—never aspired to be more. My goals had mostly been:
resurrecting the old computers like a Pentium II 450 MHz all the way to
Pentium 4 that I can get my hands on—maybe just a few at a
time—limited space in my room. :)

Fiddling with Arch Linux had been enjoyable but I do worry about their
support for i686 and x86_64. That means I might not be able to install
Arch Linux on some of the older computers and I’m getting pretty
familiar with Arch. Another problem faced is that Arch Linux has some
really cutting edge softwares, a stray package might break the balnce.
In any case, I’m a Linux Hobbyist performing installation on none
mission-critical hardware so I’m happy.

Currently I have an old Toshiba M40 running a fresh installation of Arch
Linux which I’m using to hammer out this post. The screen is
unservicable but I’m might turn it into a headless music server. The
next unservicable computer that I have is sitting on the
floor—cutting-edge stuff—Pentium 4 1.6 GHz with 1 GB RAM. I’m having
some problem starting it up but hope to install Arch Linux, Crux or
Debian on it; maybe turn it into a Media Center.

Ideas are floating around in my head… we’ll see about giving these computers a new lease of life.

Categories: Linux

More about using blogpost

August 21, 2008 Leave a comment

Using blogpost to manage and post to your wordpress blog is not exactly intuitive. There are commands and flags used in the command line that you need to remember; on top of that, you have to learn how to use AsciiDoc and a little HTML. What’s even worse—the documentation from Blogpost official site is not exactly informative. Sure, there are helpful text to be found there, but you have to dig pretty deep and keep an eye out for important information regarding the use of blogpost.

In any case, I have some notes to share here; mostly on the commands in the terminal.

For posting: <quote> $ blogpost create [your-asciidoc-text-file.txt] </quote>

For listing your entries: <quote> $ blogpost list </quote>

For deleting: <quote> $ blogpost delete —post-id=[ID-number] </quote>

For updating with your blog file: <quote> $ blogpost update [blog-text-file.txt] </quote>

For categorising: <quote> $ blogpost cat categories=[categories-seperated-with-commas] [blog-file] </quote>

That’s about the long and short of it.

Using Linux Command line applications

August 18, 2008 1 comment

Linux command line applications suffer from a problem. The commands written into the programs are not universal. That means commands from one program to the other conflicts with what you’ve learned. Take for example Audio player X uses ‘n’ to skip a track. That’s not the case for Audio player Y—if you decide to change another music player(Maybe you just need a certain feature in Y).

That’s probably the biggest problem surrounding CLI applications—the programs are just not as intuitive to use. Other than that, not having flash, java… etc doesn’t really drive me away from CLI. Fact is, I’ve learned a lot more about concentration after using command line applications—Just using bash itself taught me quite a bit. There are minimal distraction when you’re typing a document in VI/Emacs when you’re running everything full-screen. You can argue that it can be achieved in X too.

That’s too true, but CLI uses less resource. I can run elinks, Emacs, mpg123, mutt without putting a dent on my ‘pretty old’ P4 1.7GHz with 256 RAM machine. Sure, I can use a light windows manager like fluxbox, wmii; but I’ve gotta used to the command line system.

Categories: CLI applications, Linux

Linux = Freedom?

August 17, 2008 Leave a comment

A guy from Ubuntu forum decided to go without GUI for 30 days—that was about a month ago. Nothing but CLI applications, no GUI—at all. Little did he know that the Linux community is so intolerant of his choice of Distro.

On his 12th day of going commando, someone from a general Linux forum started dissing him, calling him a fag.(not the exact word, but the meaning’s the same) I don’t understand the Linux Community at all. Maybe that guy just belongs to a very small group of egotistical 1337 71NuX h4×02—he’s still a douche bag. Behaving like a 10 year old on a public forum is really poor etiquette.

He doesn’t like Ubuntu. So… wtf?! It’s freedom isn’t it? The ability to run Linux on your x86 hardware is freedom. Paying nothing for your software is freedom; choosing Linux over Windows, OSX, Unix, OpenSolaris, BSD… etc. is bloody freedom, isn’t it?

It’s like dissing someone who chooses to eat banana flavored ice-cream instead of the original vanilla. That sort of behaviour is ohhh sooooo L33T! So bleeding juvenile. So what if someone decides to use Ubuntu, Slackware, Gentoo, Arch Linux, Mandriva, Fedora or whatever Linux. The bottomline is this: It’s still LINUX! Even if he decides to run Windows, and decides to stick to Dos for the next 30 days, I don’t see what’s so wrong with that.

Sure, that bugger can exercise his freedom of speech, but everyone can see that he’s a dumbass. Enough said.

Categories: Linux

Posting AsciiDocs with blogpost 0.9.1 to WordPress

August 16, 2008 Leave a comment

This is my first time using AsciiDocs to write a blog post. The irony is that I have to learn how to config and post from the command line using: Blogpost 0.9.1. Blogpost 0.9.1 was created by Stuart Rackham. After creating docs, manpage with Asciidoc, he found the need to submit a asciidoc text file to his chosen blogging platform—WordPress. That’s when he started writing Blogpost, all so that he could create a .txt file with ascii syntax and post it to his blog from the command line.

In any case, I’m just going to try out for this once.

Categories: Arch Linux, Linux