OpenWrt webcam

Install in OpenWrt:
//Go to: services/mpg-streamer
//Set it to: enabled
//That will be all
//Optional: Setup security and other parameters

A still image will be available on:
The stream will be available on:

//If you wanna go further and send a still image directly from the router to some site:

//download it with:

curl -o /www/webcam/images/image.jpg
//upload it to your server with:
curl -F "upimage=@/www/webcam/images/image.jpg"

//to get the code executed each x seconds, set a cron job, or run a command like this:

while true; do date ; curl -o /www/webcam/images/image.jpg ; curl -F "upimage=@/www/webcam/images/image.jpg" ; sleep 10; done

The server PHP code to save the images:

$source = $_FILES["upimage"]["tmp_name"];
$destination = "image.jpg";
echo move_uploaded_file($source, $destination) ? "OK" : "ERROR";

//To see the image you go to url below
//Refresh to get a new one

//Or you can add a simple html/javascript code that does the trick for you:

function refreshIt(element) {
setTimeout(function() {
element.src = element.src.split('?')[0] + '?' + new Date().getTime();
}, 10000); // refresh every 10 seg

<img=”” src=”/image.jpg” name=”myCam” onload=”refreshIt(this)”>



Posted in Linux | Tagged , | Comments Off on OpenWrt webcam

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, '', '') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, '','');
UPDATE wp_posts SET post_content = replace(post_content, '', '');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'','');
UPDATE wp_revslider_slides SET params = replace(params, '', '');
// 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 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?) 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)


? //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="" 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="" 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