Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

More fortunes for Mint

If you like to see some funny quotes when opening a new shell terminal, you can enable the fortune-mint script that will be launched automatically.
By default, this script only shows non-offensive quotes and only three different types of animals: the moose, the tux and the koala.
But the cowsay package provides a whole bunch of pictures that can be used.
Cow files in /usr/share/cowsay/cows:
apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default
dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep
ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala
mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep
skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey
turtle tux unipony unipony-smaller vader vader-koala www

The following patch will enable all these that you have installed in your system, as well as all different eye and tongue styles. If you don't like offensive quotes, you'll have to take off the -a parameter from the fortune command in the last line of the patch below.

Install instructions

Paste the following into a textfile, for example mint-fortune.patch
4c4
<     RANGE=3
---
>     declare -a cows=( $(cowsay -l | grep -v "Cow files in") )
6,17c6,7
<     let "number %= $RANGE"
<     case $number in
<         0)
<             cow="moose"
<             ;;
<         1)
<             cow="tux"
<             ;;
<         2)
<             cow="koala"
<             ;; 
<     esac
---
>     let "number %= ${#cows[*]}"
>     cow=${cows[$number]}
19c9
<     RANGE=2
---
>     declare -a says=( say think )
21,30c11,19
<     let "number %= $RANGE"
<     case $number in
<         0)
<             command="/usr/games/cowsay"
<             ;;
<         1)
<             command="/usr/games/cowthink"
<             ;;
<     esac
<     /usr/games/fortune | $command -f $cow
---
>     let "number %= ${#says[*]}"
>     command="/usr/games/cow${says[$number]}"
> 
>     declare -a states=( "" -b -d -g -p -s -t -w -y )
>     number=$RANDOM
>     let "number %= ${#states[*]}"
>     state=${states[$number]}
> 
>     /usr/games/fortune -a | $command $state -f $cow

Then apply this patch to the original script (a backup will be created) and enable the fortune-teller:
sudo patch -b /usr/bin/mint-fortune mint-fortune.patch
gconftool-2 --set /desktop/linuxmint/terminal/show_fortunes true --type bool

Provide your own cows

You can create your own cow files, just have a look at the manual of the cowsay command. Or just copy the ones I prepared from here into any folder you want.
You could just copy them into the system folder /usr/share/cowsay/cows, but if you want to keep them separated, you can instruct cowsay to look for you ones too (for example in your folder ~/Documents/cows:
mycows=~/Documents/cows ; sudo sed -i.orig 's|/usr/bin/mint-fortune|export COWPATH=/usr/share/cowsay/cows:'$mycows'\n\0|' /etc/bash.bashrc

Example of a Star Wars scene as cow

 _____________
< Hello world >
 -------------
          \
           \                .==.
            \              ()oo()-.
             \  .---.       ;--; /
              .'_:___". _..'.  __'.
              |__ --==|'-''' \'...;
              [  ]  :[|       |---\
              |__| I=[|     .'    '.
              / / ____|     :       '._
             |-/.____.'      | :       :
            /___\ /___\      '-'._----' 

Install LibreOffice 3.5

The current version of LibreOffice which ships with Ubuntu Oneiric is 3.4.4.
Lately, I was getting very angry about this version, because it gave me constant trouble:
  • it looses somehow control about its lock-files, therefore I wasn't able to save my open files any longer, neither with the old nor with a new name
  • graphics in calc files suddenly jumped to another sheet when opening the files
I loved LibreOffice so far, but this behaviour really pi.... me of.
So the other day, I read about the new release 3.5, its new features and so I decided to update it by hand.

Below, you can find the update script that I programmed for that task.

After using it for some time, here I list the most interesting stuff about the new version.
  1. No problem with the lock-files any longer.
  2. Graphics stay in their sheets.
  3. Conditional formatting now lets you define more then three conditions, this was really necessary, I use that feature a lot. I'm just missing an easy way for reordering.
  4. Bigger text box for writing formulas.
  5. The import of Microsoft Visio files.
  6. The print preview of all pages.
  7. and lots more

Install instructions

Just save the following lines as InstallLibreOffice.sh and execute it with the -h parameter to see the usage text. You can also download it from here directly.
#! /bin/bash

#
## LibreOffice installation from Debian Packages from website
## @author Sven Rieke
# 

language=en-US
version="3.5.0"

function Usage() {
    cat <<EOF
Usage: ${0##*/} [-h] [-v] [-l lang-id] [p lang-id] [-d version-id] [-u]

  Options:
    -h             Show this help.
    -v             Be verbose about processing steps.
    -l lang-id     Set language for main installer and documentation (default = ${language})
    -p lang-id     Set language for interface translation (not installed by default)
    -d version-id  Specify another package version (default = ${version})
    -u             Start with a clean user-profile
 
EOF
}

function AndOut() {
    popd
    exit
}

trap AndOut ERR

########################################################################
# Interpretation and validation of command line parameters and options #
########################################################################

while getopts :hvl:d:u OPT; do
    case $OPT in
 h|+h) Usage ; exit 0     ;;
 v|+v) VERBOSE=true       ;;
 l|+l) language="$OPTARG" ;;
 p|+p) langpack="$OPTARG" ;;
 d|+d) version="$OPTARG"  ;;
 u|+u) NEWUSER=true       ;;
 *)    Usage
       exit 2
    esac
done

sudo -v

mkdir -p /tmp/LibO.3.5
pushd /tmp/LibO.3.5

#### Download from http://www.libreoffice.org/download/?type=deb-x86
[[ -v VERBOSE ]] && echo "---[ Installing LibreOffice ${version}-${language} ]" >&2
[[ -v VERBOSE ]] && echo "*** Downloading packages ***" >&2

for i in install helppack ; do
    package="LibO_3.5.0_Linux_x86_${i}-deb_${language}.tar.gz"

    if [ ! -f $package ]; then
 [[ -v VERBOSE ]] && echo "*** Downloading new package $package ***" >&2
 wget http://download.documentfoundation.org/libreoffice/stable/${version}/deb/x86/$package
    fi
done

if [ -v langpack ]; then
    package="LibO_3.5.0_Linux_x86_langpack-deb_${language}.tar.gz"
    if [ ! -f $package ]; then
 [[ -v VERBOSE ]] && echo "*** Downloading new package $package ***" >&2
 wget http://download.documentfoundation.org/libreoffice/stable/${version}/deb/x86/$package
    fi
fi

[[ -v VERBOSE ]] && echo "*** Decompressing downloaded archives ***" >&2
for t in LibO_3.5.0_*.tar.gz ; do tar xzf $t ; done

[[ -v VERBOSE ]] && echo "*** Removing old LibreOffice installation ***" >&2
sudo apt-get remove libreoffice-core

for d in $(find -maxdepth 1 -mindepth 1 -type d) ; do
    [[ -v VERBOSE ]] && echo "*** Install packages from $d ***" >&2    
    pushd $d/DEBS
    sudo dpkg -i *.deb

    if [ -d desktop-integration ]; then
 [[ -v VERBOSE ]] && echo "*** Install desktop integration ***" >&2
        cd desktop-integration
        sudo dpkg -i *.deb
        cd ..
    fi
    
    popd
done

if [ -v NEWUSER ]; then
    [[ -v VERBOSE ]] && echo "*** Remove old user profile ***" >&2
    mv ~/.config/libreoffice/3/user ~/.config/libreoffice/3/user_old
    [[ -v VERBOSE ]] && echo "*** Old one can be found in ~/.config/libreoffice/3/user_old ***" >&2
fi

AndOut

From repository

There also exists a repository which gets updated from time to time with the latest versions.
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get upgrade

Troubleshooting

In two installations I had trouble with my old user profile. LibreOffice claimed about templates already installed. Therefore, I added the -u switch to my install script which moves the whole user profile to a backup location, so LibreOffice will start with a new profile. Just copy your old templates to the new profile and reapply all your settings again.

Managing printers from CUPS web interface

Installed printers are listed here.
Recently, I had problems with my printer settings, I wanted to change the duplex setting and wanted to install a new network printer, but without success.
The problem I have is that in Linux Mint the Printers configuration applet fails, crashes and doesn't offer all options.

But finally I found a way. Linux Mint, like other distributions use the CUPS as printing system and it offers a web based administration interface.

Just point your web browser to http://localhost:631/. There you can add and manipulate all kind of printers and manage the print queues as well.

This is a nice workaround, until these options will be supported in the printer settings applet.

Flash Video in Linux and Webcam

You also experienced problems when trying to use a webcam from a flash application in your Firefox browser?
It claimed about not being able to detect the cam, whereas VLC finds and uses it perfectly.

Well, there's a known compatibility limitation between the underlying video-for-linux (v4l) layer.
Modern Linux systems use version 2, whereas the Flash applets seem to be comfortable only with version 1.

There's a possibility to force Firefox to use the version 1 of v4l, by launching it this way:
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so firefox &

Now the Flash applet should be able to detect and use your webcam.

More details can be found in this article I found.

Create a bootable Live USB drive with UNetbootin


UNetbootin is a cross-platform utility that can create Live USB systems and can load a variety of system utilities or install various Linux distributions and other operating systems without a CD.

Install instructions

sudo add-apt-repository ppa:gezakovacs/ppa
sudo aptitude update
sudo aptitude install unetbootin

Extract email attachments from winmail.dat files

tnef is a program for unpacking MIME attachments of type "application/ms-tnef". This is typically a Microsoft only attachment, named winmail.dat.
This program allows one to unpack the attachments which were encapsulated into the TNEF attachment, thus alleviating the need to use Microsoft Outlook to view the attachment.

Install instructions


sudo aptitude install tnef
or click here.

Usage


Save the winmail.dat file from the email and execute
tnef --list winmail.dat  # list containing files
tnef winmail.dat # unpack containing attachments

Video Edition for Linux

You have some nice vacation video in your Camcorder and want to edit it on your Linux system.
It seems, that Windows user are more luckily, lots of video edition software exists (for example ULead), but Linux users also can edit their videos with free software.

In this post, I'll comment about three applications, which are powerful and easy to use.

Kino


Kino
Kino is a non-linear digital video editor which supports many basic video editing and assembling tasks.
But its main feature is the import from raw AVI and DV files, as well as capture footage from digital camcorders using the raw1394 and dv1394 libraries, and export to camcorders using the ieee1394 or video1394 libraries.
During import, it detects scene changes (when you stopped grabbing) and can split the scenes into separate files.


For me, its the application which works best when passing my videos from the digital camera onto the hard drive, without frame dropping.

Install instructions


sudo aptitude install kino

or click here to install it from the browser.

Troubleshooting


A normal user doesn't have privileges to the RAW 1394 device, which is used to transfer data from the camcorder to the computer. You would have to launch Kino as superuser or execute the following commands:
sudo modprobe raw1394
sudo chmod a+rw /dev/raw1394


To make these changes permanent:
sudo echo "install raw1394 /sbin/modprobe --ignore-install raw1394 $CMDLINE_OPTS ; \
sleep 0.5 ; \
/bin/chmod a+rw /dev/raw1394" > /etc/modprobe.d/raw1394.modprobe


OpenShot



OpenShot is a video editor for GNU/Linux, being simple but yet powerful. It has all functionality one would need for day-to-day video cutting and assemblage.

Its interface supports themes, is very eye-candy and integrates well with Gnome.
You can see a list of features on its website.

Install instructions


sudo add-apt-repository ppa:jonoomph/openshot-edge
sudo apt-get update
sudo apt-get install openshot openshot-docs

or see instructions here if you don't use Ubuntu Karmic.

Kdenlive


Kdenlive
Kdenlive is an intuitive and powerful multi-track video editor, including most recent video technologies.
It has tons of video and audio effects and video snippets can be arranged visually on the several tracks.
The resulting video can also be exported to DV devices, or written to a DVD with chapters and a simple menu.

Where Kino's importing feature is more powerful, Kdenlive is so much better when editing and creating the "final cut".

Install instructions


sudo aptitude -y install kdenlive

or click here to install it from the browser.

DVD Authoring


You should install the following additional programs, so you can export the video from Kdenlive to a DVD folder which can be burned to DVD directly.
sudo aptitude install ffmpeg lame mjpegtools dvdauthor

Problems with Lightning on Ubuntu Jaunty


After putting on my fresh Ubuntu Jaunty installation, my favourite Email client Thunderbird, the Lightning extension (version 0.9), didn't worked at all.
I tried everything, reinstalling Thunderbird several times, disabling all other extensions, nothing.
Lightning painted some icons, but that was everything.
Some incompatibility. I installed SunBird 0.9, and it works fine. Earlier Lightning versions seemed to work also, so what is the matter?

Solution


Finally, I found the solution in some forum, you need to have libstdc++ version 5 on your system (Jaunty comes with version 6 by default). And it has to be there, when Lightning extension 0.9 is installed, so if you already have it in your Thunderbird setup, uninstall it first, then put libstc++5 on your system, and reinstall the Lightning extension.
sudo aptitude install libstdc++5
# or if you don't want to install more stuff:
ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.5

Firestarter


Firestarter is a firewall for Linux systems.
Linux isn't that vulnerable to Internet attacks than Windows (look here for a free firewall for Windows), but to have such a firewall has some advantages:
  • View active network connections, including any traffic routed through the firewall.
  • Ability to share the firewall host's Internet connection among all the computers on your local network. This is done through a technique called Network Address Translation, or NAT.
  • Option to whitelist or blacklist traffic.
  • Sets up DHCP for a local network.


On Ubuntu it can be installed right from the Applications menu.

Migration to Ubuntu

I found this really interesting article about the experience of migrating a whole company to Ubuntu Linux.
If you need to convince your own boss to use Ubuntu in your department, just send him this link and maybe he'll help you:

Articulo original en Español.
Translated article to English

Wine

Wine is as a compatibility layer for running Windows programs on Linux.

Wine does not require Microsoft Windows, as it is a completely free alternative implementation of the Windows API consisting of 100% non-Microsoft code, however Wine can optionally use native Windows DLLs if they are available. Wine is a program loader, allowing many unmodified Windows programs to run on x86-based Unix.

Utilities for Wine


Wine-doors



Wine-doors is an application designed to make installing Windows software into Wine much easier. It is essentially a package management tool for Windows software on Linux systems, like Synaptic for Ubuntu.

winetricks


winetricks is a script to download and install various redistributable runtime libraries into your Wine setup to be able to run certain applications.

Tips & Tricks


By default, Wine uses Windows colour scheme for the applications GUIs.
But this doesn't fit very well with Ubuntus colours.

Wine-doors already gives you the possibility to install a set of colors that fit well with Ubuntus desktop look, but In the Ubuntu forums, there's a good guide about how to change the colour scheme by hand.

AcetoneISO

AcetoneISO2, is a feature-rich and complete software application to manage CD/DVD images. Thanks to powerful open source tools such as fuseiso, AcetoneISO2 will let you mount typical proprietary images formats of the Windows world such as ISO BIN NRG MDF IMG and do plenty of other things. Everything will be done inside a handy GUI.

It's installation is a bit tricky, so you can go and see my install instructions for Ubuntu.

GRUB for DOS

GRUB4DOS is an universal boot loader based on GNU GRUB, it's the DOS extension of GRUB.
It enables dos users to run the configuration console directly in real mode.
It can boot off DOS/LINUX, or via Windows boot manager/syslinux/lilo, or from MBR/CD.
It also has builtin BIOS disk emulation, ATAPI CDROM driver, etc.

It's much more powerful than Linux Grub and you should read its tutorial here to learn about all its options.
It's impressive.

The project also contains an utility called WINGRUB, an GUI intends to help configuring and installing GRUB in the WINDOWS environment.
This is very useful whenever your Windows destroys GRUBs MBR and you don't want to restart your system from a Linux LiveCD for recovering. With WinGrub you can do this directly from Windows.

Remote Desktops

UltraVNC is a powerful, easy to use and free software that can display the screen of another computer (via internet or network) on your own screen. The program allows you to use your mouse and keyboard to control the other PC remotely. It means that you can work on a remote computer, as if you were sitting in front of it, right from your current location.

UltraVNC runs under Windows operating systems (95, 98, Me, NT4, 2000, XP, 2003...). Its embedded Java Viewer allows you to connect (and make File transfers) from a simple Web Browser on any Operating system supporting Java (Linux, Mac OS...) to an UltraVNC server.

You can connect directly from your Ubuntu desktop with tsclient (Applications --> Internet --> Terminal Server Client).
Previously, you have to ensure you have the VNC Client installed as well:
sudo apt-get install vnc-viewer

Then you can select VNC as connection protocol to connect to your Windows box from Linux.

Tip: Use the special F8 key


Most of the VNC clients have a special mapping for the F8 key. A menu will open and you can
  • send the F8 key to the remote desktop
  • send Ctlr-Alt-Del to the remote desktop
  • change the preferences of the VNC client
  • and other stuff depending on the client

More languages in Evolution

Evolution provides integrated mail, addressbook and calendaring functionality to users of the GNOME desktop.

Advantages


For me, there's only one reason I would use Evolution instead of Thunderbird:
  • Evolution can use Outlook Exchange accounts (like the one I have to use in the office).


Disadvantages



  • It is only for Linux systems.
  • Insufficient edition possibilities when composing messages (no lists, no embedded images, ...)
  • Simple filters didn't worked for me.
  • Evolution can't be deinstalled from Ubuntu, because it is somehow linked to several applications, so uninstalling Evolution forces you to uninstall applications like Nautilus.
    This reminds me on IExplorer on Windows.


Tips & Tricks


More languages


By default, Evolution comes only with your systems language.
If you need more languages for spell checking, you have to install the corresponding aspell packages, for example:
sudo apt-get install aspell-de

Restart Evolution, and select the new languages for spell checking.

View Office documents

There's OpenOffice so why should I bother to install the Microsoft Office Suite?
  1. Some MS Office documents aren't displayed right with OpenOffice. There are few ones, but it still happens.
  2. Documents with Macros often aren't handled.
  3. You just don't want to start OpenOffice to see a PowerPoint that a friend has send you via email, because it isn't immediately.
Okay, these are some reasons, but I still don't want to install this huge Suite or I'm using Linux so this is no choice.

You don't have to.
There exist free tools from Microsoft which can display Word, Excel and Powerpoint documents, without having installed the Office Suite.
Moreover, they work perfectly with Wine on Linux.

They are simple Viewers, you can't edit the documents, but printing works as well.

You can find them here:

DVD Authoring

Q-DVDAuthor is a GUI frontend for dvdauthor and other related tools.
The goal is to provide an easy-to-use, yet powerful and complete interface to generate DVD menus, slideshows, and videos to burn on a DVD.

Installation on Ubuntu


You can install it from the Application menu. But I recommend to install it from the command line, so some optional tools used will be installed as well.
sudo apt-get install qdvdauthor transcode toolame dvdrtools


Visit also


Check out the applications web page for some menu templates and user guides.

Mount .ISO image as CD/DVD drive

On Ubuntu or any other Linux


There's a console way or a GUI way.

Mount by hand


sudo mount -o loop -t iso9660 my.iso /mymountpoint


GUI way


The best tool is AcetoneISO, supporting almost all kind of disc images. Read more about this tool in this separate post.

Add Gmount-iso from the application menu or install it by issuing
sudo apt-get install gmountiso
.

Just select the .iso image you want to mount, select a folder where it should be available and that's it.
Unfortunately, it seems to support only .iso images.

If you need to create .iso files, look at this post.

Integration into Nautilus


Some people have created scripts that can be launched directly from Nautilus on the .iso file. You can also look here for instructions with screenshots.

On Windows


Several applications exists, all supporting several other image formats apart from .iso

Virtual CDRom Control


From Microsoft there is a very small tool (~ 60kb) which can mount .iso and some other formats.
Read the Readme.txt about it's install and usage instructions.

Daemon Tools


DAEMON Tools is an advanced application for Microsoft Windows which provides THE best optical media emulation in the industry.
It supports the biggest amount of protection modes and image formats.
But it's uninstallation was quite bad some time ago, not sure if it is better nowadays.

Alcohol 120%


Alcohol 120% can also create several virtual drives and permits to mount images directly from the right mouse menu.
But it's main purpose is burning images to CD/DVD, supporting several protection modes either.
I recommend this tool, but it's not freeware.

File Synchronization

Unison is a file-synchronization tool for Unix and Windows. It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.


Unison shares a number of features with tools such as configuration management packages (CVS, PRCS, Subversion, BitKeeper, etc.), distributed filesystems (Coda, etc.), uni-directional mirroring utilities (rsync, etc.), and other synchronizers (Intellisync, Reconcile, etc).

Other applications


Linux


rsync is an open source utility that provides fast incremental file transfer.
In Ubuntu you can install from the application menu Grsync, a simple graphical interface for rsync.

Windows


SyncToy is a free PowerToy designed by Microsoft that provides an easy to use graphical user interface that can automate synchronizing files and folders. It is written using Microsoft's .NET framework.

GUI for the alternativates system

Galternatives is a GUI to help the system administrator to choose what program should provide a given service.

It updates the /etc/alternatives links, which defines default applications for the traditional Unix/Linux system, for example which java virtual machine should be used in case there are several versions installed on the system, which webbrowser will be launched etc.



Basically, it is a graphical front-end to the update-alternatives command-line tool.

Install on Ubuntu


sudo aptitude install galternatives


Finally, we could create a launcher in our main menu (System-->Preferences-->Main Menu):