Figlet: Show text in ascii art

January 17, 2011 at 2:06 pm (console based, linux apps) (, , , , )

Mmmmm…….. it’s me after a long time writing on this blog. I’ve almost forgotten that there was a blog of mine just waiting to be refreshed by it’s author. Within the last year i changed my PC and the operating system twice, and now using the Fedora 14 x86/64 edition. So I guess we should start from some ascii arts on the terminal to show up whenever it’s started. This type art is familar to the Linux Mint users who will see an animal saying something in ascii art upon start of each terminal. However, it requires use of multiple commands. This post is part one.

Figlet – print a text as a logo http://www.figlet.org

Happy new year on figlet version 2.22

How to install – figlet is not provided with most of the Linux distributions, and it’s not included in their package hosting servers. Hence using yum or apt-get simply may not work. If that’s the case, we need to compile it from the source. You can download the source from here. Decompress it and change in to it’s directory in the terminal and type;

make

to compile figlet. For further information on compiling from source, see my article. Unfortunately, there’s no make install here so we need to change in to figlet directory always to use the command (you can copy the binaries and man pages in to correct directories but this is complex).

cd <path to figlet folder>/figlet222/

./figlet <the text you want to show as a logo>

figlet features

I’ ll be mentioning only the important ones here.

Change style/font : A sub directory called fonts holds some .flf files which contains style info.

./figlet -f <fontfile_name> text

ex: ./figlet -f script Happy new year will produce something like above picture.

change alignment : To center -c , -l for left and -r for right

change right to left: -R

layout: -t will fit the text to terminal width, -P paragraph mode

figlet using some tweaks above

There’s a lot more; see figlet man page for more details. http://www.figlet.org/figlet-man.html

Part 2 of the post is about using cowsay and fortune-mod. Will be followed soon.

Permalink Leave a Comment

Gnash – The FOSS Shockwave flash player

May 3, 2009 at 10:18 am (Linux codecs, Other multimedia) (, , , , , , , , , )

When I say “shockwave flash” people usually do not understand it. This is not the flash movies you find on youtube (.flv); these are .SWF files which works as animations, programs (ex: some games & programs you play in net). As Macromedia (now owned by Adobe) has 100% successful players for these, they are not open source! And i’m afraid they can’t play standalone flash programs (.exe) created for Windows in Linux ! (and Gnash can)

Gnash 0.8.3 playing torpedojoe.exe on FC9

Gnash 0.8.3 playing torpedojoe.exe on FC9

Gnash player evolved from the GameSWF, and now is the only active FOSS flash player project.

Gnash features (Version 0.8.3 which I have),

  • Plays SWF up to version 7

  • Plays .exe standalone SWF up to V7

  • Has plugins for Firefox and Konqueror

  • Plays some .flv files

And many exporting functions which i’m not used to that much. Click here to go to their homepage.

Installing

Gnash has .rpm packages for Fedora,Mandriva, Suse. It can be simply installed by (when you’re root)

yum install gnash

I have seen some .deb packages in the net, so ubuntu,mint,debian users can have a try

sudo apt-get gnash

For installing from the source, you can download the source for version 0.8.5 here. After untaring the file, typing

./configure

make

make install will do the job, for more information on how to compile from source click here.

After installing, you can use command

gnash <filename> to run a file

just typing gnash only will give you the command -flags help, which is very helpful for using powerful gnash command line functions. I’m not going to fill the space up here with them.

Platforms

Gnash can render SWF on 3 different libraries. Default is the agg, which has the best quality and bug free output — but this may make it little bit slow, and requires some dependencies. (as the agg itself). Anyway, if you have a good VGA card and 100% working drivers, you may go for opengl. Just use

–enable-renderer=opengl when configuring (ex: ./configure –enable-renderer=opengl)

Same manner cairo can be used –enable-renderer=cairo

By default, gnash uses Gstreamer framework (Click about on Totem to see what you have) which is the most efficient. But you can use

–enable-media=ffmpeg

if you have ffmpeg and SDL libraries installed. (This is not recommended).

Permalink 4 Comments

Hydrogen – The GNU Drum Machine

April 10, 2009 at 9:10 pm (Audio / Video, linux apps) (, , , , , , )

We just composed some music in the previous article, and it’s time to beat some drums now. Hydrogen is a cool program —— you don’t need to know anything about music to enjoy it ! (like me). It gives you the ability to compose tracks of drum beats, like what you find in a usual song, the tracks may be repeated again and mixed with other tracks given in the timeline to produce the final track. It has a eye-catching GUI too. The version 0.9.3 which i’m using (which is also the last stable edition), uses best out of Qt 3.

Hydrogen 0.9.3 running on Qt 3.3.8 on FC9

Hydrogen 0.9.3 running on Qt 3.3.8 on FC9

According to their homepage, features of the Version 0.9.3 are;

General

  • Very user-friendly, modular, fast and intuitive graphical interface based on QT 3.

  • Sample-based stereo audio engine, with import of sound samples in .wav, .au and .aiff formats.

  • Support of samples in compressed FLAC file.

Sequencer and mixer

  • Pattern-based sequencer, with unlimited number of patterns and ability to chain patterns into a song.

  • Up to 64 ticks per pattern with individual level per event and variable pattern length.

  • 32 instrument tracks with volume, mute, solo, pan capabilities.

  • Multi layer support for instruments (up to 16 samples for each instrument).

  • Ability to import/export song files.

  • Unique human velocity, human time, pitch and swing functions.

  • Multiple patterns playing at once.

Other

  • JACK, ALSA, PortAudio and OSS audio drivers.

  • ALSA MIDI and PortMidi input with assignable midi-in channel (1..16, ALL).

  • Import/export of drumkits.

  • Export song to wav file.

  • Export song to midi file.

Installing

********You can download the source from here. Typing in the command line, inside the source directory (after extracting),

./configure && make && sudo make install

should install the program, you can always see my article on “compiling from source” if necessary.

*********Without using the source, you can use already available binaries. It’s so popular that your distro will have a pre-compiled binary. Type,

apt-get hydrogen (for debian-based systems (ex: ubuntu))

yum install hydrogen (for red hat, mandriva, suse linux)

should install version 0.9.3

Dependencies: Notable dependencies are:  alsa,qt3,raptor,flac,sndfile,lrdf

Importing drum kits

.h2drumkit files importing

.h2drumkit files importing

You can download drum kits from the sourceforege page. After downloading, you start hydrogen, click view on the menu bar tab, and click on the drumkit manager, so the following dialog box appears. Click on the import tab, and browse for the .h2drumkit file you have downloaded. Click on the load tab and select and load your new drumkit.

Development version (0.9.4 beta 3)

The beta version 0.9.4 uses Qt 4.4, but i’m unable to install it as my Qt is 4.3. (+ only source is available for the fedora, and it uses scons to compile the program, which cannot differentiate my Qt4.3.4 from Qt 3.3.8 and I know nothing about editing scons files), anyway I won’t be positive about a yet beta stage edition. You can download it here.

A help on how to install is given in this page.

Permalink 3 Comments

Installing programs from source code ………….. have you done it before? (tutorial)

February 21, 2009 at 9:11 pm (Linux installation) (, , , , , , )

This article is intended for intermediate users on how to compile from the source code.

As I mentioned before, it’s a free and open source world that we are living. So people who want to help others not only just give away the programs, but they give out the source code (the program codes used to build the program) in order to modify, learn the codings ,algorithms used, so that other people can use that code to build something much more better ! That’s how FOSS came this far down the lane, and it seems to get more and more enthusiastic !

As you know, source code as well as the pre-compiled binaries (ex: rpm, deb, bin) are available to download in the FOSS cloud. See far down this article to see when you do need to go for the source.

Short eats for beginners

basic steps to install

open commandline, CD in to the folder where you have the tarball (.tar.gz,.tar.bz2)

untar the source file using tar -xvf <filename>

CD in to source folder

then type

sudo ./configure && make && make install

or type su – , enter the root password and type

./configure && make && make install

If you have luck you’ll succeed. Read down for more deatiled description.

How to get source codes of programs?

There are several sites hosting FOSS programs, but I would suggest you go and check out sourceforge.net, freshmeat and softpedia linux page. When you come to the download page you will find a list of files to download. Don’t download unstable editions. Source file is something usually in .tar.gz or .tar.bz2 format saying “any platform” , sometimes may be categorized under “other OS”.

The source folder

(from here you should use console/terminal)

A typical view of the source folder

A typical view of the source folder

Change directory using CD command to the path you saved your file

Untar the downloaded file either using tar -xvf <filename> (ex: tar -xvf mplayer-1.02RC3.tar.gz) or your OS’s GUI extractor (ex: fileroller) to a folder newly created by mkdir <newdirectoryname> command. (I guess you know these)

now CD in to the folders till you find some lot of files (see below – use command ls for list the files in each directory) which is called the source folder. It usually includes a README, INSTALL, COPYING, configure and Makefile. (Doesn’t need to have all of these)

Task of these files: (can be omitted in a short course)

configure – Sources are designed to install with any system, but how it should install in a given system is heavily different. It depends on your hardware, software and “your choice”. When run, this will make a config.h, config.status and various config files and a unique Makefile

Makefile – Make file includes the code to compile the program calling files from source folder.

Autogen.sh – capable of generating a configure file

README – YOU MUST READ THIS FILE ! It includes information about the program, and dependencies etc. use command

less README

INSTALL – YOU SHOULD READ THIS TOO ! This gives specific information on how to install program.

Start compiling

Start with ./configure –help

this gives out some flags like below ones: (features of install)

flags you need to note:

–prefix=<path where you want to install files> , by default this will be /usr/local/bin etc…

–with-<packagename> ,will use the given package (as in the list)

–without-<packagename> , will not use

–enable-<feature>, enable a feature in the program

–<packagename>-includedir or -includes , manually override the search path for dependencies

now start configuring by

./configure flag1 flag2 flag3 etc….

ex: ./configure –prefix=/mnt/storage/mplayer –enable-gui –without-libmad

or just type ./configure only, this will work for most programs and easy for beginners

A typical text output when configure is run

A typical text output when configure is run

the program will display text as it is checking for dependencies, it will stop if it found out that a critical component is missing (or can’t find) and will display error and the package failed in someway. (see debugging below) if you’re lucky the text will show up to the point it’s writing config files ! Some advanced programs will show a list of things it’s planning to install, according to your dependencies.

Now type

make

This is gonna take some long time —— and this is where you need the luck most as many programs fail here ! (Now you say that) when done, type (see below the picture)

The make has failed - you should need to re configure

The make has failed - you should need to re configure

sudo make install

or log in to root typing su – then type make install

this will install the program. If you didn’t use “–prefix=” above, you”ll have binaries in your PATH so type

ls *<name of program you installed>*

ex: ls *mplayer* , this will give you a list of possible commands to run the program. Type them and see the correct one. (there’s a possiblity you may have a link in desktop) if you installed somewhere else go inside that folder. You may find the script usually in bin folder. Type

./filename

to run program.

Debugging:

1. There’s a possibility that you don’t have a configure file. Anyway,
still you have autogen.sh – What you downloaded is a snapshot. Type ./autogen.sh to generate configure file.
You have Makefile – no need to do “./configure” only do make and make install steps.
You have some files named cmake – your program does not install from ordinary automake. It’s using a program called cmake. Make a folder named “build” in your source folder and type

cmake ../ -DCMAKE_INSTALL_PREFIX=<path of your source folder>/build
and continue with make and make install
You have some .jar files – Source code is java. (Sorry i’m NIL at java, anyway try java -jar filename.jar)

2. If Config says you don’t have a package installed or something like that it could be due to

*You actually don’t have program installed. Copy the name in to google search and try to find it’s homepage to download. If you are installing binaries (ex: rpm) make sure you have both the “package” (has the program) and “package-devel” (has header files .h to develop the program)

ex: if it says “WxWidgets not found” install both “WxWidgets” and “WxWidgets-devel”

(there may be an article on my blog about manual rpm installation). If you only have the “package” configure will still say that you don’t have the package.

*You have the program and devel installed, but configure is searching some where else. Type

locate <packagename> | less

to list the files, the folder path having most “.h” files with “include” in path name may be where your header files are. Copy that path and do configure again using –<packagename>-includedir flag.

Ex: ./configure –Qt4-includedir=/usr/include/Qt4

3. If you still can’t debug it you may need to edit the configure file (not recommended), copy the error message and type

gedit configure

or if you have kwrite, nano other editor, use that command. Use find option pasting the error message. If you have some programming knowledge you should be able to identify the default paths assigned for searching for the package. Correct them to your actual path.

(For example, package WxGTK is installed as compat-WxGTK in fedora, so I had to tell the program that compat-WxGTK is the correct one while installing audicity ).

Man, this is getting longer and longer so i’ll stop here. You can always google search for the error message, where people may have solved it before have put how they did it. (Of course you can ask me)

It’s a good practice to type

make clean

to remove the make files after installation or failed make attempt.

You can type this to uninstall, if you’re at the source folder.

make uninstall

so I suggest you shouldn’t delete the source folder just after successful installation !

Some configure scripts will need

make depend

make check

commands between the make and make install. These will be mentioned in INSTALL file.

When should you go for source?

  • If you are a developer, who either using the code for modifications or a someone who’s building binary repositories for various Linux distributions by cross-compiling
  • You don’t have a package managing system (ex: rpm,deb) or only the source code is available so you don’t have a choice
  • The program is large or it has many unwanted features which is again large and asking for a list of dependencies to run when you try to install the .rpm or .deb (you can select features to install by source code – saves a lot of space)
  • Person who want to grab the newest edition
  • Some programs have tweaks (optimizations) chosen when compiling depending on your system. This enhances performance of program (ex: wine, mplayer, swiftfox)

Important: Anyway, use the source mainly for programs up in the dependency tree (programs which heavily depend on other programs but which is not a dependency of any program) if you have a package manager (as it may not identify the installed program).

I’ll stop here for now. This blog page will be updated as necessary in the future.

Permalink 6 Comments

Maxima : The maths notebook

February 18, 2009 at 10:42 pm (linux apps) (, , , , )

This article is about mathematica-like FOSS application maxima.

WxMaxima running on FC9, Gnome

WxMaxima running on FC9, Gnome

I usually get big intergrations and ODE’s which i cannot solve on my own. Functions of these without boundry conditions cannot be solved by most programs, and most of them give alien output which is far different than your school notebook. This is where maxima comes in with built in functions. You can check out maxima website for more details.

Maxima runs using LISP. There are several distributions of LISP, but i recommend common lisp alias CLISP (type clisp on rpmfind for rpms- or download source from here) for the purpose. It’s slow than others, but less-troublesome. You should install CLISP before installing maxima. If you’re installing from source (download here) it will be auto-detected. The same old method, which is to CD in to source folder path and typing (this contains “configure” file)

./configure

make

make install will install your app.

If downloading from binaries choose package which suits your installed LISP package.

ex: download maxima-runtime-clisp if you installed CLISP as your LISP.

maxima-runtime-elisp if you installed ELISP as your LISP etc.

When you’re done installing maxima, type maxima for command line interface and xmaxima for inbuilt GUI. The xmaxima also contains some example codes.

The xmaxima inbuilt GUI

The xmaxima inbuilt GUI

Recommende GUI – WxMaxima (see the first picture)

Although xmaxima is good, it lacks modern  GUI touch. wxwidgets have good solution for this, and this even includes openmath software for pretty plotting than from GNUPLOT. You can download the source from this link.

Permalink Leave a Comment

Next page »