Categorie
Information and Communications Technology

Connecting PowerBI to PostgreSQL

Connecting PowerBI to PostgreSQL generate this certificate error: “The remote certificate is invalid according to the validation procedure”

We need to estabilish a connection adding the certificate to the trusted certificates.

In this example the PostgreSQL server has ip 10.0.0.5 and hostname pgsql-test-server.

Install latest NPGSQL with msi package from (at this time is v4.1.14):

https://github.com/npgsql/npgsql/releases/

Install openssl command line and extract the certificate with this command:

openssl s_client -starttls postgres -connect 10.0.0.5:5432 > %USERPROFILE%\Desktop\pg-server-cert.cer

The file is saved on the user desktop.

Import the certificate in the Trusted Root Certificate.

Then, IMPORTANT, for the connection do not use the ip, you must use the hostname present in the .cer file as CN.

Categorie
Information and Communications Technology

Xiaomi Themes MAML syntax

I’m trying to modify Always-on Display / AOD themes, but unfortunately the documentation for Xiaomi Themes is only in chinese. I found the chinese documentation at this link:

https://zhuti.designer.xiaomi.com/docs/grammar/

In fact most of themes are with chinese characters. So i decided to translate this documentation. I published the work-in-progress translation on github pages at these links:

nikiink.github.io (gihub pages homepage)

nikiink.github.io/MAML-Grammar-en.htm (translation)

nikiink.github.io/MAML-Grammar-ch.htm (original version that works with google translate)

Categorie
Information and Communications Technology

Windows SYSTEM user environment variables

Running a script with task manager using the SYSTEM user the environment variables of this user (on Windows 10) are:

APPDATA: C:\Windows\system32\config\systemprofile\AppData\Roaming
LOCALAPPDATA: C:\Windows\system32\config\systemprofile\AppData\Local
HOMEPATH: <<<EMPTY>>>
Path: <<<SYSTEM_PATH>>>;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps
TEMP: C:\Windows\TEMP
TMP: C:\Windows\TEMP
USERNAME: <<<PC-HOSTNAME>>>$
USERPROFILE: C:\Windows\system32\config\systemprofile

Notes:
HOMEPATH is empty instead of \Users\John for an user named John
USERNAME is the hostname followed by a dollar sign

Categorie
Information and Communications Technology

Xiaomi downloaded files disappear or randomly deleted when moved

I noted a strange issue on my Xiaomi Redmi 9 with Android 11 (i don’t know if the problem is also on Android 10). So, the problem is: when i download a file, if i move it from Download folder to another folder in the internal storage using a file manager different from the Xiaomi one, the file is missing some hours later.

To replicate the issue:

  1. Dowload a file from Google Drive
  2. Create the folder TEST on internal storage
  3. Open Fx File Explorer, open Download folder in the internal storage select and CUT the downloaded file, paste it in the folder TEST in the internal storage
  4. After a day, if you open the folder TEST, the file is missing

[NOTE: for testing the removal, if you don’t want to wait a day, follow these steps: open the Xiaomi Download app, go to downloaded tab, clic on the downloaded file (the file was not found because we moved it), clic on Delete, after that the file will be deleted from TEST folder not from the Download folder where is not]

The workarounds are:

  • Move downloaded files to a folder on the SD card instead of a folder in the internal storage;
  • Use Xiaomi File Manager to move the files from Download folder;
  • Instead of cutting downloaded files copy downloaded files in a folder on the internal storage and than delete it from Download folder.

Categorie
Information and Communications Technology

VoLTE on Xiaomi Indonesian ROM

Sometimes on VoLTE operator, the VoLTE is not working.

I had this problem on Xiaomi Redmi 9 with indonesian ROM (installed for MIUI native call and message apps instead of google ones).

You can solve this problem adding another APN named IMS. This APN must be added only and not selected as active.

So if VoLTE is not working follow these steps:

  • Call: *#*#86583#*#* (enables VoLTE flag in configuration)
  • Add this APN without selecting it:
    • Nome: IMS
    • APN: ims
    • APN type: ims,ia
    • APN protocol: the same of the active APN
    • APN roaming protocol: the same of the active APN
    • change only these parameters, leave the other params unchanged.

NOTE: perhaps this problem is due to the fact that this APN in the EU ROM is already present, but is hidden.

Categorie
Information and Communications Technology

Unpack / Repack Samsung product.img.lz4 to update cscfeature.xml on Android 10

This article is on how to modify cscfeature.xml present in the image product.img.lz4 in the CSC tar.md5 file in the Samsung Firmware images used in Odin.

For this operation root is not required, but are required:

  1. A Samsung phone with UNLOCKED BOOTLOADER
  2. A Linux distribution (i used Xubuntu 18.10 on VirtualBox)
  3. Odin 3.14 (on Windows)
  4. 7-zip (on Windows)

Here is the procedure, it’s a readme, mixed with shell script https://gist.github.com/8ff2894c42c6320a50dc4b70b32a716a

Categorie
Information and Communications Technology

Play Store 403 Error on Android T9 TV Box

If you cannot install any app with Play Store on T9 TV Box, follow these steps:

  1. Download from internet FX File Explorer apk and install it [I downloaded the version: 8.0.3.0]
  2. Download from internet latest Google Play Services.apk and install it [I downloaded the version: 21.02.14 (110400-352619232)]
  3. Download from internet latest Google Play.apk (do not install, you will get an app not installed error) [I downloaded the version: 24.0.32-21 [0] [PR] 356387442]
  4. Open Fx Explorer – Settings – Developer/Root (Confirm)
  5. On Fx Explorer open System (root) and mount it in READ/WRITE (padlock icon) (Confirm when required)
  6. Delete old Google Play apk (it’s in a folder named Phonesky), delete the folder Phonesky in /system/priv-app
  7. Create PlayStore (or name it as you want) directory in /system/priv-app
  8. Rename Latest-Google-Play-Store-too-long-name.apk to a shorter name (if you want)
  9. Copy latest Google Play.apk in /system/priv-app/PlayStore folder
  10. Reboot the tv box

I downloaded the apks from these links:

https://fx-file-explorer.it.uptodown.com/android
https://google-play-services.it.uptodown.com/android
https://google-play.it.uptodown.com/android

Alternative Launcher

This TV Box does not support system wallpapers, so the most of alternative launchers crashes on startup because try to retrieve system wallpaper (that doesn’t exist).

One of the alternative launchers that works is Square Home Launcher.

Categorie
Information and Communications Technology

Run Termux Script Block on Llamalab Automate

To run a shell script on Llamalab Automate you can install Termux, Termux:Api and Termux:Tasker (from F-Droid). Then configure Automate app permission to use Termux Run Command.

Now you can add a Tasker Plug-in block, choose Termux:Tasker and the path of the script (absolute path or relative to folder ~/.termux/tasker/).

Categorie
Information and Communications Technology

Vontar X1 TV Box Remote Control Conflicting with Seleco SE40C FHDTS TV

I coupled the Vontar X1 TV Box with a Seleco SE40C FHDTS TV. Then there is a problem, some keys of the TV remote control wrongly controls the TV box. When watching movies, lowering the volume of the TV, i get back to the My Apps screen (stopping the movie)

The tv VOL- key, matches the My Apps tv box key.

To resolve the problem, we need to remap the remote control keys of the tv box and ignoring the My Apps command (using root access).

To find the keymapping file, i used the Gamepad Tester app. Install it and go to Test Gamepad. Press VOL+ or a number on the tv box remote control, you will see the name of the device:

Name: sunxi-ir-uinput

So, we need to edit the file sunxi-ir-unput.kl. The file is located here:

/system/usr/keylayout/sunxi-ir-uinput.kl

To edit this file, install a file manager app with root support. I used FX Explorer. Follow these steps:

  1. On the TV Box install FX File Explorer
  2. Go to the TV Box Home screen > Gear Wheel (Settings) > About > Root switch > Enable > Restart
  3. After reboot, open FX File Explorer, goto Settings > Developer/Root (choose i understand the risk) and confirm
  4. Then in FX File Explorer goto System (root) > (confirm) > More options > Mount Read-Write
  5. Now we need to edit a file, but the System filesystem is full, if you edit a file the file will be 0 byte after saving, if we not free some space
  6. To free some space on the filesystem go to System (root) > system > preinstall and delete some apk of apps that you can reinstall using google play: Firefox, Chrome, KD (kodi)
  7. Now we can edit the file /system/usr/keylayout/sunxi-ir-uinput.kl
  8. Go to System (root) > system > usr > keylayout
  9. Create a backup copy of the file sunxi-ir-uinput.kl. Copy it and paste it in the Main Storage where you like
  10. Open the file sunxi-ir-uinput.kl with FX Text Edit, go to the line:
    key 234 APPS and place a # at the beginning to ignore this key:
    #key 234 APPS or delete the line
  11. Save the file and go back
  12. Reopen the file to check the modification is saved
  13. Go to FX File Explorer home select System (root) > More options > Mount Read-Only
  14. Disable root from TV Box home screen > Gear Wheel (Settings) > About > Root switch and restart

This is the content of the file sunxi-ir-uinput.kl:

key  1  SOFT_LEFT
key  2  SOFT_RIGHT
key  3  HOME
key  4  BACK
key  5  CALL
key  6  ENDCALL
key  7  0
key  8  1
key  9  2
key  10  3
key  11  4
key  12  5
key  13  6
key  14  7
key  15  8
key  16  9
key  17  STAR
key  18  POUND
key  19  DPAD_UP
key  20  DPAD_DOWN
key  21  DPAD_LEFT
key  22  DPAD_RIGHT
key  23  DPAD_CENTER
key  24  VOLUME_UP
key  25  VOLUME_DOWN
key  26  SCROLL_LOCK
key  27  CAMERA
key  28  CLEAR
key  29  A
key  30  B
key  31  C
key  32  D
key  33  E
key  34  F
key  35  G
key  36  H
key  37  I
key  38  J
key  39  K
key  40  L
key  41  M
key  42  N
key  43  O
key  44  P
key  45  Q
key  46  R
key  47  S
key  48  T
key  49  U
key  50  V
key  51  W
key  52  X
key  53  Y
key  54  Z
key  55  COMMA
key  56  PERIOD
key  57  ALT_LEFT
key  58  ALT_RIGHT
key  59  SHIFT_LEFT
key  60  SHIFT_RIGHT
key  61  TAB
key  62  SPACE
key  63  SYM
key  64  EXPLORER
key  65  ENVELOPE
key  66  ENTER
key  67  DEL
key  68  GRAVE
key  69  MINUS
key  70  EQUALS
key  71  LEFT_BRACKET
key  72  RIGHT_BRACKET
key  73  BACKSLASH
key  74  SEMICOLON
key  75  APOSTROPHE
key  76  SLASH
key  77  AT
key  78  NUM
key  79  HEADSETHOOK
key  80  FOCUS
key  81  PLUS
key  82  MENU
key  83  NOTIFICATION
key  84  SEARCH
key  85  MEDIA_PLAY_PAUSE
key  86  MEDIA_STOP
key  87  MEDIA_NEXT
key  88  MEDIA_PREVIOUS
key  89  MEDIA_REWIND
key  90  MEDIA_FAST_FORWARD
key  91  MUTE
key  92  PAGE_UP
key  93  PAGE_DOWN
key  94  PICTSYMBOLS
key  95  SWITCH_CHARSET
# ir keyboard dont need gamepad key, fix kodi can not use ir keyboard
#key  96  BUTTON_A
#key  97  BUTTON_B
#key  98  BUTTON_C
#key  99  BUTTON_X
#key  100  BUTTON_Y
#key  101  BUTTON_Z
#key  102  BUTTON_L1
#key  103  BUTTON_R1
#key  104  BUTTON_L2
#key  105  BUTTON_R2
#key  106  BUTTON_THUMBL
#key  107  BUTTON_THUMBR
#key  108  BUTTON_START
#key  109  BUTTON_SELECT
#key  110  BUTTON_MODE
key  111  ESCAPE
key  112  FORWARD_DEL
key  113  CTRL_LEFT
key  114  CTRL_RIGHT
key  115  CAPS_LOCK
key  116  POWER
key  117  META_LEFT
key  118  META_RIGHT
key  119  FUNCTION
key  120  SYSRQ
key  121  BREAK
key  122  MOVE_HOME
key  123  MOVE_END
key  124  INSERT
key  125  FORWARD
key  126  MEDIA_PLAY
key  127  MEDIA_PAUSE
key  128  MEDIA_CLOSE
key  129  MEDIA_EJECT
key  130  MEDIA_RECORD
key  131  F1
key  132  F2
key  133  F3
key  134  F4
key  135  F5
key  136  F6
key  137  F7
key  138  F8
key  139  F9
key  140  F10
key  141  F11
key  142  F12
key  143  NUM_LOCK
key  144  NUMPAD_0
key  145  NUMPAD_1
key  146  NUMPAD_2
key  147  NUMPAD_3
key  148  NUMPAD_4
key  149  NUMPAD_5
key  150  NUMPAD_6
key  151  NUMPAD_7
key  152  NUMPAD_8
key  153  NUMPAD_9
key  154  NUMPAD_DIVIDE
key  155  NUMPAD_MULTIPLY
key  156  NUMPAD_SUBTRACT
key  157  NUMPAD_ADD
key  158  NUMPAD_DOT
key  159  NUMPAD_COMMA
key  160  NUMPAD_ENTER
key  161  NUMPAD_EQUALS
key  162  NUMPAD_LEFT_PAREN
key  163  NUMPAD_RIGHT_PAREN
key  164  VOLUME_MUTE
key  165  INFO
key  166  CHANNEL_UP
key  167  CHANNEL_DOWN
key  168  ZOOM_IN
key  169  ZOOM_OUT
key  170  TV
key  171  WINDOW
key  172  GUIDE
key  173  DVR
key  174  BOOKMARK
key  175  CAPTIONS
key  176  SETTINGS
key  177  TV_POWER
key  178  TV_INPUT
key  179  STB_INPUT
key  180  STB_POWER
key  181  AVR_POWER
key  182  AVR_INPUT
key  183  PROG_RED
key  184  PROG_GREEN
key  185  PROG_YELLOW
key  186  PROG_BLUE
key  187  APP_SWITCH
key  188  BUTTON_1
key  189  BUTTON_2
key  190  BUTTON_3
key  191  BUTTON_4
key  192  BUTTON_5
key  193  BUTTON_6
key  194  BUTTON_7
key  195  BUTTON_8
key  196  BUTTON_9
key  197  BUTTON_10
key  198  BUTTON_11
key  199  BUTTON_12
key  200  BUTTON_13
key  201  BUTTON_14
key  202  BUTTON_15
key  203  BUTTON_16
key  204  LANGUAGE_SWITCH
key  205  MANNER_MODE
key  206  3D_MODE
key  207  CONTACTS
key  208  CALENDAR
key  209  MUSIC
key  210  CALCULATOR
key  211  ZENKAKU_HANKAKU
key  212  EISU
key  213  MUHENKAN
key  214  HENKAN
key  215  KATAKANA_HIRAGANA
key  216  YEN
key  217  RO
key  218  KANA
key  219  ASSIST
key  220  BRIGHTNESS_DOWN
key  221  BRIGHTNESS_UP
key  222  MEDIA_AUDIO_TRACK
key  223  TV_SYSTEM
key  224  GOTO
key  225  SUBTITLE
key  226  AUDIO
key  227  ZOOM
key  228  HELP
key  229  FAVOURITE
key  230  LOOP
key  231  EXPAND
key  232  MOUSE
key  233  MOVIE
## 234 CONFLICTS WITH SELECO TV VOLUME DOWN
#key  234  APPS
key  235  BROWSER
key  236  SCREENSHOT
#key	 237  HISENSE_FAC_NEC_DMP
#key	 238  HISENSE_FAC_NEC_OK
#key	 239  HISENSE_FAC_NEC_MAC
#key	 240  HISENSE_FAC_NEC_IP
#key	 241  HISENSE_FAC_NEC_M
#key	 242  HISENSE_FAC_NEC_AGING
Categorie
Building Information and Communications Technology

Converting Microsoft Word drawings to DXF

I had some drawing in Microsoft Word that i want to convert to DXF. Using this procedure you can convert the drawings to DXF format.

You need these softwares:

  • Libreoffice Writer (free)
  • Libreoffice Draw (free)
  • Inkscape (free)

I followed this procedure:

  1. Open Word files with Libreoffice Writer
  2. Delete not correctly rendered objects
  3. Group all objects in a single group and copy this group
  4. Open Libreoffice Draw and paste the copied group
  5. Export in SVG format
  6. Open the SVG file with Inkscape
  7. Save as DXF R12