Local

..:: Home
..:: Legal
..:: Contact
..:: About
..:: RSS
..:: Log in

Links

..:: Fake Bill Gates
..:: Tap the Hive

A Random Quote

"Quidquid latine dictum sit, altum sonatur." -- Whatever is said in Latin sounds profound.

Archive for the ‘Ubuntu’ Category

How To: Ubuntu and Your Digital Camera

Wednesday, January 3rd, 2007

Linux is not hard. In fact, your digital camera is probably supported in Ubuntu, but you probably don’t know how to access it. We’re going to use a pretty program called “digikam”.

..:: Software Summary

Title: digikam
Type: desktop application
Purpose: manage digital cameras
Tested OS: Ubuntu 6.10
Screenshots: via [ google | digikam home ]

..:: Installation and Setup

Installation takes a second. First, make sure you’re using some decent ubuntu repositories. Then install digikam:

sudo apt-get install digikam

When it’s done installing, you’re going to have to run this app as root (I haven’t figured out how to fix all the mounting issues).

gksudo digikam

Plug your camera in via USB and turn it on (unless it doesn’t normally need to be on to sync). When digikam loads, it will ask you where you want to store your images. I personally use /mnt/storage/pictures (don’t ask why, that’s for another article), but you might want to put it in /home/your_username/pictures.

Then click “Camera->Add Camera”. You might be able to auto-detect the camera by clicking “Auto-detect”. My old Canon PowerShot SD110 Digital Elph came up instantly (it’s a decent camera for being about 3 years old). If it doesn’t auto-detect, click add and then find your camera in the list (which is insanely long). Once you’ve finished, hit OK until you get back to the main window.

..:: Main Usage

Now click “Camera->Your_Camera” and it will bring up another window. I select “Download All”, and it will ask what album to put it in and I give a decent name for my purposes. After downloading all, I “Delete All”. You can manage the photos immediately (rotate/crop) by clicking on them and using the micro-editor.

Once you’re done, you can close up, and the next time, you’ll just have to run

gksudo digikam

and you’ll be able to immediately import your photos without having to do any setup.

How To: Ubuntu Edgy and Mythtv

Tuesday, December 12th, 2006

The purpose of this install guide is to install MythTV on Ubuntu Edgy, using a Hauppauge PVR-150. Some linked docs here may help you, but this guide is to achieve that purpose with minimal work. Most of the other Edgy tutorials leave off a significant amount of information, and are specifically only usable with cards compatible with DVB (for the nova-T line of cards), but the Hauppauge PVR-xxx line is not compatible at the moment. This is not for the Feint of Mind ™, so your grandma will probably have some difficulty in this. You should have a medium amount of Linux experience before trying this, but do not fret. Excluding Edgy’s install time, I can run through this entire install in about 20 minutes.

PLEASE, READ everything in a section when doing it. SKIMMING will often leave you wondering what is going on, and you’ll learn nothing (which is neither the goal of this guide, nor open source). I also get a bunch of emails from people who missed a key detail simply because they didn’t read. And definitely, COPY and PASTE text from your browser window to your terminal, or you will get typos.

..:: Background

MythTV is Tivo and Windows Media Center on steroids. The most notable features include

  • a TV recorder
  • an optional web based recording manager (that is awesome)
  • automatic commercial skipping for recorded TV
  • no playback restrictions (WinMCE disables playback for what content creators deem is “premium” content after 3 days)
  • no monthly fees
  • allows easy expansion (just add network storage or another internal hard drive)
  • a music manager
  • a DVD player
  • a video file player (that plays every non-DRM’d codec you’ve ever seen)

I love MythTV. Once you have a DVR, regular television is unwatchable. Annoying commercials (that raise the volume 30-50%) are no longer an issue. Rewinding, pausing, and fast forwarding regular TV is spectacular.

..:: My Experiences

This is a little bit of my experience with Ubuntu and MythTV. If you don’t care about this (and most of you shouldn’t as it’s merely my professional opinion on the version changes), just skip to the next section. Basically, I started using Mythtv .18 on Ubuntu 5.10. The only cards I have any experience with are the PVR-150 and the PVR-500. I set the 150 up for myself and the 500 for my older brother. They’re nearly the same install method. I used the hyams MythTV method for Breezy, but when Dapper (6.06) came out, I tried that out, and there were issues with Ubuntu using an upgraded version of MySQL. I knew that it would take less time for me to reinstall on Breezy than it would to fix the Dapper issues. So I went back to Breezy. After a bit, I got tired of playing World of Warcraft on my laptop (5 fps or less is horrendous) so I took down my MythTV box to use it as a WoW box. I’m now ditching WoW to pull up MythTV (that’s my only acceptably fast computer). I downloaded Ubuntu Edgy (6.10), and the MythTV install is amazingly easier than it used to be. I don’t know whether I’m just so familiar with the install, or that it’s just gotten to be so easy. Anyways, here goes.

..:: Install MythTV Backend and Frontend

Get Ubuntu 6.10 and then install it. You can use the default installation parameters if you want. I typically do. Once up and running in the installed version (not the live version), open a terminal and type

sudo su

Enter your password (and hit enter). This will basically log you in as root without permanently destroying your Ubuntu sudo model. Backup your /etc/apt/sources.list:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.default

Then modify your /etc/apt/sources.list file to include these:

deb http://archive.ubuntu.com/ubuntu/ edgy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ edgy-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ edgy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse

Then type:

apt-get update
apt-get upgrade

After that finishes, type

apt-get install mplayer phpmyadmin apache2 php5 mysql-server libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql gstreamer0.10-ffmpeg gstreamer0.10-gl gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libxine-extracodecs

Once apache, php, mysql, and phpmyadmin have finished installing, go to http://localhost/phpmyadmin and set a root password for MySQL. Do NOT use tilda (a special terminal app) for this next step, because folding up really borks this next installation. The myth installer uses a console GUI to request a few things, and folded tilda doesn’t handle it well (you’ll have to dpkg-reconfigure a few apps if you do). If you don’t know what tilda is, you’re not using it, so don’t worry about it.

The next section is installing mythtv itself. You can’t combine this and the previous line, because you have to have mysql-server installed before mythtv installs. Now, type

apt-get install mythtv-frontend mythtv-backend mythtv-database mythvideo mythweather mythweb mythmusic mythplugins

During this install, MythTV will ask for your MySQL root password. You’ll also need to run the following line, but it often encounters errors because of server issues so keep trying until it succeeds:

apt-get install msttcorefonts

During the install, go to zap2it and register for an account to get free TV listings. For the Certificate Code, use the MythTV project code: ZIYN-DQZO-SBUT. Take note of your account username and password, because you’ll have to put it into MythTV in a few minutes.

..:: Install IVTV module

The next step is going to be to install the IVTV module used for the Hauppauge PVR-xxx video capture cards . I use the PVR-150, but the 500 works well too. If you’re not using this series, check here for your hardware. If you’re using the PVR-xxx series, continue with my instructions. Type:

apt-get install ivtv-source devscripts ivtv-utils

Get, build, and install the IVTV driver:

cd
wget ftp://ftp.shspvr.com/download/wintv-pvr_250-350/inf/pvr_1.18.21.22254_inf.zip
export DEBFULLNAME="Mario Limonciello"
export DEBEMAIL="superm1@ubuntu.com"
ivtv-make-fwpkg pvr_1.18.21.22254_inf.zip
dpkg -i ivtv*firmware*deb

Get the PVR-150 and 500 firmware addition:

wget http://home.eng.iastate.edu/~superm1/contrib/firmware/v4l-cx25840.fw -O /lib/firmware/v4l-cx25840.fw

The next few instructions must be run one at a time:

m-a update,prepare
m-a a-i ivtv
depmod -a
modprobe ivtv

If there are no errors, then you’re good so far, and you should test IVTV by typing:

mplayer /dev/video0

If you get video, that’s fantastic. Otherwise, I don’t know what you did wrong, because this worked the first time for me.

..:: Startup: Set MythTV as the default user to login

edit /etc/gdm/gdm.conf. find these two lines:

AutomaticLoginEnable=false
AutomaticLogin=

and change them to

AutomaticLoginEnable=true
AutomaticLogin=mythtv

..:: Set Up Your Card and Get Your First Set of Listings

All that is really remaining is to configure your capture card, but you should do this as the MythTV user. The MythTV install will create the user, but you will need to set the MythTV user password:

passwd mythtv

Then log out, and when you log back in as MythTV, type:

mythtv-setup

I’m assuming you’re using an NTSC television (in the US), so you can ignore the first bubble. Go to “2. Capture Cards” and select “New Capture Card”. Enter the following settings:

Card type: MPEG-2 Encoder card (PVR-250, PVR 350)
Video device: /dev/video0
Default input: Tuner0

Then go to “3. Video Sources” and select “New Video Source”. Enter the following settings:

Video source name: PVR-150-1
XMLTV listings grabber: NorthAmerica (DataDirect)
User ID: your_zap2it_username
Password: your_zap2it_password

Hit “Retrieve Line-ups” and wait a second. Exit that section and then select “4. Inputs”, and enter this setting:

Video Source: PVR-150-1

Finally, fill your database full of listings:

mythfilldatabase

..:: Startup: Set mythbackend and mythfrontend to run on boot

The default init.d startup script is broken (or at least was for me on both breezy and edgy), so I’m currently using hyam’s backend script. I give full credit for this script to hyam. You can get this script by typing:

wget http://s91928265.onlinehome.us/hfamily/mythtv/mythtv-backend -O /etc/init.d/mythtv-backend

Then restart the myth-backend daemon.

/etc/init.d/mythtv-backend start

On the gnome start menu, go to System->Preferences->Sessions and on the Startup Programs tab, add “mythfrontend” without the quotes. Finally, run the client, and explore the menus:
mythfrontend

..:: Disable the Screensaver

Since you don’t want the screensaver popping up while you’re watching a movie, go to System->Preferences->Screensaver, and disable the screen saver. In the “Advanced” tab, turn off power management.

..:: Option: MythCenter Theme

I personally like the MythCenter theme. To get it type:

wget http://mythtv.fotoniq.nl/files/MythCenter.tar.gz
tar -xzvf MythCenter.tar.gz --directory=/usr/share/mythtv/themes/

It should appear in the Appearances configuration menu when you’re running mythfrontend.

..:: Option: Enable Your Remote

Some Hauppauge packages come with the grey remote. Mine did, and installation is incredibly simple, but I have not made any customizations to it. I actually use my universal remote, and had it just memorize the hauppauge functions. To install the daemon, check the MythTV LIRC on Ubuntu Edgy How-to.

..:: Option: MPD to Control Music

I personally dislike the mythmusic frontend. I think using a remote for playlist manipulation (instead of a mouse) is silly, and way too time consuming. Also, I almost always have my laptop around, so the MPD project seems perfect for the job. Check my MPD MythTV How-To on how to get it installed in Ubuntu Edgy.

..:: Troubleshooting: Static Past Channel X

Many people have reported this error, and I’ve even received it myself. Basically, I’ll be able to view up through channel 13 or 14, and then everything else after is just static. The solution is to go back into myth-setup and make sure that the tuner is set to “us-cable”. You may or may not have to deal with this depending on your cable provider and how Zap2it handles your listing.

..:: Troubleshooting: Changing Channels Doesn’t Actually Change the Channel

The symptom of this is that regardless of what channel you select (using up, down, or typing in a number), the video source doesn’t actually change, but the OSD will. Re-run mythtv-setup as root and delete your cards/tuners. Then exit, and re-run mythtv-setup and add your tuner/card(s) as the mythtv user.

..:: Credits

https://wiki.ubuntu.com/Install_IVTV_Edgy
https://help.ubuntu.com/community/MythTV_Edgy_Backend_Frontend

Linux Tutorial

Sunday, November 5th, 2006

This was previously a consolidation of many guides on the web including some stuff from ubuntuguide. Ubuntuguide is now a wiki, so for basic ubuntu tricks, head to there. This is now a haven for intermediate to advanced linux tutorials, although they generally favor ubuntu. Info here is licensed under the GNU GPL, the GNU FDL, and Attribution-ShareAlike 2.0 where applicable.

..:: DISCLAIMER & WARNING

  • This information is provided without any implied or expressed promises or warranty (without even the implied warranty of merchantibility or fitness for a particular purpose)
  • Some commands here may break your system
  • Some commands here may violate your country’s laws or company policy. For instance, your country may have laws that prohibit encryption usage (which is used by SSH/putty). It is your responsibility to be aware and abide by your country’s laws.
  • By using, referring to, or even acknowledging existence of this guide, you agree to hold yourself exclusively responsible for your actions, and any damages which may arise in relation to using or even not using this guide and any software mentioned here.
  • In other words IF SOMETHING BAD HAPPENS BECAUSE YOU USE THIS, IT’S YOUR FAULT, NOT MINE.

..:: Mount an iso file

mount -o loop -t iso9660 file.iso /mnt/test

..:: Mount a fat(32) partition

sudo mount /dev/your_fat_partition /media/where_you_want_to_mount -t vfat -o iocharset=utf8,umask=0000

..:: General SSH usage (adminstration and file transfer)

  • SSH is a remote terminal. To connect to a computer running the ssh server type any one of these lines
    ssh your_username@server_hostname
    ssh your_username@server_ip
    ssh server_hostname -l your_username
    ssh server_ip -l your_username
  • For example, my username is djlosch, and i want to connect to a box that i know as foo.djlosch.com and also 127.0.0.2. I can use any of these commands to connect to it.
    ssh djlosch@foo.djlosch.com
    ssh djlosch@127.0.0.2
    ssh foo.djlosch.com -l djlosch
    ssh 127.0.0.2 -l djlosch
  • In addition to providing complete terminal functionality, you can also transfer files between the remote machine and your current machine. To do retrieve a file from the remote computer use:
    scp -r username@192.168.0.1:/home/username/remotefile.txt .
  • To send a file to the remote machine use:
    scp -r localfile.txt username@192.168.0.1:/home/username/

..:: Use ssh from a Windows computer [windows]

  1. To use SSH terminal from a windows machine, you will need putty:
    1. right click this file and choose save as: http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
    2. save it wherever you like to save your programs.
    3. type in the hostname or ip of the computer you want to connect to in the “Host Name (or IP address)” box
    4. click the SSH radio button in the “Protocol” selection.
    5. click “Open” at the bottom of the window
  2. To use SSH file transfer from a windows machine, you will need winscp:
    1. download winscp from here: http://prdownloads.sourceforge.net/winscp/winscp376.exe?download
    2. save it wherever you like to save your programs.
    3. click “New” and then type in the hostname or ip of the computer you want to connect to in the “Host Name (or IP address)” box
    4. type your username in the “User name” box, and verify that the “Port number” is set to 22.
    5. click “Login” at the bottom of the window

..:: Create a command to control your PCM volume

  1. type
    sudo wget http://www.djlosch.com/source/volmute -O /usr/bin/volmute
  2. example usage
    volmute increase #increase PCM volume
    volmute decrease #increase PCM volume
    volmute mute #mute PCM volume
    volmute unmute #unmute PCM volume
    volmute toggle #toggle muting of PCM volume
  3. use this in conjunction with your multimedia key listener daemon, or a voice control daemon to easily control your PCM volume

..:: Use gaim to connect to Gmail IM

In gaim click Tools > Accounts > Add
Use these settings:

Protocol: Jabber
Screen Name: Your_gmail_screen_name
Server: gmail.com
Resource: Gaim
Password: Your_gmail_password
Use TLS if available: checked
Force old SSL: unchecked
Allow plaintext auth over encrypted streams: unchecked
Port: 5222
Connect Server: talk.google.com
Proxy Type: Use Global Proxy Settings (unless you specifically need to change this)

Alias, Remember Password, and Auto-Login are up to you.

..:: Install a desktop session recorder that supports Beryl/Compiz, AIGLX, XGL (recordmydesktop)

  1. type
    cd
    sudo wget http://www.djlosch.com/source/gtk-recordmydesktop_0.3-1_i386.deb
    sudo wget http://www.djlosch.com/source/recordmydesktop_0.3.0-1_i386.deb
    dkpg -i recordmydesktop_0.3.0-1_i386.deb
    dkpg -i gtk-recordmydesktop_0.3-1_i386.deb
  2. run it by typing
    gtk-recordmydesktop

..:: Enable voice command and control (cvoicecontrol)

  1. type
    wget http://www.kiecza.net/daniel/linux/cvoicecontrol_0.9alpha-1_i386.deb
    sudo apt-get install libncurses
    sudo dpkg -i cvoicecontrol_0.9alpha-1_i386.deb
  2. configure your microphone by typing
    TERM=vt100
    microphone_config
  3. add commands to your voice model by typing
    model_editor
  4. run the speech listener daemon using your voice model file by typing
    cvoicecontrol your_voice_model_file

..:: Install a BitTorrent client (azureus)

  1. Azureus has been added to the extended repositories so you can now get it in apt.
    sudo apt-get install azureus

..:: Install and configure network file server (samba)

  1. type
    sudo apt-get install samba
    sudo nano /etc/samba/smb.conf
  2. edit the open file as necessary. here is an example
    [global]
    workgroup = your_workgroup
    encrypt passwords = yes
    password level = 20
    map to guest = bad user
    socket options = SO_KEEPALIVE IPTOS_LOWDELAY TCP_NODELAY
    security = user
    server string = Samba on %h
    wins support = no
    
    [homes]
    comment = Home Directories allowing R/W access to owner
    valid users = %S
    browseable = no
    read only = No
    create mask = 0640
    directory mask = 0750
    guest ok = no
    
    [archive]
    comment = Archive allowing Read Only access for all
    path = /some/path/to/folder/for/sharing
    public = yes
    writeable = no
    
    [free_serve]
    comment = Archive allowing R/W access for all
    path = /some/path/to/folder/for/sharing
    read only = No
    force user = the_username_you_want_to_own_the_file
    force group = the_groupname_you_want_to_own_the_file
    guest ok = Yes

..:: Enable encryption (SSL) for apache by creating a self signed certificate

  1. type
    sudo apt-get install apache2
    sudo cp /etc/apache2/sites-available/default /etc/apache2/default.default
    sudo /usr/sbin/apache2-ssl-certificate -days 365
    sudo apache2-ssl-certificate
    sudo a2enmod ssl
    cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
    ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl
  2. now you need to determine where you want to put your files that will be served using ssl encryption. I put mine in /var/www-ssl/ and will use this as my example. type
    sudo mkdir /var/www-ssl
  3. now comes the trickier part. make these changes to your /etc/apache2/sites-available/default (How to edit using nano). Note that if you paste, the < and > may translate to periods, so change them back to brackets.
    NameVirtualHost *:80
    <VirtualHost *:80>
    DocumentRoot /var/www
  4. make these changes to your /etc/apache2/sites-available/ssl
    NameVirtualHost *:443
    <VirtualHost *:443>
    DocumentRoot /var/www-ssl
  5. add this to your /etc/apache2/ports.conf
    Listen 443
  6. add these to your /etc/apache2/sites-available/ssl after the part that says “Possible values include: debug, info, notice, warn, error, crit…”
    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/apache.pem
  7. type at the terminal again
    sudo /etc/init.d/apache2 restart

..:: Install E17 (enlightenment) in Ubuntu

  1. add the respective repository to /etc/apt/sources.list for your release.
    deb http://edevelop.org/pkg-e/ubuntu edgy e17
    deb-src http://edevelop.org/pkg-e/ubuntu edgy e17
  2. replace ‘edgy’ with the version name of ubuntu you’re using (dapper, feisty, gutsy, hardy, etc). then type
    sudo wget "http://lut1n.ifrance.com/repo_key.asc" -O /root/key.asc
    sudo apt-key add /root/key.asc
    sudo apt-get update
    sudo apt-get install enlightenment
  3. logout of gnome (or kde). At the GDM login menu, select your session as enlightenment, login, and explore.

..:: Disable Enlightenment’s desktop scrolling

enlightenment_remote -edge-flip-set 1

..:: Run amarok in E17

For some people, running amarok reveals the splash screen and then nada. Left click the desktop and open Lost Windows. Amarok should be there. Clicking Amarok will open a small tiny window that you can double click on to fullscreen amarok.

..:: Stop E17 from eating windows (like gaim, amarok, azureus)

E17 is set up to retake your close button. A lot of apps have changed the close button to instead minimize the app, and a lot of apps have changed the minimize button to minimize to tray. Open the settings for any app that E17 is eating windows for and disable the minimize to tray, and minimize on close functions. The applications will now minimize correctly.

..:: Enable multimedia keys (xev, xmodmap, and erme)

  1. type
    wget http://www.c7obs.net/~adi/projects/perl/erme.current
    chmod 700 erme.current
    ./erme.current &
    xev
  2. Click the window that xev pops up. Press your multimedia key to see what keycode the key has. Then make a file with keycodes corresponding to XFree named keys. This is mine for my Logitech RF Wireless iTouch that i save in ~/iTouch.conf. I have kept this tip up for archival purposes only. the iTouch has been supported out of the box since somewhere between breezy and gutsy
    keycode 144 = XF86AudioPrev
    keycode 153 = XF86AudioNext
    keycode 129 = XF86Music
    keycode 174 = XF86AudioLowerVolume
    keycode 176 = XF86AudioRaiseVolume
    keycode 160 = XF86AudioMute
    keycode 162 = XF86AudioPlay
    keycode 164 = XF86AudioStop
  3. Save this as your_keyboard.conf and type
    xmodmap whatever_you_saved_your_conf_file_as.conf
  4. I have my music control buttons set as globals in amarok, but volume will need to be set using the PCM volume script. In Erme, add a key. Set the action to ‘exec’, set the key to the name you assigned the keycode in your conf file. Then set the parameters to the function you want to assign it to. For example, my mute button is assigned as such:
    key = XF86AudioMute
    action = exec
    parameters = volmute toggle

..:: Credits