Näytetään tekstit, joissa on tunniste guide. Näytä kaikki tekstit
Näytetään tekstit, joissa on tunniste guide. Näytä kaikki tekstit

tiistai 21. heinäkuuta 2009

Beginner's guide to Linux: openSuSE 11.1 exploring the desktop and system configuration

In previous screencast we demonstrated how easy it is to install modern Linux distribution (openSUSE 11.1 to be exact). In this screencast we explore a bit the newly installed system and the new KDE4 desktop. We also learn how to access YaST, a superb system administration tool and how to change display resolution with it.

KDE is one of the major desktops available for Linux, the desktop means in this case the graphical interface that user sees in front of him when he is using his openSUSE system. KDE went through major changes from the "old" KDE 3.5 series to the new KDE4 series, to a point that the new KDE is a complete re-design of the desktop metaphor. KDE has always been my choice on desktop and because openSUSE does great job 'releasing' KDE it has only deepened my admiration for the openSUSE project. KDE.org has a nice visual guide to KDE4, check it out!

YaST is no doubt one of the single most greatest aspect of openSUSE Linux distribution. People that have not used it seem to think that it is yet another package manager (if that was the case it would be called YaPM). Truth is that YaST is so much more than simple software installation tool, it is everything that is missing from most other Linux distributions and that is a centralized system administration tool that makes configuring your system easy. Want to partition your drives? Simple, use YaST. Want to setup your monitor to correct resolution? Again thats simple just launch YaST. Want configure file serving or other server functionality? YES, use YaST!

In video below I'll shortly present the two aspects I like most about openSUSE, as described above they are: great KDE desktop implementation and YaST. By KDE implementation I am not saying that openSUSE devs did all the work, but they compile a great release with fixes and polish to the KDE code.


Notice, the above video should load, by default, in HD mode. So just ignore the recommendation on the video to "turn on the HD resolution".

lauantai 20. kesäkuuta 2009

Beginner's guide to Linux: openSuSE 11.1 installation guide

It is evident from the earlier blog entries, that I've been into making screencasts lately. I've started a series of screencasts called "Beginners's guide to Linux", in which I use openSUSE 11.1 to demonstrate how to install and use a modern Linux operating system. Of course the choice of Linux distribution and the desktop environment can be argued to infinity, I've decided to use what I use currently myself and following videos will feature openSUSE 11.1 with KDE4 desktop.

There are several ways (the case always when dealing with Linux) you can choose to install openSUSE 11.1. First you could download the LiveCD's, so called because you can boot your computer from them without installing anything, although you can actually install a basic system from the LiveCD also. Nice thing about LiveCD's is that you get to see a preview how you desktop looks and behaves, how openSUSE detects your hardware and so on, without actually installing anything. Keep in mind though that booting to a LiveCD environment will present you with slower system and with less functionality than you would get with doing a real hard drive installation. If you want to try out a LiveCD, you need to choose between the two (main) Linux desktops, KDE and Gnome. Second way to install, which I like the best, is to download the DVD and install using that. The DVD offers a better installation program, more choice in software and you can choose between several different Desktop during the installation. Head to http://software.opensuse.org/ to download the CD or DVD image.

First screencast starts where any Linux beginner would, installing the system. While it is nowadays very easy to install any modern Linux distribution, there might be some points like partitioning where beginner can feel out of their depth. The video is fast forwarded during the tedious bits of installation, so expect to spend something like 20-60 minutes when installing it, depending quite a lot about horsepower on your computer. On this screencast we are using 32bit DVD.



Notice, the above video should load, by default, in HD mode. So just ignore the recommendation on the video to "turn on the HD resolution".

tiistai 9. kesäkuuta 2009

Secrets of screencasting in Linux

"A screencast is a digital video recording that captures actions taking place on a computer desktop. Screencasts, which often contain voice-over narration, are useful for demonstrating how to use specific operating systems, software applications or website features."
Definition by: WhatIs.com


To be honest, there is nothing mysterious about screencasting on Linux operating system. Plenty of applications exist from recording your desktop to audio and video editing. But the small advice I can give is in form of applications that I've tried and found out to work best for my needs.

For me the workflow is only three phased, phases being: recording the video, editing the video and adding audio, and finally uploading the video Youtube and creating captions. Because I am not doing any voice-over narration (my english is not that good) I can skip any advanced audio editing that might be otherwise required.

Step one of the workflow is to record the video from your desktop. I've experimented with few applications and found out that application called recordMyDesktop suits my needs best. recordMyDesktop gives me stability, simplicity and performance that I require and most importantly it gets the job done. Changes are that you can find this application straight from your distributions software repository. recordMyDesktop saves the video to Ogg Vorbis Video format (.ogv) but on step two you can convert it to pretty much anything, besides at least Youtube accepts ogv-files just fine.

Step two is to edit the recorded video and add some audio to go with it. The application I use for this is called Cinelerra, it is a long standing video editing software for Linux and might actually be a bit "overkill" for screencasting needs. Previously I've edited a 7 minute making-of documentary of indie film called "Korpinkieli ja Vaeltaja" (website in finnish only) using Cinelerra.
Although it has been over three years since then, Cinelerra still feels very familiar and is now considerably more stable. Check out the tutorials on Cinelerra's website to get going, I assure you that once you get going it is very nice tool. After the video is edited it is time to add audio track. Because I'm no good as narrator, I've only added some Creative Commons music to the video.

Step three starts with uploading the video to the chosen video host. I am using Youtube, but of course there are also alternatives like Vimeo. After the video is uploaded I usually create the captions using the Youtube's caption editor. After that the video is ready for publishing.

torstai 14. helmikuuta 2008

Quickie: Setting NTP

If you are doing DVB recordings via timers like I am, then you probably want to set up ntp-client to update the systemtime in startup.

During this past month that I have been slowly building my HTPC, systemtime is already ahead by five minutes. That means basically that every timer now starts recording 5 minutes too early and ends early also. I have, of course, setup extra time before and after every timer, in fact VDR does this by default. But if the time gets ahead by more than 10 minutes, my recordings start to end prematurely, which of course is not very nice.


So ntp-client to the rescue! Here is short how to, in which we are using NTP-server in Finland, please find one closer to your location.

echo "net-misc/ntp caps" >> /etc/portage/package.use
emerge -a ntp


Edit /etc/ntp.conf and change the server to one close to your location. For us Finns it is "server fi.pool.ntp.org".

Edit /etc/conf.d/ntp-client and change the NTPCLIENT_OPTS to following (again this server is in Finland)

NTPCLIENT_OPTS="-s -b -u fi.pool.ntp.org"

Test the ntp-client by issuing date commands before and after starting the ntp-client. System time should be updated. If it works, set it to run every boot by adding it to default runlevel.

date /etc/init.d/ntp-client start date rc-update add ntp-client default

If running time sync every boot is not enough for you, then you can set up the ntpd. But do not setup the ntpdate to be run by cron, here is why.

tiistai 12. helmikuuta 2008

Installing HTPC software (part 3)

In this entry we will have a look at how to install VDR (Video Disk Recorder) on Gentoo.

This time we are not going to utilise Gentoos excellent emerge-tool, but we are going to do it manually. Main reason for compiling VDR by ourselves, is that this way we get the version we want, with patches we want. For the first time it may be easier to install VDR via emerge, but later on, if you want to play more with VDRs plugins, I suggest that you compile it by hand.

Patching VDR can be little bit tricky, so I am going to use my old pre-patched version of 1.4.7 VDR source code. As with MMS there is also unstable release of VDR 1.5, this time however I am going to install the old and proven-to-be-stable version. You should probably download vanilla source code, that way you can patch it yourself if you need to and if not, you can keep the changes to minimum.

First thing is to take care of the dependencies, emerge libcap and jpeg. Those two are required for VDR to compile. Now download the source code (I am using root to run VDR, bad policy, I know) in to /root, then extract it. Now I have following directory /root/vdr-1.4.7 and I will create following symlinks, these are also needed for compilation. After that you can just issue "make && make install" in VDR directory.

ln -s /usr/src/linux /root/DVB
ln -s /root/vdr-1.4.7 /root/VDR


Compiling the plugins is a bit more involved. You must extract your plugins into /root/VDR/PLUGINS/src directory. That is not enough though, you also need to create a symlink for every plugin, removing the version numbering. For example this is what you would do for subtitles-plugin

cd /path/to/vdr/PLUGINS/src
wget http://virtanen.org/vdr/subtitles/files/vdr-subtitles-0.5.0.tgz
tar xvfmz vdr-subtitles-0.5.0.tgz
ln -s subtitles-0.5.0 subtitles


Do the same for all your plugins and modify the process accordingly, then just run "make plugins" in /root/VDR . If everything compiles correctly you need to copy the resulting files in /root/VDR/PLUGINS/lib to /vdr/lib, create the latter if it is not there already. (Notice that if you are compiling xineliboutput-plugin then you need to run "make install" in xineliboutputs own directory.)

Now you are set to go, meaning you can start the hard part, configuring VDR and plugins.

In next entry, configuring VDR and adding the needed scripts.

tiistai 5. helmikuuta 2008

Installing HTPC software (part 2)

OK kids, today we are learning how to install the MMS (that is short for My Media System kids) the ´Hard way´.

Nice screenshot showcasing new feature, movie thumbnailing.

Kidding aside, installing the latest, unstable release 1.1.0, is not that hard either. Thanks to nice people in Gentoo (and MMS) community we already have mms-1.1.0-rc1.ebuild available. Using the ebuild the installation is pretty easy, although it has few more steps to it, than the basic stable installation I talked about in part 1 of "Installing HTPC software".

First thing we need to do is create a local portage. Make sure you have /usr/local/portage directory available and create it if not. After that add the following line in to your /etc/make.conf, if it is not already there.

PORTDIR_OVERLAY="/usr/local/portage"

Then create the following directory structure

/usr/local/portage/media-video/mms

In the directory mentioned above, run following command to download the ebuild. (Sorry about the small print, but the blogger.com loses few letters from it if it is any bigger.)

wget ftp://83.142.84.214/gentoo-ebuild/mms/mms-1.1.0_rc1.ebuild

Then you need to make few changes to package.keywords and package.use files. The first one adds CPU-type detection for MMS package installation and another one tells emerge to use latest available version of MMS.

echo "media-video/mms cpudetection" >> /etc/portage/package.use
echo "media-video/mms ~*" >> /etc/portage/package.keywords


Next we "digest" the ebuild to create correct Manifest, then we are going to emerge the MMS.

ebuild mms-1.1.0_rc1.ebuild digest
emerge -av =media-video/mms-1.1.0_rc1


Now emerge should run its course and you should have functioning MMS as a result. Configuration files reside in /etc/mms directory, so start from there, some configuration is needed in several files. You should be able to figure out the needed changes, which of course, depend on your setup.

Before we can actually run the MMS we need to install X server, all we need is the most basic of graphical mode. I for example have no need for a desktop environment like KDE or Gnome. Installing basic GUI is as easy as typing "emerge xorg-server" after that you need to configure the graphics settings in /etc/X11/xorg.conf, but I will leave that to you, since every hardware configuration has it´s own settings. However here is a sample xorg.conf for Mirai DTL-642E500 television with Nvidia graphics adapter.

Once the xorg.conf is ready, easiest way to start MMS with X is to edit /etc/xinitrc file this file gets executed when X is started. So add a line like one below to start MMS automatically on X startup.

/usr/local/bin/mms

More on my MMS configuration in next entry (or one after that), you should be able to go on by yourself, configuring your /etc/mms settings to way you like.


Disclaimer: Thanks for the ebuild and advices on how to get it to work goes to Vitalogy in MMS forums.

keskiviikko 30. tammikuuta 2008

Trying to evolve

We Finns have proverb about learning by "kantapään kautta", basically that means that we learn from our mistakes. This must be the one of most painful methods of education, but it sure is effective. If you are wondering what I am babbling about, then please read my first blog entry, because this entry is about BACKUPS.


An easy and pretty fast way to make a backup of Gentoo installation is by using script called Stage4. This archives your root partition either into single or multiple gzip's or bz2's. The script is easy to use and does not need much configuration. I am currently running it with default settings. During my first backup my root partition used 2.7GB and was compressed to 552MB. I am storing the backup-archive on my workstation, because even I cant wipe out two computers at once.

You can download the stage4-script from here. I advice you to read through it, the configuration is in the beginning, it is very well documented and is not that long. But basically you just drop the file to /usr/local/bin, chmod it to have execute rights and then execute the script. Script reports problems if there are some and the output is pretty self explanatory. Hopefully you don't have to learn the restoration process, but if you do, it is documented in the wiki.

Once my installation is ready, or at least "more complete", I will be writing a script that makes stage4 archive every week or so, and then transfers it to ftp-server. I also am planning on cloning the whole partition with a tool like dd or partimage, latter being a better (and more complicated) solution, because it does not backup the empty space on a partition. Current situation with my mirrored root drive gives some protection against a hardware malfunction, but offers only little against user mistakes.

So for the time being I am making stage4 archives from my root partition as backups and if you are using Gentoo, I advice you to do at least the same.

Installing HTPC software (part 1)

I'll start this one of with a quick and easy way to get samba file sharing working. If there are no interest in having such service, then you can skip over the Samba part. After the Samba installation I will install software that is needed for the HTPC functionality.

But first, here is a make.conf file that I am using. You may want to edit it to better suit your needs. It has basicly USE-flags enabled that "sound" like they might be useful in HTPC installation.


Samba
Before emerging samba, there is again a file in need of an extra line. This time easiest way to add it, is by running following command

echo "net-fs/samba acl -cups -doc -kerberos -ldap -oav pam -python -quotas readline -selinux winbind" >> /etc/portage/package.use

This will ensure samba will be emerged for just basic file sharing, with nothing too fancy like cups or ldap. Modify as needed. After the above line is added, just emerge samba. After all that is done, it is time to edit /etc/samba/smb.conf to suit your file sharing needs.

Here is a little example of how my smb.conf looks like

[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
write list = root

[global]
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = Yes
domain master = Yes
local master = Yes
os level = 65
preferred master = Yes
security = user
workgroup = Workgroup Name
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
netbios name = Server name
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes

[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700

[yoursharehere]
comment =
Yoursharehere is a shared directory
inherit acls = No
path = /
path2yoursharehere
read only = No
browseable = Yes
writable = Yes
force user = yourusername


After the smb.conf is set up correctly, only thing left is to add samba users and their passwords. I use the following command to create first the user, then adding samba password to that user. Note that the username password should be preferable the same ones you use in your clients. That way a windows user can mount the share as a network drive by just using his own username and password. After adding the users, you are ready to start the samba service and add it to some runlevel, so it will start automatically on boot.

useradd
yourusername && smbpasswd -a yourusername


Enabling the Gentoo Portage Multimedia Overlay
Multimedia overlay is used to get the latest (and greatest) svn/cvs -versions of the multimedia programs like mplayer, which is used as the default video player in MMS. The reason we need the latest version is that it has multi-thread support enabled. This helps a lot when playing content that is encoded with H.264 with high definition resolutions. Playing 1080p material with h.264 encoding used to be pretty impossible with modest 3ghz dual core like mine. Nowadays with multithreading, it handles it pretty nicely.

This is how the overlay is enabled

mkdir /usr/local/portage
cd /usr/local/portage
rsync -rptvW rsync://kpex.no-ip.org/kpex-media
echo "PORTDIR_OVERLAY=\"/usr/local/portage\"" >> /etc/make.conf


HTPC software
Xineliboutput is a plugin to VDR, it is used to output the DVB-material via graphics card, either in X (vdr-sxfe) or in frame buffer (vdr-fbfe). Normal use case with VDR is that user has full feature DVB-tuner which has some kind of TV-out, but with high resolution flat panels this is hardly optimal. Instead we are going to use the DVI output on the graphics card to transfer the picture in HD resolution to TV´s HDMI input. Xineliboutput enables us to do just that. The plugin itself is loaded when VDR starts and the client (vdr-sxfe) is started whenever we select "Watch TV" from MMS main menu. And finally to the point: Xineliboutput requires xine-lib to be installed.


Besides xine library and mplayer we also need some codecs. W32codecs contains Microsofts decoders for codecs used in wmv-container (for example). We also should install x264-svn package. And lastly you can install MMS right here, without any extra steps, IF you are content (and smart) to use the stable version. I however, am going to go the extra mile and try out the new release candidate 1.1.0 version.

All of the above are installed by simply (mmsv2 installs at the time of this writing the stable 1.0.8.5 version of the MMS) emerging the following

emerge xine-lib mplayer win32codecs x264-svn mmsv2


Disclaimer: While the Xineliboutput enables showing the DVB material in high resolution X environment, it does not actually do anything to make the picture better. You are still faced with the limitations of the source material, which is often low resolution and encoded with low bitrate. The upside is though that the DVB viewing with VDR can now be integrated as part of the X (the graphical interface) and more importantly part of the MMS.

maanantai 28. tammikuuta 2008

Getting the hardware to work

Fortunately one thing I was able to rescue from earlier, corrupted, installation is the kernel config. So I don't need to spend much time with kernel configuration. I however decided to go bleeding edge with the just released 2.6.24 kernel. Preserving the old configuration is pretty easy, just copy the old .config-file to the new kernel sources (/usr/src/linux) and run "make oldconfig" the command asks user to answer few questions and voilá, kernel configured.

Installing DVB drivers is also pretty easy and there are few different ways to do it. I used to install them just by using emerge, ie. "emerge mercurial && emerge v4l-dvb-hg" but currently there seems to be compilation problem. Because of the problem with emerge I had to install the drivers by hand. Here is a short overview of the process, the guide is for different tuner card than mine, but one can see the outline of the process easily enough. After dropping the firmware file to correct location (/lib/firmware) and rebooting, udev should load the modules for the card automatically. One can verify that the tuner is working by making sure there is device called /dev/dvb/adapter0 .

Lirc installation is also pretty straightforward, although it can also be problematic for the first timers. For emerge to work correctly a line needs to be added to /etc/make.conf, with my Silverstone (iMon) IR-receiver the line looks like this
LIRC_DEVICES="lirc_imon imon_pad2keys imon imon_pad imon_rsc"

After that "emerge lirc" and reboot the /dev/lirc device should be available. With serial port IR-receiver some tweaking with "setserial" command might be required. Correct lircd.conf is of course needed in /etc directory. For most remotes you don't need to look any further than here. I however made my own for the Harmony remote by using "irrecord" command. Testing that lirc is working command "irw" can be run, while running it should detect key presses from the remote.

If you want to use the remote that came with the case (the one with a "mouse pad" on it) you should have look at this page.

Once the lirc is working, emergin lcdprog makes the VFD available for using. Testing that it is working is easy, just "echo whatever > /dev/lcd0".


So what else is there?
  • Proprietary Nvidia graphics drivers can be installed by issuing "emerge x11-drivers/nvidia-drivers" command and then using "modprobe nvidia" to load the module, although I think udev also loads automatically after reboot. Remember to include the nvidia as a driver to your /etc/X11/xorg.conf if you are using X.
  • My integrated sound card is recognized automatically and my sound is working after "emerge alsa-utils" and setting the volume with "alsamixer", using "alsactl" one can store the volume settings as defaults.
  • Integrated network was correctly detected during install and if it is not and you can not get it to work by hand, installing Gentoo becomes pretty hard. Luckily ethernet works correctly at full gigabit speed.
  • Flat panel TV can sometimes be a real pain to get working correctly due to the TV itself giving wrong information about its capabilities. Example xorg.conf file for Mirai DTL-642E500 can be found here. I personally had some problems with finding correct settings and hopefully the linked file is useful to others.


Disclaimer: To get the devices to work, the kernel needs to be configured correctly. But that information is (mainly) available at Gentoo wiki, so there is no need for me to rewrite it all here. Check the Howto Index, Tips & Tricks and Hardware part of the wiki.

Basic Gentoo Installation

As I mentioned before, even the basic Gentoo installation can be a chore. But after installing Gentoo several times, I am starting to see the beauty behind it. Everything is done on command line but in a sense, I have full control of how my system is going to be. Nothing unnecessary gets installed or setup, which is great help when you´re trying to minimize the amount of software.
For example boot process slows considerably by adding more services,
so one should be aware what is actually needed and what can be left out. Also less software means less disk usage, less security issues and most importantly more performance.

Installation process is pretty easy if one follows the Gentoo Handbook and does not deviate much. I decided install to RAID1 array right away to steer clear of the pitfalls of doing it later.
Installation itself was pretty uneventful, but I would not recommend it to any one without proper Linux experience.

There are easier distros to install, or rather, almost all other distros are easier to install. One could go with Ubuntus minimal server installation and make a pretty decent HTPC. Not many however offer you so much control over your OS as Gentoo.


I decided to keep the partiotioning of the disks as simple as possible.
  • /dev/md0 10GB for / (root) partition
  • /dev/md1 290GB for /safe partition, this is used to store important data
  • /dev/md2 4GB for swap partition, yes I know that is pretty much, but I want to be able to Suspend my RAM to disk if need arises.
So far I've emerged (installed) the following additional software.
  • syslog-ng and logrotate
  • vixie-cron
  • grub
  • mdadm
  • xfsprogs (this is needed for my 500GB DVB Recording XFS partition)
  • alsautils

And I have enabled following additional services.
  • sshd
  • syslog
  • eth0
  • mdadm
  • syslog-ng
  • vixie-cron
  • alsasound

I am planning to start the not-critical services in their own runlevel or at least after the HTPC services that are needed to make the Media Center start as fast as possible. Currently the mentioned services still reside on default-runlevel.

Next time, installing Lirc remote control software, Mplayer video player, X the graphical server and Samba for network file sharing and maybe few others.