Skip to content

Check balanced double quotes…

…or any other character!

Why? Usually I have the problem that writting shell scripts I miss some double (or single) quotes.

If script is short I can easily find where the error is but with long scripts that is not easy.

So I wrote following command to find rows with odd number of double quotes.

cat -n <script> | sed -e s/'[^”]’/”/g -e s/'””‘/”/g -e s/’$’/’X’/1 | cat -n | sed -e /'[[:digit:]][[:space:]]X$’/d

Output could be:

1242    “X

Saying that row 1242 has a problem with double quotes number.

It is possible to replace double quotes in [^”] and s/'””‘/”/g with any other character you want check if it is balanced.

Ubuntu 14.04 gstreamer invalid commandline

It was since I update my Ubuntu 12.04 to 14.04 that some programs like Totem, Rhythmbox and Brasero gave me the error: blah blah blah invalid commandline … gstreamer … blah blah blah.

Yesterday I investigate the issue and managed to solve it.

I took the list of installed gstreamer0.10* packages.

Then I disinstalled them with apt-get purge (that removed some other packaged like ubuntu-desktop, I do not know why, but system is working fine even with out them).

At the end I replaced 0.10 with 1.0 in the disinstalled gstreamer0.10* packaged list and installed them.

Now Totem, Rhythmbox and Brasero works fine without complainig about gstreamer invalid commandline error.

WoW.

DLNA, Panasonic, Matroska and Madiatomb

Have you got a Panasonic SMART (LCD-LED) TV?

Is it model TX-L32E6E?

Do you want get it read mkv from a dlna server?

Is the dlna server mediatomb?

Then, this is what you need to do.

Edit mediatomb config.xml

In section add:

In section add:

That is if no mkv are already in the db but if mkv are already in the mediatomb db then it must be update.

A mean is find

-type f -exec touch -a “{}” \;Click here to read the full source.

Aside

Extract & burn subtitles from / into video (using ffmpeg)

Following this article I got subtitles hard-coded into the video.

Subtitles were extract from source with this command

ffmpeg -i mymovie.mkv -vn -an -codec:s:0.1 srt mymovie.srt

found in  ‘Extracting the subtitles, at last !’ section of this article.

7-zip command line (7za) on OS X

The better solution to get 7-zip *command line* (7za) on an OS X installation
is to grab the p7zip (http://p7zip.sourceforge.net/) sources and compile them on a Mac (maybe Xcode is needed but not sure):

# working directory where p7zip sources are in is ./sources

tar xbfj p7zip_9.20_x86_linux_bin.tar.bz2
cd p7zip_9.20.1
make

If all went fine in  p7zip_9.20.1/bin there will what we need: the executable 7za.

p7zip is a port of 7za.exe for POSIX systems like Unix (Linux, Solaris, OpenBSD, FreeBSD, Cygwin, AIX, …), MacOS X and also for BeOS and Amiga.
7za.exe is the command line version of 7-zip, see http://www.7-zip.org/.

Attache are:
* source code got from http://sourceforge.net/projects/p7zip/
* executable built on OS X 10.8.5 (with both Xcode 4.5.1 and XCode 5.0 installed but – again – not sure whether Xcode is need)

AVCHD video authoring

Problem: get my father’s Panasonic Full HD TX-L32G10 television play videos from Secure Digital card.

I have a Panasonic Full HD camcorder.
My mother does videos with her Canon -a model- photo camera.
My fathers television (see above) can read only either avchd or mpeg videos from a sd card.
Moreover – do not know wheter this is true for mpeg – avchd can be read only if sd structure is a valid avchd strucutre.

After lots of tries I find out this avchd authoring video tool that does the work.

Only to remember when tool outcome is transferred to the sd it must be put under PRIVATE folder otherwise that f*****g tv refuses to read videos.

Get gmail and thunderbird contacts in sync

If you want to get in sync your Mozilla Thunderbird contats with Google Contacts then you have to try this Google Contacts Thunderbird extension.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: