lunes, 31 de marzo de 2014

join several pdfs into one single using pdfunite

This is a simple way to join several pdf files into one single file, using pdfunite in GNU/Linux is really easy, just use this line in your terminal:

  pdfunite file1.pdf  file2.pdf filen.pdf out.pdf

few days ago, I need to do this as faster as I could and it really works, have this in mind ok, you never know

all the best

in words from Claudio Fernandez-Araoz

some days ago, reading an article I found these lines from Claudio Fernandez-Araoz, I found them useful, so here they are, first in spanish:

"la clave del exito depende de tres grandes pilares: crecimiento personal para potenciar aquello que se tiene a nuestro alcance mediante el conocimiento, habilidad para tomar decisiones profesionales acertadas yna vez que se comienza a trabajar e inteligencia y capacidad oportuna para saber tomar las decisiones adecuadas"

And, here they are in English -I'm not a certified translator, so bear with me:

"the key of success is based on three key points: personal development to maximize that you have at your range through knowledge, the proficiency to take right and professional decisions once you started to work and intelligence and seasonable capabilities to take right decisions"


Hope, you find this useful

lunes, 24 de marzo de 2014

cmus, text based player

I guess I used rhythmbox as my default player since last 5 years, even if I'm using Debian or Ubuntu, I faced a problem some months ago, I started to develop android apps using Eclipse with ADT plugin, this software requires a lot of RAM, then I tried to use the built-in emulator to test my progress -I hate that emulator- so my available RAM start to decrease and in general the performance of my laptop, don't get confuse, daily I was working with these windows opened:

1. Eclipse+ADT
2.Firefox or Chromium
3. two or three tabs in gnome-terminal
4. libreoffice - sometimes-
5. Nautilus
6. and rhythmbox

now you understand why the performance started to decrease... but I realize that rhythmbox demands like 10% of my CPU and around 5% of RAM, for a player I guess is a lot!, so I decided to start using cmus, it is a text based player, it runs smoother and it is easier to install it, if you want to install it on Ubuntu and have the basics commands, you may read this: http://www.tecmint.com/install-cmus-music-player-in-linux/ and if you want a detailed list of the commands you may read this:  https://github.com/cmus/cmus/blob/master/Doc/cmus.txt.

As a fact, I benchmarked cmus vrs rhythmbox using top command, the results were:

rhythmbox: 9.5% (CPU) and 4.3% (MEM)
cmus: 2.3% (CPU) and 0.5% (MEM)

cool, isn't it?

I'm not saying who is better, in some cases it is necessary to make some room for all the application you need to run, so at least try it. By the way, if you decided to export your playlist from rhythmbox, you will need to do some work in order to adjust it to cmus, just follow this post from me: http://htamayo.blogspot.com/2014/03/customizing-any-text-file-with-sed.html, it could be useful.

PS: it would be cool to create a friendly console based user interface to cmus, in order to use the multimedia buttons functions from your keyboard, if such thing does not exist, I promise to code it, Iĺl let you know.

Cheers

customizing any text file with sed

Well, this is really helpful, if you start to work with GNU/Linux for every purpose in your computer: could be end user, programming, deploying and administering your server, etc. sooner or later you will need to adjust,customize or update text based files with a lot of lines, in case like those ones, you may use commands like "sed" to achieve your purpose.

This post is not an intro to regular expressions, because a topic like that is really complex, this is just how to change/update a text file with a lot of lines using sed, I suggest you to get a good book about regular expressions or start to google about it, seriously, it is really helpful to know about it.

Cool, imagine that you have a File called 'mylist.txt' with 1000 lines, like this:

File001=/ok/ok1/myfile1.txt
Title001="My first file"
File002=/ok/ok1/myfile2.txt
Title002="My second file"
....

1. How to delete all the lines starting with "Title"? here it is the command:
   sed '/Title/d' mylist.txt -> with this line you'll see the changes just in the console, now, if you want to maket it permanently, just use this one:

  sed -i '/Title/d' mylist.txt

  Then, if you do a cat of mylist.txt, you will notice there is no lines starting with "Title".


2. How may I delete all characters in front of the symbol "="?:
   sed s/=[^=]*$// mylist.txt

3. How may I delete all characters behind of the symbol "="?
   sed 's/.*=//' mylist.txt

4. how may I add a string -/home/work/- at the beginning of all lines?
  sed 's/^/\/home\/work\//' mylist.txt

5. Find all numbers in the lines and remove them?
    sed -e 's/[0-9:=]//g' mylist.txt

That's it, don't remember you can check if the results are the needed, then if you want to make the changes permanently, just add '-i' after 'sed' and that's all.

Hope this may help you some day... at least when you need it.

Cheers

jueves, 20 de marzo de 2014

connect your android mobile device in Ubuntu to use it with Eclipse ADT


If you are developing for Android mobile devices using Eclipse with the ADT plugin, it would be a great idea to try your progress in a real android device -believe me , the Eclipse built-in emulator will drive you crazy- so, to get EclipseADT+Ubuntu+Your device work together try these lines:

1. Open a terminal and prompt to the directory where your Eclipse+ADT is installed
2. if you have already open Eclipse type this:
  sudo ./adb kill-server

3. then, type this:
   sudo ./adb start-server
  you should see some notification lines in the command line that the daemon is been loaded

4. to make sure your device is loaded properly, type this:
adb devices

you should see the ID information of your device

Cool; from know go back to Eclipse and if your Run your project, the apk will be generated and send it to your device and it will be loaded as well, from here you may test it and adjust your code. the process is really smooth, you should work entirely using your device, I did this last two months and I could debug my app project.

Hope this help

Cheers

sábado, 15 de marzo de 2014

one tab extension for Google Chrome, all your tabs into a list

This is a good advice, if you use google chrome and you don't have the needed time to read/answer all the information in a website of your interest, you begin to collect lot of tabs opened, then the performance of your browser start to get down -I passed through this last 2 months I was involved in an agile development of project- so this extension for Google Chrome: #onetab is really useful, just install it from here http://www.one-tab.com/ and when you click on the icon at your upper right all your tabs will be grouped into a list - style page, from it, you may open/close them when you want. Really cool, try it.

Cheers