Create timelapse movie from shaked photos

The problem consist of creating a timelapse made of photos which have been taken with a camera which has been removed and attached to a tripod during a few months thus creating a lot of shaking. Solution, use hugin to align photos:

#!/bin/bash
 
align_image_stack -v -a$1 -s 2 *.jpg
 
mkdir base
for i in $(find . -maxdepth 1 -name "*.tif"); do n=".$(echo $i | cut -f2 -d".").jpg"; convert $i $n && mv $n base; done
rm *.tif
cd base && mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 -mf type=jpeg:fps=5 mf://*.jpg -o $1.avi && cd .. && mv base/$1.avi .

 

Oracle 12c on Ubuntu 14.04 (sort of)

After Oracle 11g very good experience with installing on Ubuntu I had high hopes for 12C also. They crumbled down quite fast. This is the summary of almost 2 days lost trying to install oracle on Ubuntu with the ups and downs.

Conclusion

First the conclusion: my personal conclusion is that oracle 12c does not work, with an acceptable amount of effort, on Ubuntu 14.04. It should be possible to install it following a guide but it’s by no means comparable to an 11g install. Most of the errors are in the linking phase where you have to manually edit the makefiles to add various missing (not found in current config) libraries. Finally I managed to install oracle 12C using a docker container using this guide but this is also not without problems.
(more…)

Resize a kvm disk image

1. From the vm, stop the vm:

poweroff

2. From the host, resize the disk image:

qemu-img resize /virt/disk02.img +50G

3. From the host edit partition table

parted /virt/disk02.img
GNU Parted 2.3
Using /virt/disk02.img
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free                                                       
Model:  (file)
Disk /virt/disk02.img: 107GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
        16.4kB  1049kB  1032kB           Free Space
 1      1049kB  51.5GB  51.5GB  primary  ext4         boot
        51.5GB  107GB   55.9GB           Free Space

(parted) rm 1                                                             
(parted) mkpart primary 1049kB -2G
(parted) print free                                                       
Model:  (file)
Disk /virt/disk02.img: 107GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
        16.4kB  1049kB  1032kB           Free Space
 1      1049kB  105GB   105GB   primary  ext4
        105GB   107GB   2000MB           Free Space

Yes: rm 1, since this only deletes partion information, not data. Then you recreate partition info on top of data.

4. From the guest, restart, then:

resize2fs /dev/sda1

The difficult to find bug

After upgrading from 3.4 to 3.6 my JGroups code stopped working. On a 2 nodes setup when the second node tried to join I got the following errors:

2015-04-22 21:38:12,510 INFO  [ViewHandler,monalisa,tux-7762|fr.mcc.test.TestJGroups] Detected a change in cluster members: [tux-7762, tux-9846]
2015-04-22 21:38:14,460 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: JOIN(tux-9846) sent to tux-7762 timed out (after 2000 ms), on try 1
2015-04-22 21:38:16,463 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: JOIN(tux-9846) sent to tux-7762 timed out (after 2000 ms), on try 2
2015-04-22 21:38:18,466 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: JOIN(tux-9846) sent to tux-7762 timed out (after 2000 ms), on try 3
2015-04-22 21:38:20,468 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: JOIN(tux-9846) sent to tux-7762 timed out (after 2000 ms), on try 4
2015-04-22 21:38:22,471 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: JOIN(tux-9846) sent to tux-7762 timed out (after 2000 ms), on try 5
2015-04-22 21:38:24,473 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: JOIN(tux-9846) sent to tux-7762 timed out (after 2000 ms), on try 6
2015-04-22 21:38:26,475 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: JOIN(tux-9846) sent to tux-7762 timed out (after 2000 ms), on try 7
2015-04-22 21:38:28,479 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: JOIN(tux-9846) sent to tux-7762 timed out (after 2000 ms), on try 8
2015-04-22 21:38:30,482 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: JOIN(tux-9846) sent to tux-7762 timed out (after 2000 ms), on try 9
2015-04-22 21:38:32,485 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: JOIN(tux-9846) sent to tux-7762 timed out (after 2000 ms), on try 10
2015-04-22 21:38:32,485 WARN  [main|org.jgroups.protocols.pbcast.GMS] tux-9846: too many JOIN attempts (10): becoming singleton
2015-04-22 21:38:32,493 WARN  [Incoming-2,monalisa,tux-9846|org.jgroups.protocols.pbcast.NAKACK2] JGRP000011: tux-9846: dropped message 1 from non-member tux-7762 (view=[tux-9846|0] (1) [tux-9846])

It took some time but finally I managed to write a “simple” (quick and ugly) test to replicate the problem.
(more…)

ojdbc14.jar to ojdbc6.jar migration

Migrating from ojdbc14.jar to ojdbc6.jar is not, as one might think, completely seamless. Here are at least 3 points which required code change:

Changes in class hierarchy

error: OracleTypes is not public in oracle.jdbc.driver; cannot be accessed from outside package
 [javac] private static Integer OracleRefCursorType = new Integer(oracle.jdbc.driver.OracleTypes.CURSOR);

(more…)

Create a database of exif data

Create a database of exif data from photos using pyexiv2 and save it in a sqlite database for futher query:
(more…)

Recover your lost apk

#Find the device
adb devices
#Find the package
adb shell pm list packages | grep ro.len
#Find the apk path
adb shell pm path ro.len.test
#Pull the package
adb pull /data/app/ro.len.test-3.apk

Webex on linux 64 bit

After installing java there are still a lot of issues:

java.lang.UnsatisfiedLinkError: /home/gigi/.webex/1324/libdbr.so: /home/gigi/.webex/1324/libdbr.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
 at java.lang.Runtime.loadLibrary0(Runtime.java:849)
 at java.lang.System.loadLibrary(System.java:1088)
 at DBR.loadNativeDBR(DBR.java:22)
 at DBR.loadNativeModule(DBR.java:166)
 at DBR.onDBRMessage(DBR.java:297)
 at DBR.processMessage(DBR.java:319)
 at DB.processMessage(DB.java:431)
 at DB.run(DB.java:397)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
 at java.awt.EventQueue.access$200(EventQueue.java:103)
 at java.awt.EventQueue$3.run(EventQueue.java:694)
 at java.awt.EventQueue$3.run(EventQueue.java:692)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
XXX[DBR]load native library failed
java.io.IOException: Error writing request body to server
 at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3192)
 at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3175)
 at CWCSHttpBigPost.SendHttpStream(CWCSHttpBigPost.java:348)
 at CWCSHttpBigPost.run(CWCSHttpBigPost.java:223)

After running ldd on: .webex/1324/libdbr.so I identified the following missing libs (xubuntu 14.04):

apt install libpangoxft-1.0-0:i386 libxv1:i386 libpangox-1.0-0:i386 libXmu6:i386

to fix the problem.

Turultrans

A trecut mult timp de cand n-am mai iesit la o tura serioasa. Prins cu alte proiecte, n-am mai apucat sa fac sau sa povestesc mai nimic. Dan insa nu ne-a lasat sa ne ingrasam prea tare. N-am reusit sa-i refuzam ideea de a face un tur pe asfalt, cu roti subtiri sau cursiere unde era cazul.

Planul era simplu: 4 zile, 4 participanti, 400km, >4000mh, 2 traversari serioase si de “palmares”, bagaj minimal, pedalat maximal.

Prima zi: Curtea de Arges – Novaci, pe drumuri secundare asfaltate, drum foarte prost intre Horezu si Polovragi pe DJ660, 116km/1800mh

 

A doua zi: Novaci – Ranca – Pasul Urdele – Sugag, 110km/2500mh. Am urcat pe soare, de la Ranca a inceput sa se innoreze accelerat si in pasul Urdele ne-a plouat serios, cu grindina, la 5C. Pe coborare ploaia s-a oprit si in Obarsia Lotrului a iesit din nou soarele, pentru sfarsitul zilei reusind sa ne uscam pana la Valea Frumoasei, unde am innoptat.

 

A treia zi: Susag – Cartisoara, drumul cicloturistic al marginimii Sibiului, 123km/1400mh. Zi frumoasa cu soare, cea mai grea zi pentru mine din cauza unei mese de pranz “prea ca la tara”.

 

A patra zi: Cartisoara – Curtea de Arges, 118km/2000mh, zi splendida, urcarea usoara, pacat ca era ultima zi, caci parca ne intrasem in forma pentru inca 4 zile.

A fost o tura splendida, la inceput de toamna, cu prieteni buni. Cel mai mult mi-au placut urcarile pe Trans-uri, mult mai motivante si cu rasplata imediata :)

 

py-gps-tools

After spending loosing time in vain trying to convert kml files containing the gx:Track format to gpx files for my gps and finally writing my own tool for doing that I realized I have done quite a lot of small scripts for gps data manipulation and decided to push them on github. I started with 2 and as I will clean the others I will push them also.

py-gps-tools

A set of python scripts to manipulate GPS data

kmlCleanTimeStamp.py

Removes TimeStamp information from .kml files. More precisely, it removes gx:TimeStamp and //kml:Placemark/kml:TimeStamp elements. Modifies the document in place.

kmlCleanTimeStamp.py file.kml

kmlTrack2LineString.py

Converts kml gx:Track to old style LineString elements. This is required because not even gpsbabel can convert the gx:Track elements to gpx for instance resulting in data loss. Conversion is done in place.

kmlTrack2LineString.py file.kml

 

Related Posts with Thumbnails