Mostrando entradas con la etiqueta ubuntu. Mostrar todas las entradas
Mostrando entradas con la etiqueta ubuntu. Mostrar todas las entradas

domingo, 31 de julio de 2011

Moving files to honeycomp tablet internall memory using linux (without pain)

Long time since my last post but I have been a little busy! I got really frustrated trying to send some files to my asus transformer this weekend (using ubuntu). I tried to mount it as a file system via mtp but it was a complete failure, slow transfer rate, corrupted transfers, tablet frezzes, etc, etc, are some of the main problems that I faced.

I was almost done when I decided to try another aproach, I decided to install a SSH server in my laptop and a FTPs client in the tablet. The result? Flawless victory. Yes the transfer rate will never be as USB but is really convenient downloading my movies directly from my bed. :)

To install the SSH server in linux (at least if you are using any debian based distribution) just type:

sudo apt-get install ssh

And the scp client of my choise was AndFTP that can be found in the android market.

domingo, 30 de enero de 2011

Fix TV overscan using ubuntu nvidia privative drivers

I have an old LG HD-TV and I have been struggling trying to make it work fine with my ASUS laptop. The problem is that when I start "twin view" using the HDMI output of the laptop I get overscan in the TV, this means that I can't see my full desktop because 200 pixels in X axis and Y axis are lost. I have read in a lot of forums that modifing the device ID using a binary file or modifying directly the xorg.conf are the only workarounds to solve this problem but after spending almost an hour I discovered that nvidia-settings have its own tool to fix overscan.

I'm using 260.19.06 version installed using the official ubuntu repositories. To change the overscan simply launch nvidia-settings and go to Xserver Display Configuration. Detect your tv and enable it in twin view or as main screen. Now in the nvidia-settings main menu select your GPU tab and search your TV, in my case it says DFP-1 (LG Electronics 32LCD2D-MD). Select it and if you don't see a scroll-bar with title "Oversan Compensation" then click "ResetDefaults" button. After that operation you should see the "Oversan Compensation" scrollbar and you can scale the output to fit your TV size.



This driver have a lot of glitches and bugs, for example when I change any configuration I can't see the "accept configuration dialog" so I need to guees where is the accept button. In a similar way every time I change any configuration I lost my system theme and get reverted to gnome default theme. Those problems didn't presented when I was using the official drivers downloaded directly from Nvidia but after the last kernel update I just can't figure out how to make them work again. :(

viernes, 21 de enero de 2011

Mantain more than one music library in Rhythmbox

This is a really strange requirement but there are sometimes that you may want to mantain two separate libraries using the same linux user. In my case, I have one library in /home/myUser/Music and other one in /home/myUser/MusicLowQuality. This is usefull because I mantain a second version of all my music in a lower quality for syncing my mp3 player. The problem starts when you import this two folders to Rhythmbox because you will have a duplicate of every single song.

The Rhythmbox Library Database is stored in ~/.local/share/ryhtmbox/rythmdb.xml by default but you can invoke rythmbox this way to take any file you want:


rhythmbox --rhythmdb-file=/home/myuser/.local/share/rhythmbox/mynewdb.xml


This way you can create two diferent launchers that target to two different music libs. This is terrific but I found just one annoying behaivior. If you have the auto-inspect option enabled pointing to /home/myUser/Music and invoke the launcher that use the LowQuality folder when you include new music files to /Music they will be included in the wrong lib. This is a little difficult to explain :3

The easiest solution that I found was changing the path to the inpection folder before calling the launcher.

you can invoke rythmbox this way to take any file you want:


gconftool -s /apps/rhythmbox/library_locations -t list --list-type string [file:///home/myUser/MusicLowQuality] && rhythmbox --rhythmdb-file=/home/myuser/.local/share/rhythmbox/lowqualitydb.xml

gconftool -s /apps/rhythmbox/library_locations -t list --list-type string [file:///home/myUser/Music] && rhythmbox --rhythmdb-file=/home/myuser/.local/share/rhythmbox/normaldb.xml


I hope this can be useful for someone :)

domingo, 2 de enero de 2011

JDownloader, better ubuntu integration

Well... this is a really dumb post but I just discover this a few minutes ago and maybe can help someone else. If you are running jdownloader in ubuntu or any gnome linux platform maybe you noticed that by default the theme is java metal. I don't dislike the theme but this have some issues with compiz, for example sticky windows simply doesn't work and sometimes you can't maximize. In the other hand always is nice having an unified look and feel for all apps.

You can open JDownloader, open preferences tab and select interface node. In theme option you should select "Light(GTK)" and restart JDownloader. That's it now JDownloder behavior and "look and feel" is just like any other Gnome app.

miércoles, 8 de diciembre de 2010

Offline maps on android! Atlas Creator and rmap the perfect dumbbell.

I bought a Samsung Galaxy Tab some weeks ago :) but I haven't adquired a 3G plan. This prevents me to use Google Maps and use my device build in GPS capabilities. After some research I found in android market an application called rmap that simply rocks!. You can create your own maps upload them and enjoy.

The problem is, where to obtain this maps? Well there's a desktop application (written in java of course :) ), that creates a multilayer map based in a great huge variety of map engines like google maps (my favorite), bing, yahoo, etc., and can export portions of the map to many diferent file types.

The big problem (not that big) is that rmaps uses an output map format called "BigPlanet SQLLite" that is not supported by default in Atlas Creator. This can be fixed quickly following the next steps in Ubuntu 10.10:

1. Download Atlas Creator from http://mobac.dnsalias.org/ (I'm using version 1.7 but the latest stable version is 1.8, desicion up to you)
2. Download SqlLite Libs from http://www.datafilehost.com/download-909a5d21.html. (I used ubuntu 9.10 x64 but this is dependant of your cpu)
3. Download SqlLite.jar from http://www.ch-werner.de/javasqlite/javasqlite-20100727-win32.zip (yes! is a windows build but don't worry remember that java is multiplatform)
4. Copy libsqlite_jni.so and sqlite.jar to 3-Mobile Atlas Creator 1.7 folder. (In the same place that you can fin start.sh)
5. Run Mobile_Atlas_Creator.jar (java -jar Mobile_Atlas_Creator.jar)

Now you can select the area that you expect to use offline (for example your entire city or your next vacation destiny) and select the zoom level that you want to be available. (WARNING selecting level 18 and 19 will produce big map databases, personally I use from zoom 1 to 17). Finally, don't forget to select "BigPlanet SQLLite" format, name your atlas and sections and run "Create Atlas".

After some minutes depending in the area selected you will have a map file in /home/atlases/ that you need to copy to your android mobile device in the path /rmaps/maps/.

This way you will have a Google Map (or any provider map) completly offline and functional!

viernes, 22 de octubre de 2010

Synchronize folders between two ubuntu terminals automatically

Sometimes you want to synchronize the documents of your desktop with the documents in your laptop (you could want to sync all your photos, music or documents), this can be a time consuming task and you can easilly lose changes, duplicate files or simply forget to sync. To avoid this we will explain here how to install a sync folder server in ubuntu, configure it and finally sync automatically every time we start our computer.

Before anything we need to install some software in both terminals (in our case the latop and the desktop):


sudo apt-get install unison-gtk,unison,expect,openssh-server


Unison is the synchronization server that mantains the differences between local and remote folders, unison-gtk is a graphical interface for unison, expect is a program that allow us write powerfull shell scripts and finally open-ssh is the server that implements the secure shell connections.

After installing, we should test the ssh server writing in terminal this command:


ssh host-address -l user


Replace host-address with the address of the remote server. This could be an ip.
Replace user with your ubuntu user.

You should be asked to accept a certificate and after taht you need to input your password.

Next, we need to create a profile in unison. To make easier this process, we are going to use unison-gtk. Click the "add profile button" and give it a name like "MyUnisonProfile", next, for the local folder set something like /home/mylocaluser/thelocalfolderToSync, in the next page you must provide the remote folder to sync. This should be something like /home/myremoteuser/myremotefolder, check the SSH option and give the remote server.

If you provided correct information you should be prompted to input password, and finally you should see a table with the differences between the two folders. If you click Go button the two folders will be merged and from this point every change made in any folder (remote or local) can be sync using this tool.

This is terrific but like we explained in the beggining of the post, we would like to automate this process to ensure that our folders are up to date with no efford. To achive this we are going to write an script that syncs the unison profile "MyUnisonProfile" when we start our gnome session.

First of all create a file in your home directory "unisonScript.sh" and paste this code inside replacing the password and the profile with the correct values:


PROFILE_NAME=MyUnisonProfile
SSH_PASSWORD=myremoteuserpassword

echo "Waiting for networking"
sleep 60;
echo "Sync folders"
expect -c "set timeout -1;\
spawn unison $PROFILE_NAME -batch
match_max 100000;\
expect *password:*;\
send -- $SSH_PASSWORD\r;\
interact;"
echo "Done"


You can test this script double-clicking in nautilus and selecting execute on terminal or running in any terminal:


sh unisonScript.sh


Note that the script starts but waits 60 seconds before sync, we need to sleep because the network is not ready until some seconds after gnome login. We could not find a better way to wait until networking is ready :(

The last step is call this script adding the sh unisonScript.sh line to the end of .bashrc file that can be found in your home directory.

WARNING: This script is in batch mode! This means that you won't be asked for any permission. If you delete a file in any terminal, after running this script you will miss this archive in both terminals.

PS: If you install unison-gtk using the ubuntu software center, the "unison" command will be linked autommatically to unsion-gtk. This won't allow you to create a completely silent script because this will open the gtk window. In this case you need to look for the command line tool and call this command directly Eg. unison-2.32.52

miércoles, 13 de octubre de 2010

Glassfish installation broken after ubuntu update.

Yesterday I updated from Ubuntu 10.04 to 10.10 and all seems to be working fine. The only problem I found is that my glassfish v2 installation is broken and when I tried to start the server from the shell I got this error:


./asadmin start-domain command
./asadmin: 19: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/../bin/java: not found


To resolve this problem you can follow this workaround:

First I find that after update, my official SUN JDK was replaced with OpenJDK that doesn't work quite well with glassfish. So the first step is completly uninstall the OpenJDK or at least change the current path to /usr/bin/java.

To set the Java PATH to the official JDK execute this command and select SUN Java implementation:


sudo update-alternatives --config java
Hay 2 opciones para la alternativa java (proporcionando /usr/bin/java)

Selección Ruta Prioridad Estado
------------------------------------------------------------
0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 modo automático
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 modo manual
* 2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 modo manual



Next I set the JAVA_HOME adding this lines to the end of /etc/bash.bashrc:


JAVA_HOME="/usr/lib/jvm/java-6-sun"
export JAVA_HOME


Finally, fix the AS_JAVA property in ../glassfish/config/asenv.conf to the correct path:


AS_JAVA="/usr/lib/jvm/java-6-sun"


Done, now glassfish should start and work flawlessly.