27 October 2018

Google Calendar Event Flair Solution

With the new update of the google calendar, event flairs gadget that were a side gadget have been deprecated. ☹

A quick solution I discovered is that my MS Windows 10 has a virtual keyboard with emoji built in.



I pull up this keyboard and just ad the emoji in Event Title box, that fits my need.

For now, this works perfectly.

Hope this helps others!

20 October 2018

How to clean flash (update) Liquid Remix ROM on Xiaomi Mi A1

Clean Flash (1st setup):

1. Download the ROM and GApps
2. Move your ROM.zip + GApps + TWRP-Installer.zip to your internal storage
3. Advanced Wipe
4. Boot into TWRP linked above
5. Wipe System,Data & Cache
6. Flash the ROM zip and the TWRP-Installer.zip
7. Reboot to Recovery via TWRP (Reboot -> Recovery) ,
8. Flash GApps and Magisk
9. Reboot to System
10. Enjoy Liquid!

Dirty Flash (Update) :

1. Download the ROM and GApps
2. Move your ROM.zip + GApps + TWRP-Installer.zip to your internal storage
3. Advanced Wipe
4. Boot into TWRP linked above
5. Wipe Cache
6. Flash the ROM zip and the TWRP-Installer.zip
7. Reboot to Recovery via TWRP (Reboot -> Recovery) ,
8. Flash GApps and Magisk
9. Reboot to System
10. Enjoy Liquid!

17 October 2018

LiquidRemix Pie rom on Xiaomi Mi A1 with Stock GApps and Google Camera

If you want to successfully flash your Xiaomi Mi A1 with LiquidRemix Pie rom, with GApps ARM64 9.0 Stock edition and Google Camera, then follow this procedure:

- After flashing XDA flash procedure and first bootup, disable and root uninstall preinstalled Google Camera.
- Then with Magisk Manager install Google_Cam_Fix_for_LineageOS_v1.0 module and restart phone
- Now you could install  GoogleCamera-Pixel2Mod-Arnova8G2-V8.2.apk successfully.
- And finally, you could install Pixel 3 Wallpapers (com.breel.wallpapers18_9.apk).
- After that, everything is like Pixel Expirience with most customisation from this great rom, like Double Tap to Sleep, Double Tap to Wake, Google Assistent e.t.c. ;)

P.S. from XDA: You can use GApps Aroma edition. It allows you to modify the package before flash, so you don't have to uninstall gcam from gapps package and also uncheck any other gapps pre-installed you didn't want to shrink system size.


16 October 2018

How to flash Pixel Expirience 9.0 on Xiaomi Mi A1

Pixel Experience is an AOSP based ROM, with Google apps included and all Pixel goodies (launcher, wallpapers, icons, fonts, bootanimation).

To flash this rom follow these steps:

1. Be sure to remove any PIN, Password, Fingerprint protection

2. Install ADB Tools and Drivers on your PC.

2. Unlock Bootloader if not already done.

   - Power Off the phone by using the Power key at first.
   - Press and hold the Volume Down + Power button for a couple of seconds to enter Fastboot mode
   - You can release held keys when the Fastboot Mode appears on the phone's screen.
   - In ADB folder Terminal type : fastboot oem unlock

3. Reflash stock 8.1, if you are not already on it, with Mi Flash Tool.

4. Boot in to TWRP with Terminal command : fastboot boot recovery.img

  - Then choose Format data and reboot bootloader with same command:
  - fastboot boot recovery.img

5. After boot TWRP again choose to Wipe System, Data and Dalvik Cache.

6. Put rom, twrp and magisk on your phone internal storage with thise commands:

 - adb push PixelExperience_tissot-9.0-20181012-0716-UNOFFICIAL.zip /sdcard
 - adb push twrp-installer-tissot--3.2.3-0.zip /sdcard
 - adb push Magisk-v17.1.zip /sdcard
 - adb push MagiskManager-v6.0.0.apk /sdcard

7. Than flash the ROM, and after that flash TWRP installer.

8. Now Reboot to Recovery.

9. Flash Magisk (Optional)

10. Reboot system. Than you go with first boot and automatic restart.

11. After first boot and setup, install Magisk Manager if it does not appear.
    (Only if you installed Magisk)

12. Profit!

03 October 2018

How to restore GRUB loader after Windows 10 Update

If you just updated your Windows 10 in a multiboot configuration, and Grub no longer appeared, than just had to run in Windows Command Prompt as administrator, next command:

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

and your Grub boot menu should appear in next reboot.

20 September 2018

Automatic Install nVidia drivers in Ubuntu

The first method is the easiest to perform and in most cases it is the recommended approach. First, detect the model of your nvidia graphic card and the recommended driver. To do so execute:
$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001180sv00001458sd0000353Cbc03sc00i00
vendor   : NVIDIA Corporation
model    : GK104 [GeForce GTX 680]
driver   : nvidia-304 - distro non-free
driver   : nvidia-340 - distro non-free
driver   : nvidia-384 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin

== cpu-microcode.py ==
driver   : intel-microcode - distro free
If you agree with the recommendation feel free to use ubuntu-drivers command again to install all recommended drivers:
$ sudo ubuntu-drivers autoinstall
Once the installation is concluded, reboot your system and you are done.

19 September 2018

Start Android Studio in Ubuntu with root privileges

If you have to start Android Studio in Ubuntu with root privileges for regular updates, you should make these commands in terminal:

sudo ln -s /opt/android-studio/bin/studio.sh /usr/local/bin/studio
sudo chmod 777 /usr/local/bin/studio

If you have problem with sudo in Ubuntu you can setup root password with command:

sudo passwd root

Now you can start android studio from anywhere by entering command : studio

11 September 2018

Wordpress: Update default page layout for all posts

To update default page layout for all posts, we need to do it in database table wp_postmeta for all post_id's, with next command:

INSERT INTO wp_postmeta (post_id, meta_key, meta_value) SELECT ID, "mom_page_layout", "right-sidebar" FROM wp_posts WHERE post_type = "post" AND post_status = "publish"

After that, all published posts will have desired page layout.

This is also available for event pages, with command :

INSERT INTO wp_postmeta (post_id, meta_key, meta_value) SELECT ID, "mom_page_layout", "right-sidebar" FROM wp_posts WHERE post_type = "event" AND post_status = "publish"

06 September 2018

Relocate Android Studio SDK and Emulator files

If you want to relocate your Android Studio SDK and Emulator files to different folder or disc, than you have to setup these environment variables :

ANDROID_SDK_HOME                        - D:\Android
ANDROID_EMULATOR_HOME          - D:\Android\.android\
ANDROID_AVD_HOME                        - D:\Android\.android\avd\

After these setup variables, your Android Studio will use these folders.


04 September 2018

Android SQL Injection Vulnerability with exported=false

So here's the problem: when I add the widget to the homescreen, a SecurityException is immediately thrown inside the onDataSetChanged() method when I try to query the provider. This appears to be because the homescreen does not hold the permission to read my content provider.

Because of Google Play Developer Console witch refuse App Submission because of  SQL Injection Vulnerability with exported=false in AndroidManifest.xml, we need to leave that option to false.

While the context is actually correct, it is bound to the wrong process.

So we need to enclose our query in clearing Identiry Token in WidgetService.java:

// Revert back to our process' identity so we can work with our
// content provider
final long identityToken = Binder.clearCallingIdentity();

mCursor = cr.query(EntryColumns.ALL_ENTRIES_CONTENT_URI, new String[]{EntryColumns.TITLE, EntryColumns._ID, FeedData.FeedColumns.ICON}, selection.toString(), null, EntryColumns.DATE + Constants.DB_DESC);

// Restore the identity - not sure if it's needed since we're going
// to return right here, but it just *seems* cleaner
Binder.restoreCallingIdentity(identityToken);

This solves the problem, even without setting read/write permissions on the contentprovider, just using it with exported set to "false".

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 :

<provider
        android:exported="false"
/>

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
 INNER JOIN (
   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
 INNER JOIN (
   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
 INNER JOIN (
   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
 INNER JOIN (
   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 :


DELETE a.*
FROM wp_posts AS a
   INNER JOIN (
      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:

DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL

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