El blog de Juan Palómez

16 diciembre 2014

Recovering irresponsive Windows 7 system (caused by Process Explorer, procexp.exe)

Filed under: Uncategorized — Etiquetas: , , — thisisoneball @ 14:35
  • My system became almost irresponsive, the laptop fan went full speed (suggesting 100% CPU usage by some process) and the task bar dissapeared. Alt+Tab works but the response is very slow. I had some important unsaved documents.
  • If you have the same problem, perform these steps (even if it seems it’s not responding, just wait a bit, it can take as much as 30 seconds for each step): Press Ctrl+Shift+Esc to launch Task Manager, then click on the Processes tab, then click the CPU tab so that it shows the highest CPU processes first (in my case procexp.exe showed 99% CPU usage), click the highest CPU process and press Alt+E (Alt+F if your Windows installation is in Spanish).
  • After that process is killed everything goes back to normal. If the task bar is still not there, run “explorer.exe” using Task Manager

16 noviembre 2014

Wifi connection drops when downloading from Steam

Filed under: Uncategorized — Etiquetas: , , , — thisisoneball @ 14:42

I’m using a USB Wifi adapter: Belkin F7D1101 V1, and it works fine except when downloading games from Steam. The Wifi connection drops and this icon appears: wifi drop

The Internet link and wifi router are OK as the other devices connected to it keep connected to the Internet; limiting download speed in Steam’s options didn’t solve the problem.

If this happens just go to Control Panel and open the USB adapter advanced options, then change ‘Wireless Mode’ from ‘802.11b/g/n’ to ‘802.11b/g’

wifi drop

This will lower the Wifi speed from 150 Mbps to 54 Mbps… My Internet connection is 50 Mbps so there is no downside, except if you’re transferring lots of data in your local Wifi network.

15 noviembre 2014

Ojo con estos números

Filed under: Uncategorized — thisisoneball @ 21:44

Ojo con estos números de móvil de España, para cualquier aclaración mándame un mensaje privado

639838835 (639 838 835) (639 83 88 35)
673622896 (673 622 896) (673 62 28 96)
657777683 (657 777 683) (657 77 76 83)
634014567 (634 014 567) (634 01 45 67)


18 abril 2013

Memory usage treemap / WinDirStat for memory

Filed under: Uncategorized — Etiquetas: , , , , — thisisoneball @ 15:11

Warning: this is a quick hack, it’s not complete and it has bugs. Feel free to correct them and send me the changes.
Also, unlike WinDirStat, measuring memory usage is more difficult than measuring disk space. There are many different memory sizes for one process (Private Bytes, Working Set, Virtual Size, …), this just uses the output of the Windows tasklist command.


It’s a Perl program that tries to run that command, parses the output, and uses Google Charts Treemap to render the output.
It prints the HTML to stdout so the best way to run it is:
perl memoryusage.pl > memoryusage.html && start memoryusage.html

my %groups = ();
my $output;

my $output_pre = "
            <script type='text/javascript' src='https://www.google.com/jsapi'></script>
            <script type='text/javascript'>
              google.load('visualization', '1', {packages:['treemap']});
              function drawChart() {
                  // Create and populate the data table.
                  var data = google.visualization.arrayToDataTable([
                    ['Process', 'Parent', 'Size'],
                    ['root',    null,                 0],

my $output_post = "

                  // Create and draw the visualization.
                  var treemap = new google.visualization.TreeMap(document.getElementById('chart_div'));
                  treemap.draw(data, {
                    minColor: 'red',
                    midColor: '#ddd',
                    maxColor: '#0d0',
                    headerHeight: 15,
                    fontColor: 'black',
                    showScale: true});

    <div id='chart_div' style='width: 900px; height: 500px;'></div>

open TASKLIST, "tasklist /nh /fo CSV |" or die "Can't execute tasklist command $!\n";
while (<TASKLIST>) {
        if (m/"(.+)","(.+)",".+",".+","(.+) KB?"/) {
                $name = $1;
                $pid  = $2;
                $size = $3;
                $size =~ s/\.//;
                $output .= "['$pid','$name',$size],\n";
                $groups{"$name"} = 1;


while ( my ($key, $value) = each(%groups) ) {
        $output .= "['$key','root',0],\n";

chop $output;
chop $output;

print $output_pre . $output . $output_post;

17 marzo 2013

Automysqlbackup additions

Filed under: Uncategorized — Etiquetas: , — thisisoneball @ 16:05

These are some things I add or change to the default AutoMySQLBackup script:

  • mysqldump options
OPT="--quote-names --opt"

For this section you should read the mysqldump documentation, but this is what I use:

OPT="--quote-names --opt --routines --single-transaction --skip-dump-date"

–routines dumps your stored procedures and functions along with the tables (it creates DROP PROCEDURE and CREATE PROCEDURE statements in your dump file). Routines are also stored in the information_schema database, so if you are also dumping that database, the routines will be there anyway.

–single-transaction avoids this kind of error:

mysqldump: Got error: 1449: The user specified as a definer (‘root’@’%’) does not exist when using LOCK TABLES


this eliminates the “– Dump completed on xxxx-xx-xx” line at the end of each dump file. Otherwise, dumps from identical schemas appear to be different. With this, the files are identical and you can delete duplicate files and save disk space

  • Parallel compresion

Compression of the dump files was taking too long in my system, as the files are big and I also use bzip2 instead of gzip because of its higher compression rate.
So I installed the pbzip2 package, which can use several CPU cores at the same time, unlike bzip2. I have a 4-core processor so I use -p3 so that it uses 3 cores in parallel. By default it autodetects the number of cores, which is usually ok, although if the processor has Hyperthreading I would recommend setting the number manually, because it can autodetect twice the real number of cores. I also remove the -v switch as it’s too verbose in pbzip2

Original options:

BZIP2="`${WHICH} bzip2`"
${BZIP2} -f -v ${1} 2>&1

My options:

BZIP2="`${WHICH} pbzip2` -p3"
${BZIP2} -f ${1} 2>&1
  • Skipping backup

In my server some DB processes can take days to complete, and in that case I prefer not to run the DB backup. I read the /proc/loadavg file (which shows the same system load values as the uptime or top commands) to check if there is something running (this is a dedicated DB server so if the load is high it should be the DB causing it):

if [ "$(cut -f1 -d. /proc/loadavg)" -gt 1 ]
    echo "System load too high, skipping backup"
    exit 10

15 marzo 2013

Traducir documento de Word “in situ”

Filed under: Uncategorized — Etiquetas: — thisisoneball @ 20:40


Esto sirve para traducir el texto de un documento dentro del propio documento, manteniendo el formato y las imágenes.

Puedes usar translate.google.es, pinchar en “traduce un documento”, y ahí seleccionar el archivo desde tu PC, y el resultado se muestra en una página web, aunque sin imágenes.
Otra forma es abrir el documento en Word, ir a Archivo -> Guardar como -> Guardar como Página Web.
Abre el archivo resultante con Google Chrome y el propio navegador sugerirá traducir la página. Si no es así haz click derecho en la página y selecciona Traducir.

1 marzo 2013

Ver progreso de lectura o escritura de un archivo

Filed under: Uncategorized — Etiquetas: , , , , — thisisoneball @ 17:51

A veces un programa tarda mucho tiempo en procesar un archivo y no muestra el progreso de la operación que está haciendo ni dice la hora aproximada a la que va a terminar. Pero el sistema operativo tiene información sobre los ficheros abiertos y con el software adecuado se puede mirar la posición en bytes que se está leyendo o escribiendo en un momento dado.

En Windows XP puedes usar el programa FileMon (File Monitor) y en XP/Vista/7 Process Monitor:
En la columna Other aparece un campo Offset que es la posición en el fichero en bytes. Este programa puede sacar demasiada información así que conviene filtrar las filas por nombre de archivo o por proceso.
Si usas Process Monitor, para que haga lo equivalente a File Monitor hay que pulsar el botón “Show File System Activity”

En Linux, como root, hay que buscar el PID del proceso que tiene abierto el archivo (puedes usar ‘ps’ y deducir qué proceso es o usar ‘lsof’ para ver qué archivos tiene abierto cada proceso). Lista el contenido del directorio /proc/[PID]/fd , y busca ahí el archivo. Por ejemplo

2 -> /var/log/httpd/error_log

Cogemos el número de la izquierda y hacemos ‘cat /proc/[PID]/fdinfo/2′ y el campo ‘pos’ es la posición en bytes en el archivo.

Otros comandos interesantes para Linux/Unix son ‘bar’,’pv’ e ‘iostat’

4 abril 2012

Custom / alternative netboot.me configurations

Filed under: Uncategorized — Etiquetas: , , , , — thisisoneball @ 14:59

This is my list of custom netboot.me configurations. The ones in the official page are not up to date so with this ones you can boot recent rescue Linux distros or install a distro.
More information on custom configurations: http://www.netboot.me/help#chainload

URL / Configuration ID Type Distribution Size Version
528003 ISO Trinux 9.5 MB tubuntu-ruby-0.1-
574002 OS Kernel CentOS 35 MB Installer for 6.2 x86_64
575001 OS Kernel openSUSE 50 MB Installer for 12.1 x86_64
576001 OS Kernel Debian 10 MB Installer for stable version x86_64

29 marzo 2012

MPlayer binary with AAlib for Windows+Cygwin

Filed under: Uncategorized — Etiquetas: , , — thisisoneball @ 14:04

Mplayer for Windows doesn’t usually have AAlib support, so I built this binary on Cygwin. You can download it with the link below

Available video output drivers:
        direct3d        Direct3D 9 Renderer
        gl              OpenGL
        gl2             X11 (OpenGL) - multiple textures version
        matrixview      MatrixView (OpenGL)
        aa              AAlib
        winvidix        WIN32 (VIDIX)
        cvidix          console VIDIX
        null            Null video output
        mpegpes         MPEG-PES file
        yuv4mpeg        yuv4mpeg output for mjpegtools
        png             PNG file
        tga             Targa output
        pnm             PPM/PGM/PGMYUV file
        md5sum          md5sum of each frame

Available audio output drivers:
        win32           Windows waveOut audio output
        oss             OSS/ioctl audio output
        mpegpes         MPEG-PES audio output
        null            Null audio output
        pcm             RAW PCM/WAVE file writer audio output

It needs: cygaa-1.dll, cygX11-6.dll, cygwin1.dll, cygxcb-1.dll, cygXau-6.dll, cyggcc_s-1.dll, cygXdmcp-6.dll, cygncurses-9.dll, cygz.dll

Version: MPlayer SVN-r34823-snapshot-3.4.4 (C) 2000-2012 MPlayer Team

Build options: –disable-mencoder –enable-aa –yasm=” –cc=gcc-3

I use this options for playing in a 16:9 screen: mplayer -vf pp=lb -vo aa:contrast=60 -quiet -monitorpixelaspect 0.5625

Link: mplayer.rar

23 diciembre 2011

Wappo solver

Filed under: Uncategorized — Etiquetas: , , , , — thisisoneball @ 17:22

This is a Lisp program that solves any level of the game Wappo. It’s a Java game that came with Siemens mobile phones.

You have to code the layout of the level you want to solve. At the end of the program you can see the example for the first three levels of the game. You have to enter the starting coordinates of Wappo, one or more Yumchaks (the enemies), the pits, the walls (in this case you enter the coordinates of the two tiles that surround the wall), and the exit.

It will print the sequence of moves you have to make. Works at least with CLISP for Windows

;; (board wappo (yumchaks) (pits) (walls))
;; (setq state (cons (make-list 6 :initial-element (make-list 6)) '((3 4) ((5 4)) ((1 4)) ((1 3 1 4) (3 4 3 5) (5 4 5 5) (5 4 4 4) (5 0 4 0)))))

(defun allowed (state from to)
(let (wall pit)
  (setq from (subseq from 0 2))
      (> (first to) 5)
      (< (first to) 0)
      (> (second to) 5)
      (< (second to) 0)
      (dolist (wall (fourth state) t)
        (if (or (equal (append from to) wall) (equal (append to from) wall))
            (return nil)))
      (if (equal from (first state))
        (dolist (pit (third state) t)
	  (if (equal to pit)
	      (return nil)))

(defun randomize-list (l)
  (if (not (null l))
    (let ((element (nth (random (length l)) l)))
      (cons element (randomize-list (remove element l)))

(defun depth-search (state)
  (let ((offsets '((1 0) (0 1) (-1 0) (0 -1))) offset destination yumchak i j return-value state2 pit)
    (if (equal (first state) (fifth state))
      (dolist (offset (randomize-list offsets))
(format t "~%>>~A ~A<<" (first state) offset)
;	(setq return-value nil)
        (setq destination (mapcar #'+ offset (first state)))
        (if (allowed state (first state) destination)
	    (setq state2 (copy-tree state))
	    (setf (first state2) destination)
	    (if (dotimes (j (length (second state2)) t)
		  (decf (third (nth j (second state2))))
	          (dolist (i '(1 2))
		    (if (<= (third (nth j (second state2))) 0) (progn
	              (setq yumchak (nth j (second state2)))
		          (< (first yumchak) (first (first state2)))
		          (allowed state2 yumchak (list (+ 1 (first yumchak)) (second yumchak))))
			 (incf (first (nth j (second state2)))))
		          (> (first yumchak) (first (first state2)))
		          (allowed state2 yumchak (list (- (first yumchak) 1) (second yumchak))))
			 (decf (first (nth j (second state2)))))
		          (< (second yumchak) (second (first state2)))
		          (allowed state2 yumchak (list (first yumchak) (+ 1 (second yumchak)))))
			 (incf (second (nth j (second state2)))))
		          (> (second yumchak) (second (first state2)))
		          (allowed state2 yumchak (list (first yumchak) (- (second yumchak) 1))))
			 (decf (second (nth j (second state2)))))
		      (dolist (pit (third state2) t)
	                (if (equal (subseq (nth j (second state2)) 0 2) pit) (progn (print 'pozo)
	                  (setf (third (nth j (second state2))) 4)))         )
	          (if (equal (first state2) (subseq (nth j (second state2)) 0 2))
(progn (print 'yumchak) (return nil)))
;		    (return nil))
;(progn (break)
	        (setq return-value (depth-search state2))
	    (if return-value (return (cons (first state) return-value)))

; (wappo (yumchaks) (pits) (walls) (exit))
(let (state)
  (setq level1 '((3 4) ((5 4 0)) ((1 4)) ((1 3 1 4) (3 4 3 5) (5 4 5 5) (5 4 4 4) (5 0 4 0)) (3 0)))
  (setq level2 '((4 1) ((5 0 0)) ((2 4)) ((0 0 0 1) (1 0 1 1) (4 0 4 1) (3 1 3 2) (0 3 0 4)) (1 0)))
  (setq level3 '((5 0) ((3 3 0)) ((3 1) (5 2)) ((0 0 1 0) (1 0 2 0) (3 0 4 0) (3 0 3 1) (4 0 4 1) (3 1 3 2) (3 2 3 3) (2 2 2 3) (0 3 1 3) (2 4 2 5) (4 4 4 5) (4 4 3 4)) (2 0)))
;  (trace depth-search)
  (print (depth-search level3))
« Newer PostsOlder Posts »

Blog de WordPress.com.