WordPress Mysql Migration

Magic formula:

Most free plugin to “backup” charge your migration, when is a matter of running few lines of code on your database…

UPDATE wp_options SET option_value = replace(option_value, 'http://oldurl.com', 'https://newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://oldurl.com','https://newurl.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://oldurl.com', 'https://newurl.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://oldurl.com','https://newurl.com');
UPDATE wp_revslider_slides SET params = replace(params, 'oldurl.com', 'newurl.com');
// last line only needed if you use revslider, a lot of themes do now...


Posted in Uncategorized | Tagged , | Comments Off on WordPress Mysql Migration

WordPress Auto Lazy Loading

New wordpress (since?) Has an automatically lazy loading for images.. if that broke your site, you can disable it with the following code:
add_filter( 'wp_lazy_loading_enabled', '__return_false' );


Posted in Uncategorized | Tagged | Comments Off on WordPress Auto Lazy Loading

Monero v0.15.0.0 Hacked Client

—–> WARNING <—–

—–> ok <—– (matching hash from https://web.getmonero.org/downloads/hashes.txt)
monero-win-x64-v0.15.0.0.zip 72.14 MB

monero-wallet-cli.exe 37.06 MB

—–> bad <—– (unknown version retrieved from official site!!)
monero-wallet-cli.exe is modified, and monero-gen-trusted-multisig.exe is missing (to make it look as the same size?)
monero-win-x64-v0.15.0.0.zip 73.61 MB

monero-wallet-cli.exe 65.14 MB

Posted in Cryptocurrency | Tagged | Comments Off on Monero v0.15.0.0 Hacked Client

Clear opcache in PHP

If you are working on a shared environment and deleted PHP files keep around, check how to clear empty the cache…
In this case we found the server used “opcache” so with the function opcache_reset() we can get rid of the cache…

If you don’t have shell access, simply create a PHP file like this: clearcache.php
And add this code:


Run it! and you are ready 🙂



Posted in Linux, Medium Technical | Tagged , , , , , | Comments Off on Clear opcache in PHP

One Click Monero Win Node

# One Click Monero Win Node

#1 – download monero core + monero blockchain

#2 – import blockchain on custom dir, guard-against-pwnage=verify [only run with a trusted blockchain.raw]
monero-blockchain-import –data-dir x:\Monero\ –guard-against-pwnage 0 –input-file blockchain.raw

#3 – run on custom ip, remember open firewall [change port/config firewall]
monerod –data-dir x:\Monero\ –rpc-bind-ip –rpc-bind-port 18080 –restricted-rpc –confirm-external-bind

#4 – start as a service, [use a custom restricted access user]


Posted in Basic Technical, Cryptocurrency | Comments Off on One Click Monero Win Node

Android APK Modification

An APK file is a ZIP file with the files inside with certain structure so it can serve as installer.
So for a basic modification, you can just rename the file to “.ZIP” extract the files and do whatever you want and then archive it again as a zip and rename back to APK.
If you preserve the structure, it should work, and in that way you can modify some things…

If you are looking for getting into the code you will need to decompile the file with some kind of tool, for this case I used “Apktool” that is an Android decompiler.
Then you can take a look inside (some of*) the code, modify and recompile it. Taking note that Android installers need to be signed so it can be installed without hassle, and for that will use “jarsigner”.

#install java sdk, install apk tool

apktool d someapp.apk -o someapp_disassembled

#mod code
#use a editor (text,graphics,etc) to modify code files

apktool b someapp_disassembled/ -o someapp_modded.apk

#create your own signature (this have to be done only one time)
keytool.exe -genkey -v -keystore my-release-keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 365

jarsigner.exe -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-keystore someapp_modded.apk alias_name

* Not all code will be decompiled, there are static libraries (“.so”,etc) and java files (“.jar” with “classes.dex”) that are not decompiled
So if you also need to step into the deep code…
For static “.so” libraries you will need a disassembler for the platform that is based the APK (usually ARM), in this case you can use IDA. (Use of IDA not covered on this post)
For “.jar” files you will need something like “dex2jar” that decompile the classes, and something to read the classes like “jd-gui”. (Use of these tools not covered on this post)
And as compilation of these files vary a lot, I recommend that if you want to change something on those files, just use a binary editing tool.

Even if you can unarchive an APK and archive it back using a archive tool (Winrar,etc), it is not recommended, because not all the files inside an APK are archived on the same way. For example there are some resources that are archived without compression (stored), and doing that can cause the app to crash. (If it tries to read a file that it think that is not compress and it is) [Ex: “This file can not be opened as a file descriptor; it is probably compressed”]
Sign an APK with your custom signature could make it unable to be installed, you can replace the signature with the original and force android not to check the signature (And/or hot replace, “base.apk” on the device app folder) (Not covered on this post, take a look of “lucky patcher”)
Some apps share data with other apps of the same author, so again, if you are unable to install, try to delete (if is possible) any other application that might cause conflict. If the conflicting app cannot get installed because it is preloaded with the OS you can try to use tool to unistall system apps, or (recommend) switch the ROM to a custom one that does not have anything installed…
If something crash or does not work, does not install, etc. check the logs, their are your friend. (Ex. “ADB install” gives your the exact error [one one word] of why it fail)

Apktool: https://ibotpeaches.github.io/Apktool/install/
dex2jar: http://code.google.com/p/dex2jar/
jd-gui: http://jd.benow.ca/
IDA: https://www.hex-rays.com/products/ida/index.shtml

? //TODO


Posted in Android, Medium Technical | Tagged , , , , , , , | Comments Off on Android APK Modification

Install certificate as System on Android

Use OpenSSL to transform the certificate to Android format (that is cert+info)
Extract ID using this command:
openssl.exe x509 -inform PEM -subject_hash -in charles.pem
It is the first line.
Name the certificate ID.0 (Ex: ce554431.0)
Extract certificate info using:
openssl.exe x509 -inform PEM -text -in charles.pem>somefile.txt
Then take the cert text and append the info and save it as ID.0

Certificate should be something like:

Then copy the certificate in the Android device to:

Or, if the certificate is already installed as user you can copy to system:
Copy it from:

On both cases remember to set the permissions and user like the other certificates on the same folder, and that should be…

– Some version of OpenSSL could give you a wrong ID, that will make the certificate not usable. In this case we used “OpenSSL 0.9.8h 28 May 2008 – GnuWin32”


Posted in Android, Security | Tagged , , , | Comments Off on Install certificate as System on Android

jQuery lazy image loading…

Just a speed up trick, if you have lot of images or big images, to allow the browser to render and show the page before load the images you can do a “lazy” loading, that means that you load a marker or empty images with HTML, and with JavaScript/jQuery you update the resources.

<img src="/empty.png" data-src="http://domain.com/image.jpg" alt="" width="200" height="70" />

//Change lazy images per real
jQuery("img").each(function() {
var $this = jQuery(this);
var imgsrc = $this.attr('data-src');
$this.attr('src', imgsrc).removeAttr('data-src');

Note: to minimize the in screen time while the image is loading it is recommended to use progressive encode on the images… or a loader… or the combination of both…


Posted in Medium Technical | Tagged , , | Comments Off on jQuery lazy image loading…

jQuery Playground: The base of AJAX

A very simple trick…

<img id="some-image" src="http://domain.com/image.jpg" alt="" width="200" height="70" />

var someimage = jQuery("img[id='some-image']");
jQuery.get( someimage.attr("src"), function( ) {
// Do something

This (way of client requests) is the base of  AJAX/XMLHttpRequest, in this case is just an image but it can be any kind resource (code, json, java, xml, html) and can be processed asynchronous by the browser on any way to do whatever you want (send data, get data, play with the DOM, etc)…

Note: as this code is written it could cause the resource to load 2 times, so if it is not intended just use another attribute into the img tag, or other variable to get the URL…
Also for simpler things use javascript directly… or jQuery only if you already loaded it for other things… but it senseless load a 100k library to run 2 lines of code, hehe…


Posted in Basic Technical | Tagged , , , | Comments Off on jQuery Playground: The base of AJAX

Speed UP WordPress [or any site]

If you use a shitty server/network or your wordpress theme/plugins/content combination is heavy you can speed up the loading on the side of the client and server side by using a plugin like “W3 Total Cache”; it could set easily the browser needed headers to avoid hops, and also cache things like DB queries, or a in-server cache to save a static copy of the php files pre-generated as static content. The installation it just with a few clicks, the configuration the first time maybe take some time to understand, but once you do it, it is a straight forward procedure, by just enabling some type/s of cache or another according the kind of server that you are using or desired level of cache…

But beware in some cases if you server is not fast enough it can cause the adverse effect!
So here is a clean/neat solution [if you are on linux] to archive at least the browser cache.
Edit the .htaccess file and add something like:
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 day"
ExpiresByType text/html "access plus 1 week"
ExpiresByType image/jpg "access plus 1 month"
<IfModule mod_headers.c>
Header append Cache-Control "public"

This is just a example, as you can see you can set different expiration headers per mime types… [also by file extension, and [lot?] of other parameters]

Tech Note: the header will be constructed as:
Cache-Control: max-age=172800, public

If you need for some rare reason (External cache CDN provider compatibility, better look a like, some standard, etc ) the header like this:
Cache-Control: public, max-age=172800
Just add at the end of the .htaccess file (inside the “IfModule mod_expires.c”) this:
<IfModule mod_headers.c>
Header edit Cache-Control "max-age" "public, max-age"
That will invert the order of the values…
Or directly write the full header [on the order that you want] like this:
Header set Cache-Control "max-age=172800, public"

If you are on windows I guess that there is a “rewrite” rule or something similar to address this issue, but as it weren’t the case, you will have to research by yourself…



Posted in Medium Technical, Wordpress | Tagged , , , , , , , , | Comments Off on Speed UP WordPress [or any site]