Monthly Archives: January 2013

Installing ObsPy on Fedora 18

obspy-logo

ObsPy is an open-source project dedicated to provide a Python framework for processing seismological data. It provides parsers for common file formats, clients to access data centers and seismological signal processing routines which allow the manipulation of seismological time series (see Beyreuther et al. 2010, Megies et al. 2011).

The goal of the ObsPy project is to facilitate rapid application development for seismology.

https://github.com/obspy/obspy/wiki

ObsPy packages are available only for Debian/Ubuntu, however is possible to install it on Fedora via Python Package Index (PyPI). Not all deps are explained on ObsPy wiki pages so here is the complete procedure to install the software on Fedora 18:

First set up all the dependencies via yum

[root@sam ~]# yum install -y python-devel python-setuptools numpy scipy python-matplotlib python-matplotlib python-matplotlib gcc-gfortran python-suds python-sqlalchemy python-lxml

Now you can install ObsPy as explained in theirs wiki (https://github.com/obspy/obspy/wiki/Installation-on-Linux-via-PyPI)

[root@sam ~]# easy_install -U distribute; easy_install -N obspy

To test if the installation was successful use obspy-runtests

[daniele@sam ~]$ obspy-runtests
................................................................................................................................................................................................s.....................................................
[...]
----------------------------------------------------------------------
Ran 839 tests in 65.348s
 
OK

That’s all.

References:

 

 

Re-enable “Log out” in GNOME 3.6

user_menu

 

In GNOME 3.6, with a single user, the option “Log out” in user menu is no more available by default.

To re-enable it open a terminal and type:

gsettings set org.gnome.shell always-show-log-out true

Now restart the Shell by pressing Alt+F2 and typing r<return>

References:

https://wiki.archlinux.org/index.php/GNOME#Always_show_the_.22Log_Out.22_entry_in_the_user_menu

Install Arista Transcoder on Fedora 18

aristaArista Transcoder (http://www.transcoder.org/) is a useful transcoder tool build upon Python and GStreamer. It’s not available in Fedora yum repositories, but the installation from source is quite easy.

Let’s go.

First: download the sources from its website and untar them

[daniele@sam ~]wget http://programmer-art.org/media/releases/arista-transcoder/arista-0.9.7.tar.gz; tar xzvf arista-0.9.7.tar.gz

Second: install the dependencies required to build and install Arista and the extra GStreamer plugins (if not already installed) via yum

[daniele@sam ~]sudo yum -y install python3-devel gstreamer-ffmpeg gstreamer-plugins-good gstreamer-plugins-bad-free gstreamer-plugins-bad-nonfree gstreamer-plugins-ugly

Arista uses HAL which is deprecated since Fedora 15 and removed from Fedora 16, so to run Arista you also need to install python-gudev which uses udev instead of HAL.

[daniele@sam ~]sudo yum -y install python-gudev

Third: build and install the software and remove install sources

[daniele@sam ~]cd arista-0.9.7
[daniele@sam arista-0.9.7]$ python setup.py build
[daniele@sam arista-0.9.7]sudo python setup.py install
[daniele@sam arista-0.9.7]$ cd ~; rm -Rf arista-0.9.7

Fourth: run Arista from command line or from your application menu!

[daniele@sam ~]$ arista-gtk

arista-fedora18

Done!

Allowing upload SVG in WordPress

If you try to upload an SVG file in your WordPress media library, the process will return the error

Sorry, this file type is not permitted for security reasons

To add new MIME types (in this case SVG) to the “white list” of file formats that are allowed to be uploaded just edit your theme function.php and add:

function custom_upload_mimes ( $existing_mimes=array() ) {
 
	$existing_mimes['svg'] = 'image/svg+xml';
	$existing_mimes['svgz'] = 'image/svg+xml';
 
	return $existing_mimes;
}

Easy.

Extra

To see how to configure lighttpd to handle correclty SVG and SVGZ please read “SVG e SVGZ con lighttpd” (in Italian)

IMAP local backup with OfflineIMAP

Goals:

  1. have a one-way local copy of my work address (“A”)
  2. do the same for my private mail address (“B”)
  3. make them accessible together through an easy interface
  4. all software must be open and free

My case:

  1. my own mail address is on Gmail with IMAPS access enabled
  2. my work mail address is accessible via a standard IMAP server
  3. I already have a LAMP webserver in a LXC container hosted on my MicroServer

What you need:

  1. Linux, of course
  2. an internet connection (really?)
  3. a great tool called OfflineIMAP (http://offlineimap.org/)
  4. an IMAP server, DOVECOT (http://www.dovecot.org/) in this case

How does it work?

remote IMAP server --> offlineimap --> maildir on localstorage --> local dovecot imap server --> webmail/mail client (like claws-mail http://www.claws-mail.org/)

the local maildir is created as

MAILDIR INBOX -> ACCOUNT A --> INBOX ---> SUBFOLDER 1
                                     ---> SUBFOLDER 2
MAILDIR INBOX -> ACCOUNT B --> INBOX ---> SUBFOLDER 1
                                     ---> SUBFOLDER 2

Ok, let’s go!
Continue reading