new mint version

I was reading https://blog.linuxmint.com/?p=3926, at the end of the page you will see a lot of donations in May.
I start wondering which country did donated max times. They already put the values, it is 14879 $ anyway I wrote a small code which works in console 🙂
        m=new Map();
jQuery('.entry-content img.flag').each(function() {
n = this.src.split('/').pop().substring(0,2);
if(isNaN(n)){
let count = m.get(n)
m.set(n, count ? count+1 : 1)
}
});
m[Symbol.iterator] = function* () {
yield* [...this.entries()].sort((a, b) => a[1] - b[1]);
}
for (let [key, value] of m) { // get data sorted
console.log(key + ' ' + value);
}

And the winner is USA 🙂 you just need to open dev console, f12 is the shortcut key. and copy paste the code to see yourself. here is the screen gif

linux ming donations of may
How to run the code

Graalvm on windows 10

I have been trying to build graal vm native-image with quarkus for a long time now and I was having multiple errors. And finally made it last weekend. here what I installed.
MSVC tool and the sdk is important otherwise I was getting error related to some command or header not found.
and when I compile https://github.com/ozkanpakdil/quarkus-examples/tree/master/qute-test

Result was 27 mb 🙂
Important thing is user needs to run the mvn from special command prompt, otherwise cl.exe will not be found or may seen other errors
x64 Native Tools Command Prompt for VS 2019 or %comspec% /k “C:Program Files (x86)Microsoft Visual Studio2019CommunityVCAuxiliaryBuildvcvars64.bat”
And other environment variables
C:Usersozkan>mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:ProgramDatachocolateylibmavenapache-maven-3.6.3bin..
Java version: 14.0.1, vendor: Oracle Corporation, runtime: C:Program FilesOpenJDKjdk-14.0.1
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

C:Usersozkan>echo %GRAALVM_HOME%
C:Program FilesGraalVMgraalvm-ce-java11-20.1.0

C:Usersozkan>echo %JAVA_HOME%
C:Program FilesOpenJDKjdk-14.0.1

Spring-boot vs Quarkus

I have been using springboot remote command runner from  ozkanpakdil/CommandRunner around 2 years. And last week I had a chance to play with quarkus. And I really like the startup time and speed of development is two times faster.

So I decided to write same command runner with quarkus and see how it works. ozkanpakdil/quarkus-command-runner 

Only difference is in spring I used hazelcast and in quarkus I used ehcache. Because hazelcast configuration was not easy as in spring-boot.

Then I decided to install haproxy and run these 2 microservices behind it. You can see the configuration here

I must say the “command” running at linux side sometimes takes longer then 60 seconds so I gave haproxy longer timeout instructions. here is the haproxy admin

According to numbers spring having downtimes. actually those are times when springboot responds slower then expected. and quarkus has longer uptime.

Conclusion: Quarkus is nice and reliable fast solution for microservices. I cant say faster then spring. after all this was just a small use case.

some study

I decided to study in hackerrank these days. just for practice and think more. for this question

https://www.hackerrank.com/challenges/staircase

java 7 solution


 at least there is not two for loop :)

google city are searches

I did not know this feature of google. I used to live in istanbul now in wroclaw. and I was wondering how small this city is. and search wroclow city are in google

https://www.google.pl/search?q=wroclaw+city+area

https://www.google.pl/search?q=istanbul+city+area

5343 km square is huge. population and traffic huge too. but I am happy with my small wroclaw 🙂

linux mint xiaomi redmi 3 pro upgrade to MIUI 8

I bought this phone around 3 months ago. first I had a lot of problems about menu and applications. some chinese some english. some utf problems in applications. anyway I was reading this miui 8 update

then I decided to upgrade mine too. but I am a new in this flashing rom or any adb commands.  first I downloaded recovery image then put the image in phone try to update from updater app inside phone it did not work. then I tried to use TWRP and fastboot method. I had problems about giving root access to twrp. then tried to use miflash but my machine is linux mint. so it did not work too.

I tried every online tutorial and could not upgrade my phone. at last I was reading shell scripts in fastboot package

flash_all.sh
flash_all_lock.sh
flash_all_lock.bat
flash_all_except_data_storage.sh

actually I was not sure about these commands

fastboot $* getvar product 2>&1 | grep “^product: ido”
if [ $? -ne 0 ] ; then echo “Missmatching image and device”; exit 1; fi
fastboot $* flash partition `dirname $0`/images/gpt_both0.bin
fastboot $* flash tz `dirname $0`/images/tz.mbn
fastboot $* flash sbl1 `dirname $0`/images/sbl1.mbn
fastboot $* flash rpm `dirname $0`/images/rpm.mbn
fastboot $* flash aboot `dirname $0`/images/emmc_appsboot.mbn

tried first line manually but fastboot command not found. I check apt repo and installed it with 

apt-get install android-tools-fastboot

then first line worked

ido_xhdpi_global_images_6.8.11_20160805.0000.29_5.1_global # fastboot $* getvar product
product: ido
finished. total time: 0.001s

then run the shell script

ido_xhdpi_global_images_6.8.11_20160805.0000.29_5.1_global # ./flash_all.sh
ido Fastboot Tool Ver 5.0
product: ido
target reported max download size of 268435456 bytes
sending ‘partition’ (33 KB)…
OKAY [  0.004s]
writing ‘partition’…
OKAY [  0.024s]
finished. total time: 0.027s
target reported max download size of 268435456 bytes
sending ‘tz’ (504 KB)…
OKAY [  0.018s]
writing ‘tz’…
OKAY [  0.012s]
finished. total time: 0.030s
target reported max download size of 268435456 bytes
sending ‘sbl1’ (286 KB)…
OKAY [  0.010s]
writing ‘sbl1’…
OKAY [  0.009s]
finished. total time: 0.019s
target reported max download size of 268435456 bytes
sending ‘rpm’ (156 KB)…
OKAY [  0.007s]
writing ‘rpm’…
OKAY [  0.008s]
finished. total time: 0.015s
target reported max download size of 268435456 bytes
sending ‘aboot’ (518 KB)…
OKAY [  0.018s]
writing ‘aboot’…
OKAY [  0.012s]
finished. total time: 0.030s
target reported max download size of 268435456 bytes
sending ‘hyp’ (72 KB)…
OKAY [  0.005s]
writing ‘hyp’…
OKAY [  0.005s]
finished. total time: 0.010s
target reported max download size of 268435456 bytes
sending ‘tzbak’ (504 KB)…
OKAY [  0.019s]
writing ‘tzbak’…
OKAY [  0.013s]
finished. total time: 0.031s
target reported max download size of 268435456 bytes
sending ‘sbl1bak’ (286 KB)…
OKAY [  0.012s]
writing ‘sbl1bak’…
OKAY [  0.007s]
finished. total time: 0.019s
target reported max download size of 268435456 bytes
sending ‘rpmbak’ (156 KB)…
OKAY [  0.008s]
writing ‘rpmbak’…
OKAY [  0.007s]
finished. total time: 0.015s
target reported max download size of 268435456 bytes
sending ‘abootbak’ (518 KB)…
OKAY [  0.020s]
writing ‘abootbak’…
OKAY [  0.012s]
finished. total time: 0.031s
target reported max download size of 268435456 bytes
sending ‘hypbak’ (72 KB)…
OKAY [  0.006s]
writing ‘hypbak’…
OKAY [  0.006s]
finished. total time: 0.012s
erasing ‘boot’…
OKAY [  0.023s]
finished. total time: 0.023s
target reported max download size of 268435456 bytes
sending ‘modem’ (53457 KB)…
OKAY [  1.712s]
writing ‘modem’…
OKAY [  0.704s]
finished. total time: 2.416s
target reported max download size of 268435456 bytes
erasing ‘system’…
OKAY [  0.332s]
sending sparse ‘system’ (259609 KB)…
OKAY [  8.568s]
writing ‘system’…
OKAY [  3.559s]
sending sparse ‘system’ (260573 KB)…
OKAY [  8.617s]
writing ‘system’…
OKAY [  4.170s]
sending sparse ‘system’ (255173 KB)…
OKAY [  8.511s]
writing ‘system’…
OKAY [  4.840s]
sending sparse ‘system’ (256974 KB)…
OKAY [  8.565s]
writing ‘system’…
OKAY [  3.978s]
sending sparse ‘system’ (262068 KB)…
OKAY [  8.773s]
writing ‘system’…
OKAY [  4.573s]
sending sparse ‘system’ (260406 KB)…
OKAY [  8.674s]
writing ‘system’…
OKAY [  4.561s]
sending sparse ‘system’ (28525 KB)…
OKAY [  0.980s]
writing ‘system’…
OKAY [  0.466s]
finished. total time: 79.168s
target reported max download size of 268435456 bytes
erasing ‘cache’…
OKAY [  0.030s]
sending ‘cache’ (5736 KB)…
OKAY [  0.186s]
writing ‘cache’…
OKAY [  0.090s]
finished. total time: 0.306s
target reported max download size of 268435456 bytes
erasing ‘userdata’…
OKAY [  3.322s]
sending ‘userdata’ (138958 KB)…
OKAY [  4.419s]
writing ‘userdata’…
OKAY [  1.891s]
finished. total time: 9.632s
target reported max download size of 268435456 bytes
sending ‘recovery’ (10107 KB)…
OKAY [  0.339s]
writing ‘recovery’…
OKAY [  0.136s]
finished. total time: 0.475s
target reported max download size of 268435456 bytes
sending ‘boot’ (9327 KB)…
OKAY [  0.301s]
writing ‘boot’…
OKAY [  0.152s]
finished. total time: 0.453s
target reported max download size of 268435456 bytes
sending ‘persist’ (4720 KB)…
OKAY [  0.151s]
writing ‘persist’…
OKAY [  0.072s]
finished. total time: 0.223s
target reported max download size of 268435456 bytes
sending ‘misc’ (8 KB)…
OKAY [  0.004s]
writing ‘misc’…
OKAY [  0.003s]
finished. total time: 0.007s
target reported max download size of 268435456 bytes
sending ‘splash’ (5401 KB)…
OKAY [  0.174s]
writing ‘splash’…
OKAY [  0.075s]
finished. total time: 0.249s
target reported max download size of 268435456 bytes
sending ‘cust’ (227494 KB)…
OKAY [  7.269s]
writing ‘cust’…
OKAY [  3.279s]
finished. total time: 10.548s
rebooting…
finished. total time: 0.001s

it took around 20 minutes for my phone to reboot. now I have miui 8 and this time all google apps included in this rom. I start using it directly without installing google apps. normally google apps was not in xiaomi redmi 3 and took me a while to understand. because normally in lg or samsung I never had system like this without google play store it was really hard to use. btw I ran those commands with root. I did not want to configure usb related access rights.

debian jessie php problem

after I install php apache and stuff I start controlling. and one php page was not working but wordpress was working after a small search I found in jessie short_open_tag is actually off. so what you should need to do is find php.ini related and change it to short_open_tag = On if you are using fpm dont forget to restart your php fpm with this command /etc/init.d/php5-fpm restart or service php5-fpm restart