Author Archives: aesptux

About aesptux

Computing student. He likes gadgets, operative systems, android, databases, linux, programming and so on..

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

Posted in Bash, Linux, Programming | Tagged , , , , , , , , , , | Leave a comment

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

Posted in Php, Programming | Tagged , , , , , , , , | Leave a comment

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

Posted in backup, Linux, Programming, Python | Tagged , , , , , , , , , , | Leave a comment

Reset NICs by unloading / loading network drivers

This script is specially useful when you clone VMs, but can be used in any other kind of situation where you have problems with network cards, say, duplicated cards for X reason. Try to run this script I wrote: if … Continue reading

Posted in Linux, Networking | Tagged , , , , , , , , , , , , , , , , , | Leave a comment

How to unlock files on Windows 7

It may happen that you are running several applications writing/reading on several files, then for example, you want to delete one of those files and you cannot because file is being used. On Linux systems it allows you to know … Continue reading

Posted in Windows | Tagged , , , , , , , , , , | Leave a comment

Transactions with MySQL.

If you want to use transactions with MySQL, you will have to use InnoDB engine, because the default engine on MySQL 5.1 (MyISAM) does not support transactions. Otherwise, if you use MySQL 5.5 you do not have to worry about … Continue reading

Posted in Databases, MySQL | Tagged , , , , , , , | Leave a comment

Check whether Ubuntu requires a reboot or not

To find whether Ubuntu requires a reboot or not, is as simply as checking if a special file exists. To do so: file /var/run/reboot-required ————————– ls /var/run/reboot-required | grep required If the file exists, system would require a reboot.

Posted in Linux | Tagged , , , , | Leave a comment

Generate random password with apg.

Quick tip. If you want to generate a random password, you could use /dev/random, but it is more complex than using apg (Automated Password Generator). So, to install apg on Fedora, run this command: # yum install apg Useful parameters: … Continue reading

Posted in Linux | Tagged , , , , , , , , , , , , | Leave a comment

Videogame hacking. Cheat on almost every offline game.

Sometimes we get stuck on a game, and we use cheats, that is ok. But in certain cases there is no cheats or are very limited. In games like Dead Space 2 it is not possible, I did not find … Continue reading

Posted in General | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

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

Posted in Bash, Linux | Tagged , , , , , , , , , , , , , , , , | Leave a comment