Entries Tagged 'software' ↓

Skype with Linux 64 bit (Debian 7)

OK, I’ve got a Debian 7 on my laptop with a 64 bit OS. I want to install skype.

In the old days the Skype guys used to distribute a 64 bit package, nowadays they think it’s not needed anymore so you’re stuck with the 32 bit version. Why producing the 64 bit package (probably because they still have a 32 bit source code) when 64 bit OS’s are able to run the 32 bit software? This seems to be the philosophy.

There’s a number of steps involved in the use of the brand new version (32 bit) provided by the skype dev team which I couldn’t go through.
However I have a legacy 2.2 version of skype compiled for 64 bit that would occupy the audio server and would crash if anyone else tried to output some sound.

The simple solution is to add this to the ~/.asoundrc

pcm.!default plug:pulse
plug.pulse{
type pulse
}

Getting the dark settings in Gnome3/2 hybrid

this post is useful to me.

To change the gtk look on gnome 3/gnome 2 hybrid as in debian 6 you must use the command line.

Apparently Gnome is reading the gtk.css file setting. So you need to substitute the gtk-dark.css to the gtk.css:

cd /usr/share/themes/Adwaita/gtk-3.0

cp gtk.css gtk.css.orig

cp gtk-dark.css gtk.css

Windows/*nices integration

Are you wondering how to import vector graphics produced by Gnuplot into Microsoft Office tools?

Well, the trick is: produce a EMF file. In Gnuplot just add:

set term emf

Come scaricare i video flash

A me capita di voler scaricare localmente i video flash; con youtube e’ molto semplice: basta google-are e si trovano decine di siti che vi permettono di salvare localmente i files.

Ma i video di Corriere.it o repubblica Tv non sono altrettanto semplici, o lo sono di piu’. In ogni caso bisogna solo sapere che l’applicazione flash che vi fa vedere il filmato nella pagina web non fa altro che scaricare localmente il file e poi ve lo legge. Siccome il player flash risiede all’interno del browser i files verranno scaricati e salvati all’interno della cache del browser.

Se vi armate di Firefox potrete andare a guardare nella cache scrivendo nella barra degli indirizzi

about:cache o meglio la cache disco
about:cache?device=disk

a questo punto scegliete la cache disco e vi verra’ indicato il percorso file dove si trova la cache. Aprendo un finder o esplora risorse o dolphin o nautilus o un terminale potrete raggiungere la directory della cache. A questo punto il vostro filmato che cercate e’ uno dei files, generalmente uno dei piu’ grandi.

Quindi basta ordinarli per dimensione e cominciare a leggerli con VLC (o altri media player che non si lamentino per l’assenza o la stranezza dell’estensione del file che volete leggere). Questi files hanno dei nomi ragionevoli solo per i computer, sono roba tipo FCEBB377d01.

Una volta che abbiate localizzato il file che vi interessa lo potete copiare da un’altra parte e rinominarlo ilMioDownload.flv

Python+pdfLaTeX+ebook

After using my iLiad for a while I found that it’s super to read stuff that you find on internet. But you have to put it in there….

I came with a openoffice template with proper page dimensions to fit in whatever I find interesting to read. But for blogs or so, something that I read more or less regularly this is a pain. So I used python to retrieve the feeds and reformat them for the real formatting program pdfLaTeX.

Well, the very first code looks like this:


import feedparser
import re
import os
import locale
language, output_encoding = locale.getdefaultlocale()
def remove_html_tags(data):
p = re.compile(r'<.*?>')
return p.sub('', data)
def remove_html_special_char(data):
p = re.compile(r' ')
return p.sub('', data)
def br2dobleLine(data):
p = re.compile(r'
')
return p.sub('\n\n',data)
d = feedparser.parse("http://voglioscendere.ilcannocchiale.it/blogs/feeds/blogrss20.aspx?blogid=32495")
print "feed parsed"
##print e.title
##print desc
os.chdir ("/Users/paskino/temp/")
header = """\documentclass[iliad,12pt,oneside,onecolumn,final,openany]{iliad}
\usepackage[latin1]{inputenc}
\usepackage[italian]{babel}
\usepackage{hyperref}
\setlength{\hoffset}{-0.8 in}
%remove
\setlength{\\voffset}{-1 in}
\setlength{\\textwidth}{\paperwidth}
\\addtolength{\\textwidth}{-9mm}
\setlength{\\textheight}{\paperheight}
\\addtolength{\\textheight}{-22mm}
\\title{Voglioscendere}
\\begin{document}
\\tableofcontents
“”"
footer=”\end{document}”
e = []
news = []
section = header
for i in range(len(d['items'])):
e.append(d.entries[i])
desc =remove_html_special_char(remove_html_tags(br2dobleLine(e[i].description)))
news= “\section{”+e[i].title+”}”+desc
section += news
section += footer
##section = header+news[1]+footer
f=open(”prova.tex”,”w”)
f.write(section.encode(”ISO-8859-1″, ‘ignore’))
f.close()

You can download the script here.

The class iliad.cls is just a sligthly modified article.cls from standard LaTeX, in which I defined the dimensions of the iLiad screen as:

\DeclareOption{iliad}
{\setlength\paperheight {163mm}%
\setlength\paperwidth {122mm}}

By now it works impressively well, with minor bugs/problems.

UPDATE:
The code depends on Universal Feed Parser.

How to write captions without numbers in LaTeX

This is just a simple use of the caption package for TeX that enables you to do much more. If you want to display captions without numbers add the following line to the header of your file:

\usepackage[labelformat=empty,labelsep=none]{caption}

How to extract the audio track from a Youtube FLV

As you might know, I like to listen to my mp3 player while going to and back from work. Nowadays Youtube is a rather used alternative system of information. Anyway watching a youtube video means that you have to stand in front of your computer doing nothing else than staring at the video and hopefully paying attention. That’s why I love the radio as a medium: it gives you almost as much information as the TV without the need of keeping you doing nothing else.  All right, sometimes the image is very powerful, more powerful than the language, but it is seldom like that.

Anyway, I have found two perfect way to extract the audio track of a youtube video, which is generally an mp3 stream:

  1. Use the marvellous mplayer with the following line of command: mplayer -dumpaudio -dumpfile audiotrack.mp3 youryoutubefile.flv
  2. Use VLC.

The second method took me a really long while to figure out. And as a matter of fact it doesn’t work with the GUI. In Windows, write a file with the following line (one line):

“C:\Program Files\VideoLAN\VLC\vlc.exe” %1 :sout=#transcode{acodec=mp3}:duplicate{dst=std{access=file,mux=raw,dst=%1.mp3},select=\”novideo\”} vlc://quit

save it as a bat file (or download this). Now if you drag a video.flv file on its icon, you’ll get a file named video.flv.mp3 with just the audio track of the flv file.

P.S. I download from youtube by keepvid.com