Search
Donate
Buy me a beer. Or help me to maintain my blog :)
aesptux
Friends blogs
Forums
Fedora release
Categories
Archives
- May 2012
- April 2012
- March 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- May 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- April 2009
Linux Registered User
Category Archives: Programming
Convert m4a files to mp3 with this script.
Some of my library was in m4a files, which I have problems to play, furthermore I prefer having everything in mp3 format. So I wrote the following script: echo “Dependencies: mplayer and lame” if [ $# -lt 1 ]; then … Continue reading
Quick tip: Adding and substracting dates in PHP
More simple than it may seems. It will take care of adjusting months and days automatically: Working with days: // My date Y-m-d $mydate = “2012-05-06″; //Adding five days $newdate = date(“Y-m-d”, strtotime($mydate. ” +5 days”)); // Substracting five days … Continue reading
Python script to backup and restore rpm packages
I’ve written a simple Python script to backup and restore installed rpm packages. On Ubuntu, I used APTonCD for this matter, but in this case, for Fedora I decided to use my own script. The usage is quite simple, only … Continue reading
Short and useful tip: How to make “tail -f” beep on each new line.
Just in case you do not know, tail prints the last ten lines of the indicated file. Like this: tail /var/log/yum.log Furthermore, if you want to print more lines you can do it with -n parameter: tail -n 20 /var/log/yum.log But … Continue reading
Functions: How to return more than one value.
We cannot return two variables from a function, but we could use an array for that. So for example, in JavaScript, it would be like this: function foo() { // do something here // whatever return [myvalue, myothervalue, otherthing]; } … Continue reading
Posted in Programming Tagged c, development, how to, JavaScript, more, one, php, Programming, return, several, two values, value Leave a comment
Nuevo script para realizar backups
Ayer estuve escribiendo un nuevo script para realizar los backups en mi sistema, ya que mis necesidades han cambiado. El script está adaptado a mi sistema y como digo, mis necesidades, pero quizás os pueda servir a vosotros. #!/bin/bash # … Continue reading
Comenzando con Git. Primeros pasos
Lo primero será registrarnos en http://www.github.com y una vez tengamos la cuenta, procedemos a instalarlo si no lo tenemos instalado. $ sudo apt-get install git Ahora tenemos que generar nuestra clave SSH (antes tenemos que tener instalado ssh) $ ssh-keygen -t … Continue reading
Posted in Internet, Programming Tagged add, como, fork, git, github, hacer, master, origin, pasos, primeros, push, repositorio Leave a comment
Condiciones en PHP.
Una condición es básicamente una decisión, resultado de una condición específica. Por ejemplo: <?php $edad = 16; print “Tu edad es $edad\n”; if ($edad < 18 ) { print “Eres joven, disfruta.\n”; } else { print “No eres menor de … Continue reading
Posted in Php, Programming Tagged case, condiciones, elif, else, if, limpio, operador, ordenado, php, si, si no, switch Leave a comment
Operadores en PHP.
Operadores aritméticos // Suma $a + $b; // Resta $a – $b; // Multiplicación $a * $b; // División $a / $b; // Módulo $a % $b; // Sumar y asignar // Para sumar $b al valor actual de $a, … Continue reading
Posted in Php, Programming Tagged and, aritméticos, asignación, cadenas, concatenación, división, igual, logico, mayor, menos, módulo, multiplicación, not, operadores, or, php, referencia, resta, strings, suma 1 Comment
PHP Deprecated: Comments starting with ‘#’ are deprecated
Si estáis tratando de ejecutar algún script php desde la terminal de linux o crontab, y os sale algún error como este: PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0 … Continue reading →