25 June 2018

Google Play warning: Your app contains a SQL Injection issue

If you get Google Play warning on your Google Play Developer Console, than maybe there is simple solution. In your AndroidManifest.xml file just set :


and than recompile project, rebuild APK, and reupload new version to Google Play Developer Console.

18 June 2018

FreshRSS: Delete duplicate entries by title

If you have duplicate entries in your FreshRSS database, here is method for delete duplicate entries by title via phpMyAdmin:

Next SQL statement SELECT ALL duplicate entries by title:

SELECT * FROM `freshrss_slpadmin_entry` AS a
   SELECT title
     FROM `freshrss_slpadmin_entry`
     GROUP BY title
   HAVING COUNT( * ) > 1
 ) AS b ON b.title = a.title
ORDER BY a.title

Next SQL statement SELECT duplicate entries by title with higher id:

SELECT * FROM `freshrss_slpadmin_entry` AS a
   SELECT title, MIN(id) AS min_id
     FROM `freshrss_slpadmin_entry`
     GROUP BY title
   HAVING COUNT( * ) > 1
 ) AS b ON b.title = a.title
AND b.min_id <> a.id
ORDER BY a.title

Next SQL statement DELETE duplicate entries by title with DIFFERENT id:

DELETE a.* FROM `freshrss_slpadmin_entry` AS a
   SELECT title, MIN(id) AS min_id
     FROM `freshrss_slpadmin_entry`
     GROUP BY title
   HAVING COUNT( * ) > 1
 ) AS b ON b.title = a.title
AND b.min_id <> a.id 

14 June 2018

Wordpress SQL cleanup database for duplicate and old data

If you want to cleanup your Wordpress database for some duplicate and old data there is SQL commands to do it via phpMyAdmin :

This SQL command will DELETE data for month condition :

DELETE FROM `wp_posts` WHERE `post_type` = "attachment" AND post_modified LIKE '2018-04-%'
DELETE FROM `wp_posts` WHERE `post_type` = "post" AND post_modified LIKE '2018-04-%'

This SQL command will SELECT data with duplicate title :

SELECT a.ID, a.post_title, a.post_type, a.post_status
FROM wp_posts AS a
   SELECT post_title, MIN( id ) AS min_id
   FROM wp_posts
   WHERE post_type = 'post'
   AND post_status = 'publish'
   GROUP BY post_title
   HAVING COUNT( * ) > 1
 ) AS b ON b.post_title = a.post_title
AND b.min_id <> a.id
AND a.post_type = 'post'
AND a.post_status = 'publish'

This SQL command will DELETE data with duplicate title :

FROM wp_posts AS a
      SELECT post_title, MIN( id ) AS min_id
      FROM wp_posts
      WHERE post_type = 'post'
      AND post_status = 'publish'
      GROUP BY post_title
      HAVING COUNT( * ) > 1
   ) AS b ON b.post_title = a.post_title
AND b.min_id <> a.id
AND a.post_type = 'post'
AND a.post_status = 'publish'

This SQL command will DELETE Trash data:

DELETE wp_posts,wp_term_relationships,wp_postmeta,wp_term_taxonomy FROM wp_posts LEFT JOIN wp_term_relationships ON ( wp_posts.ID = wp_term_relationships.object_id ) LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) LEFT JOIN wp_term_taxonomy ON ( wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id ) WHERE wp_posts.post_status='trash'

This SQL command will DELETE orphaned postmeta data:

FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id

This SQL command will DELETE orphaned relation data:

DELETE wp_term_relationships FROM wp_term_relationships
LEFT JOIN wp_posts ON wp_term_relationships.object_id = wp_posts.ID
WHERE wp_posts.ID is NULL;

After that do Optimize of all table throw phpmyadmin.

Off course, backup your data, before this commands.

11 April 2018

How to unbrick HTC Desire 526G - SP Flash Tool method (fastboot mode)

Follow the next steps:
1. Get SP flash tools (Latest version)
2. Download your phone's firmware (from manufacturer site or needrom.com etc) and extract it.
3. install Mediatek Preloader drivers as per your OS version (win x7 , 8 10 etc) and architecture (32/64bit).
4. Run Flash tools with admin as administrator
5. select the scatter file from the firmware folder you downloaded and wait for it to load. (Do not connect your phone yet and leave the battery inserted)
6. Select Download Only
7. Hit the download button
8. Now plug in the micro/type C usb end of your cable to your phone but dont plug to PC. yet
9. While hold down both volume buttons i.e up and down buttons, (Do not press the power button), Insert the Usb cable end to your PCs usb port (Please choose a port thats very reliable).
10. After a while, P Flash tool will begin to upgrade your phone, dont release the buttons yet, let it lapse about 2mins then release them, the firmware upgrade will still continue and it will display a tick pop-up when done (this may take between 5-10mins).
Now unplug your phone, remove and re-insert the battery and power-up your phone. You phone is now unbricked.
Note that the first boot will longer than a regular boot.

Source: XDA Forum

23 January 2018

Error on installing Windows 10 Update 1709

If you get error message from Windows Update : ”We couldn’t update system reserved partition” in a new window then:

* Search for cmd. Press-and-hold or right-click on Command Prompt in the results, and select Run as administrator.

* At the command prompt, type mountvol y: /s and then hit Enter. This will add the Y: drive letter to access the System Partition.

* Switch to the Y drive by typing Y: and press Enter.

* Then, navigate to the Fonts folder by typing cd EFI\Microsoft\Boot\Fonts.

* Once there, type del *.* to delete font files. The system may ask you if you are sure to continue, press Y and then Enter to continue.

Now, restart update procedure and it will be OK.

17 January 2018

MS Windows 10 cannot see Network Computers after Update 1709

If you have problem with your Network Computers browsing with Windows Explorer after Windows 10 Update 1709 or similar, than this Update is probably removed SMB 1.0/CIFS File Sharing Support Windows feature, which removed Computer Browser Windows Service.

So, just Add complete SMB 1.0/CIFS File Sharing Support throw Add/Remove Windows Feature,
than your PC will be restared and Computer Browser service will be on list started again.

Now you will see all your Network Computers again.
Source: Microsoft Community Forum

01 December 2017

Android Emulator does not Launch in Ubuntu 17.10

I tried to run the Android Studio 3 emulator on fresh installed Ubuntu 17.10 to test an app I'm working on. And I got this error in Android Studio Event Log:

libGL error: unable to load driver: i965_dri.so
AVD Emulator: Process finished with exit code -1

Type in Terminal:

$ cd ~/Android/Sdk/emulator/lib64/libstdc++
$ mv libstdc++.so.6 libstdc++.so.6.bak
$ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6

That's it!

Now my Android Studio 3 emulator is working again!

HP 850 G3 Grub Multiboot Ubuntu and Windows 10 on UEFI

After I installed Microsoft Windows 10, and then alongside Ubuntu, with UEFI bootabled USB disks,
last setup (Ubuntu) created Grub configuration, which is listed in HP UEFI BIOS sequence, but after power on, system get Grub Bush command prompt, without listed operating systems, like Ubuntu, Windows e.t.c., unabled to boot.

Solution: In HP BIOS setup put in a 5 (or more) seconds delay in the "Boot Options" menu. Then, when you switch on your notebook, you'll have 5 (or more) seconds to choose "ubuntu" among the possible boot options (it should be the first one).

I think that those 5 seconds delay give HP enough time to recall all UEFI and other partitions and successfully recall Grub menu.

06 November 2017

How to solve FreshRSS cron job - actualize_script.php file not found - error 404

If you get - file not found - error 404 - after update FreshRSS,
- just change the actualize_script.php file permission to '0644' from your cPanel File Manager and script will be accessible from cron-job.org.
- and put .htaccess in same folder with these lines:

order deny,allow
Allow from all
Satisfy all

13 September 2017

06 September 2017

Android SDK emulator - GPU driver issues

If you have an Intel HD Graphics running the Android SDK emulator in slow software mode, it's intended that a compatibility OpenGL renderer is not used.

I'm sorry about it, but we need to be able to switch to better-supported Intel GPU drivers especially when running high API levels (25+) of system images. Intel iGPUs of that generation (and older) have many issues with OpenGL compatibility.

You could try in terminal:

emulator -list-avds
emulator -avd <AVD_NAME> -gpu host

but that is not permanent fix.

Real resolution to this problem is fine tune the Android emulator with next procedure:

If you'd still like to use the native OpenGL renderer on a Intel HD GPU (at your own risk), go to :

Settings (in Android emulator)
section: General

option: OpenGL ES renderer (requires restart)
select: ANGLE (D3D9)

option: OpenGL ES API level (requires restart)
select: Compatibility (OpenGL ES 1.1/2.0)

and restart your Android emulator in HAX fast virtual mode with hardware rendering...

Source: Google Issue Tracker - Discussion : GPU driver issue