Create App Icons for React Native Android App

First you need one png file as your launcher icon.
icon
Then you need to resize this icon file to needed resolutions.
There is a simple service to resize your app icon to all needed resolutions with rocket speed.
Then you can download all your needed icons.
icons
Then replace each ic_launcher.png via image with correct resolution.
webrowser/android$ find -name "ic_launcher.png"
./app/src/main/res/mipmap-hdpi/ic_launcher.png
./app/src/main/res/mipmap-mdpi/ic_launcher.png
./app/src/main/res/mipmap-xhdpi/ic_launcher.png
./app/src/main/res/mipmap-xxhdpi/ic_launcher.png

Or you can use Image Asset Studio to create App Icons.
1.open Android Studio poject in your react native application.
open-app
2.use Image Asset Studio
open-image-asset
In the Foreground Layer tab, select an Asset Type, and then specify the asset in the field underneath:
Select Image to specify the path for an image file.

If your app supports Android 8.0, create adaptive and legacy launcher icons.
ic_launcher
If your app supports versions no higher than Android 7.1, create a legacy launcher icon only.
ic_launcher-1

Check the result
react-native run-android

lc

Refer

https://developer.android.com/studio/write/image-asset-studio.html
https://www.npmjs.com/package/react-native-icon

Configure Proxy Settings for CMD.EXE, WinHttp

winhttp
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\lenger>netsh
netsh>winhttp
netsh winhttp>set proxy /?

Usage: set proxy [proxy-server=] [bypass-list=]

Parameters:

Tag Value
proxy-server - proxy server for use for http and/or https protocol
bypass-list - a list of sites that should be visited bypassing the
proxy (use "" to bypass all short name hosts)

Examples:

set proxy myproxy
set proxy myproxy:80 ";bar"
set proxy proxy-server="http=myproxy;https=sproxy:88" bypass-list="*.foo.com"

netsh winhttp>

set HTTP_PROXY=server:port
set HTTPS_PROXY=server:port

Refer

https://technet.microsoft.com/en-us/library/bb430772(v=exchg.141).aspx

install and build your first React Native app on windows

Installing Chocolatey with cmd.exe

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" 

Installing Node, Python2 and JDK with Chocolatey

choco install -y nodejs.install python2 jdk8 

Install The React Native CLI

npm install -g react-native-cli 

Setup Android Studio

Create Virtual Device

Create New Application

react-native init AwesomeProject 

Run android

Launch your AVD before run-android

react-native run-android 

If every works well, below is your final result:
React-native-sample

Refer

https://facebook.github.io/react-native/docs/getting-started.html
https://chocolatey.org/install

Troubleshooting page

npm proxy set
run-android connection timeout
unable to load index.android.bundle

Unable to load script from assets index.android.bundle

Unable to load script from assets index.android.bundle

Solution

mkdir android/app/src/main/assets react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res 

Run

react-native run-android
Total time: 23.641 secs
'adb' is not recognized as an internal or external command,
operable program or batch file.
Starting the app (C:\Users\lenger\AppData\Local\Android\Sdk/platform-tools/adb shell am start -n com.webrowser/com.webrowser.MainActivity...
Starting: Intent { cmp=com.webrowser/.MainActivity }
React-native-sample

react-native run-android : Connection timed out

Error Log

Downloading https://services.gradle.org/distributions/gradle-2.14.1-all.zip

Exception in thread "main" java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:59)
at org.gradle.wrapper.Install$1.call(Install.java:46)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:46)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

Cause

The root cause was your computer need a proxy to download gradle-2.14.1-all.zip
And the file was not downloaded by react-native command or other shell command,
it was downloaded by java codes in your react-native application.
As android uses grandle for building project, We have to set proxy server in grandle property file.

Solution

Add the following lines in gradle.properties in the android folder
systemProp.http.proxyHost=xxx.xxx.xxx.xxx
systemProp.http.proxyPort=xxxx
systemProp.https.proxyHost=xxx.xxx.xxx.xxx
systemProp.https.proxyPort=xxxx

npm config http/https proxy

npm --proxy http://username:password@server:port install packagename
npm config set proxy http://username:password@server:port
npm config set https-proxy http://username:password@server:port
 
npm config set strict-ssl false
npm config set registry "http://registry.npmjs.org/"


npm config rm proxy
npm config rm https-proxy

show hospitality to strangers

你们务要常存弟兄相爱的心。 (希伯来书 13:1 和合本)
Keep on loving one another as brothers and sisters. (Hebrews 13:1 NIV)
不可忘记用爱心接待客旅;因为曾有接待客旅的,不知不觉就接待了天使。 (希伯来书 13:2 和合本)
Do not forget to show hospitality to strangers, for by so doing some people have shown hospitality to angels without knowing it. (Hebrews 13:2 NIV)
你们要记念被捆绑的人,好像与他们同受捆绑;也要记念遭苦害的人,想到自己也在肉身之内。 (希伯来书 13:3 和合本)
Continue to remember those in prison as if you were together with them in prison, and those who are mistreated as if you yourselves were suffering. (Hebrews 13:3 NIV)


Photo by Diego PH / Unsplash

Trust in the Lord

天怎样高过地,照样,我的道路高过你们的道路;我的意念高过你们的意念。 (以赛亚书 55:9 和合本)
"As the heavens are higher than the earth, so are my ways higher than your ways and my thoughts than your thoughts. (Isaiah 55:9 NIV)

你要专心仰赖耶和华,不可倚靠自己的聪明, (箴言 3:5 和合本)
Trust in the Lord with all your heart and lean not on your own understanding; (Proverbs 3:5 NIV)
在你一切所行的事上都要认定他,他必指引你的路。 (箴言 3:6 和合本)
in all your ways submit to him, and he will make your paths straight. (Proverbs 3:6 NIV)


Photo by Federico Respini / Unsplash

微信开放平台 创建移动应用 Android 应用签名

appsign

keystore file decide it.

In fact, it is MD5 value of the keystore file.
please refer https://errong.win/generate-keystore/ to generate the keystore file.
You can get the MD5 via
keytool -list -v -keystore webrowser.keystore
MD5: 4F:87:B6:11:A4:37:5A:29:E4:A2:F7:BD:2B:DC:CC:18
Remove all ":" and turn the string to lower case.
Application signature is :
4f87b611a4375a29e4a2f7bd2bdccc18

Generate keystore file to sign your android apk

Tool

keytool
You can get this tool after you installed jdk.

Command

C:\Program Files\Java\jdk1.8.0_121\bin>keytool.exe -genkey -alias "webrowser" -keyalg "RSA" -validity 10000 -keystore "webrowser.keystore"
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: Errong
What is the name of your organizational unit?
[Unknown]: Errong
What is the name of your organization?
[Unknown]: Errong
What is the name of your City or Locality?
[Unknown]: Nanjing
What is the name of your State or Province?
[Unknown]: JiangSu
What is the two-letter country code for this unit?
[Unknown]: CN
Is CN=Errong, OU=Errong, O=Errong, L=Nanjing, ST=JiangSu, C=CN correct?
[no]:
What is your first and last name?
[Errong]:
What is the name of your organizational unit?
[Errong]:
What is the name of your organization?
[Errong]:
What is the name of your City or Locality?
[Nanjing]:
What is the name of your State or Province?
[JiangSu]:
What is the two-letter country code for this unit?
[CN]:
Is CN=Errong, OU=Errong, O=Errong, L=Nanjing, ST=JiangSu, C=CN correct?
[no]: yes

Enter key password for
(RETURN if same as keystore password):

keystore file

C:\Program Files\Java\jdk1.8.0_121\bin>dir webrowser.keystore
Volume in drive C has no label.
Volume Serial Number is 40EA-8B0A

Directory of C:\Program Files\Java\jdk1.8.0_121\bin

12/27/2017 07:19 PM 2,230 webrowser.keystore
1 File(s) 2,230 bytes
0 Dir(s) 58,290,343,936 bytes free

list keystore file

C:\Program Files\Java\jdk1.8.0_121\bin>keytool -list -v -keystore webrowser.keystore
Enter keystore password:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: webrowser
Creation date: Dec 27, 2017
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Errong, OU=Errong, O=Errong, L=Nanjing, ST=JiangSu, C=CN
Issuer: CN=Errong, OU=Errong, O=Errong, L=Nanjing, ST=JiangSu, C=CN
Serial number: 4c63eb8d
Valid from: Wed Dec 27 19:19:32 CST 2017 until: Sun May 14 19:19:32 CST 2045
Certificate fingerprints:
MD5: 4F:87:B6:11:A4:37:5A:29:E4:A2:F7:BD:2B:DC:CC:18
SHA1: 21:F8:D8:7E:39:8E:49:C5:BE:A0:A1:8A:19:5E:3F:C0:4E:3F:05:66
SHA256: 77:31:F3:CB:D5:C1:1F:8D:1B:9E:A8:9D:5F:65:C8:64:56:48:8A:FB:32:BB:05:D2:5D:13:B0:8A:2C:92:D3:9F
Signature algorithm name: SHA256withRSA
Version: 3

Extensions:

#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 67 8A E4 45 0E 2D 10 87 44 E4 11 B2 C8 34 B1 A5 g..E.-..D....4..
0010: 62 4B FA BD bK..
]
]

We Browser

light web browser, heave social share

Godliness Training

"操练身体,益处还少;惟独敬虔,凡事都有益处,因有今生和来生的应许。" (提摩太前书 4:8 和合本)
For physical training is of some value, but godliness has value for all things, holding promise for both the present life and the life to come. (1 Timothy 4:8 NIV)


Photo by Ines Álvarez Fdez / Unsplash

wrong LC_NUMBERIC cause CSS unsupported value

warning: unsupported value
position: absolute; width: 12.9em; transform: translateX(16.27em);
^
and you know, some countries uses decimal point as comma - not point.
so scanf function cannot read "12.9em" if we set NUMERIC at that country.
Such as French.
 
// query LC_NUMERIC 
char* locale = setlocale(LC_NUMERIC, NULL); 
// set LC_NUMERIC 
char* locale = "en_US.utf8"; 
setlocale(LC_NUMERIC, locale); 
 
if LC_NUMERIC was set to "frCA.UTF-8",
12.9em can't be read as a Decimal.
The correct should be like "en_US.utf8"
Refer:
https://en.wikipedia.org/wiki/Decimal_mark
http://man7.org/linux/man-pages/man3/setlocale.3.html

故意犯罪 真是可怕的

If we deliberately keep on sinning after we have received the knowledge of the truth, no sacrifice for sins is left, (Hebrews 10:26 NIV)
惟有战惧等候审判和那烧灭众敌人的烈火。 (希伯来书 10:27 和合本)
but only a fearful expectation of judgment and of raging fire that will consume the enemies of God. (Hebrews 10:27 NIV)
人干犯摩西的律法,凭两三个见证人,尚且不得怜恤而死, (希伯来书 10:28 和合本)
Anyone who rejected the law of Moses died without mercy on the testimony of two or three witnesses. (Hebrews 10:28 NIV)
何况人践踏 神的儿子,将那使他成圣之约的血当作平常,又亵慢施恩的圣灵,你们想,他要受的刑罚该怎样加重呢! (希伯来书 10:29 和合本)
How much more severely do you think someone deserves to be punished who has trampled the Son of God underfoot, who has treated as an unholy thing the blood of the covenant that sanctified them, and who has insulted the Spirit of grace? (Hebrews 10:29 NIV)
因为我们知道谁说:"伸冤在我,我必报应";又说:"主要审判他的百姓。" (希伯来书 10:30 和合本)
For we know him who said, "It is mine to avenge; I will repay," and again, "The Lord will judge his people." (Hebrews 10:30 NIV)
落在永生 神的手里,真是可怕的! (希伯来书 10:31 和合本)
It is a dreadful thing to fall into the hands of the living God. (Hebrews 10:31 NIV)

Photo by Drew Jones / Unsplash

主啊!你在我生命的旨意是什么?

人一生虚度的日子,就如影儿经过,谁知道什么与他有益呢?谁能告诉他身后在日光之下有什么事呢? (传道书 6:12 和合本)
For who knows what is good for a person in life, during the few and meaningless days they pass through like a shadow? Who can tell them what will happen under the sun after they are gone? (Ecclesiastes 6:12 NIV)


Photo by Jonatan Pie / Unsplash

auto learn account


会计人员继续教育网上培训 只需要登录你的账号。
所有的课程将会自动开始学习 无需你再理会 只要开着浏览器即可。
自动勾选学习过程中弹出的问题,学习过程不会再被卡住。

https://www.youtube.com/watch?v=V9zXnnQQRUE&feature=youtu.be

FireFox Plugin:
https://addons.mozilla.org/en-US/firefox/addon/auto-learn-account/



HOW ARE YOUR EYES?

耶稣过去的时候,看见一个人生来是瞎眼的。 (约翰福音 9:1 和合本)
As he went along, he saw a man blind from birth. (John 9:1 NIV)
门徒问耶稣说:"拉比,这人生来是瞎眼的,是谁犯了罪?是这人呢?是他父母呢?" (约翰福音 9:2 和合本)
His disciples asked him, "Rabbi, who sinned, this man or his parents, that he was born blind?" (John 9:2 NIV)
耶稣回答说:"也不是这人犯了罪,也不是他父母犯了罪,是要在他身上显出 神的作为来。 (约翰福音 9:3 和合本)
"Neither this man nor his parents sinned,"said Jesus, "but this happened so that the works of God might be displayed in him. (John 9:3 NIV)
趁着白日,我们必须做那差我来者的工;黑夜将到,就没有人能做工了。 (约翰福音 9:4 和合本)
As long as it is day, we must do the works of him who sent me. Night is coming, when no one can work. (John 9:4 NIV)
我在世上的时候,是世上的光。" (约翰福音 9:5 和合本)
While I am in the world, I am the light of the world." (John 9:5 NIV)
耶稣说了这话,就吐唾沫在地上,用唾沫和泥抹在瞎子的眼睛上, (约翰福音 9:6 和合本)
After saying this, he spit on the ground, made some mud with the saliva, and put it on the man's eyes. (John 9:6 NIV)
对他说:"你往西罗亚池子里去洗。"(西罗亚翻出来就是"奉差遣"。)他去一洗,回头就看见了。 (约翰福音 9:7 和合本)
"Go,"he told him, "wash in the Pool of Siloam"(this word means "Sent"). So the man went and washed, and came home seeing. (John 9:7 NIV)
他的邻舍和那素常见他是讨饭的,就说:"这不是那从前坐着讨饭的人吗?" (约翰福音 9:8 和合本)
His neighbors and those who had formerly seen him begging asked, "Isn't this the same man who used to sit and beg?" (John 9:8 NIV)
有人说:"是他";又有人说:"不是,却是像他。"他自己说:"是我。" (约翰福音 9:9 和合本)
Some claimed that he was. Others said, "No, he only looks like him." But he himself insisted, "I am the man." (John 9:9 NIV)
他们对他说:"你的眼睛是怎么开的呢?" (约翰福音 9:10 和合本)
"How then were your eyes opened?" they asked. (John 9:10 NIV)
他回答说:"有一个人,名叫耶稣,他和泥抹我的眼睛,对我说:'你往西罗亚池子去洗。'我去一洗,就看见了。" (约翰福音 9:11 和合本)
He replied, "The man they call Jesus made some mud and put it on my eyes. He told me to go to Siloam and wash. So I went and washed, and then I could see." (John 9:11 NIV)


Photo by Monica Galentino / Unsplash

CHRIST’S INVITATION

节期的末日,就是最大之日,耶稣站着高声说:"人若渴了,可以到我这里来喝。 (约翰福音 7:37 和合本)
On the last and greatest day of the festival, Jesus stood and said in a loud voice, "Let anyone who is thirsty come to me and drink. (John 7:37 NIV)
信我的人就如经上所说:'从他腹中要流出活水的江河来。'" (约翰福音 7:38 和合本)
Whoever believes in me, as Scripture has said, rivers of living water will flow from within them." (John 7:38 NIV)


Photo by Michael Bomke / Unsplash

PETER’S CONFESSION

耶稣到了凯撒利亚·腓立比的境内,就问门徒说:"人说我(有古卷没有我字) —人子是谁?" (马太福音 16:13 和合本)
When Jesus came to the region of Caesarea Philippi, he asked his disciples, "Who do people say the Son of Man is?" (Matthew 16:13 NIV)
他们说:"有人说是施洗的约翰;有人说是以利亚;又有人说是耶利米或是先知里的一位。" (马太福音 16:14 和合本)
They replied, "Some say John the Baptist; others say Elijah; and still others, Jeremiah or one of the prophets." (Matthew 16:14 NIV)
耶稣说:"你们说我是谁?" (马太福音 16:15 和合本)
"But what about you?"he asked. "Who do you say I am?" (Matthew 16:15 NIV)
西门·彼得回答说:"你是基督,是永生 神的儿子。" (马太福音 16:16 和合本)
Simon Peter answered, "You are the Messiah, the Son of the living God." (Matthew 16:16 NIV)
耶稣对他说:"西门·巴·约拿,你是有福的!因为这不是属血肉的指示你的,乃是我在天上的父指示的。 (马太福音 16:17 和合本)
Jesus replied, "Blessed are you, Simon son of Jonah, for this was not revealed to you by flesh and blood, but by my Father in heaven. (Matthew 16:17 NIV)
我还告诉你,你是彼得,我要把我的教会建造在这磐石上;阴间的权柄(权柄:原文是门) 不能胜过他。 (马太福音 16:18 和合本)
And I tell you that you are Peter, and on this rock I will build my church, and the gates of Hades will not overcome it. (Matthew 16:18 NIV)
我要把天国的钥匙给你,凡你在地上所捆绑的,在天上也要捆绑;凡你在地上所释放的,在天上也要释放。" (马太福音 16:19 和合本)
I will give you the keys of the kingdom of heaven; whatever you bind on earth will be bound in heaven, and whatever you loose on earth will be loosed in heaven." (Matthew 16:19 NIV)
当下,耶稣嘱咐门徒,不可对人说他是基督。 (马太福音 16:20 和合本)
Then he ordered his disciples not to tell anyone that he was the Messiah. (Matthew 16:20 NIV)
从此,耶稣才指示门徒,他必须上耶路撒冷去,受长老、祭司长、文士许多的苦,并且被杀,第三日复活。 (马太福音 16:21 和合本)
From that time on Jesus began to explain to his disciples that he must go to Jerusalem and suffer many things at the hands of the elders, the chief priests and the teachers of the law, and that he must be killed and on the third day be raised to life. (Matthew 16:21 NIV)


Photo by Chris Barbalis / Unsplash

KVM folder share, networking, host and guest IP

Create Virtual Machine via KVM

nat

Host IP of KVM, run ifconfig on host

~$ ifconfig 
virbr0    Link encap:Ethernet  HWaddr fe:54:00:ad:73:64  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:588122 errors:0 dropped:0 overruns:0 frame:0
          TX packets:749737 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:31412184 (31.4 MB)  TX bytes:1267281456 (1.2 GB)

Guest IP, run ifconfig on created virtual machine.

~$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 52:54:00:ad:73:64  
          inet addr:192.168.122.112  Bcast:192.168.122.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fead:7364/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:415799 errors:0 dropped:3 overruns:0 frame:0
          TX packets:252791 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:714784870 (714.7 MB)  TX bytes:17348958 (17.3 MB)

KVM IPs

192.168.122.112 is your virtual machine IP.
192.168.122.1 is your host IP.
We can easy share folder on host to your virtual machine via networking mount.
mount 192.168.122.1:/home /mnt 
 
scp, ssh also can be used too.

Install KVM and Create Virtual Machines on Ubuntu

Refer to:
https://www.howtogeek.com/117635/how-to-install-kvm-and-create-virtual-machines-on-ubuntu/
Summary:

Determine whether your CPU support hardware virtualization

egrep -c '(svm|vmx)' /proc/cpuinfo 
A 0 indicates that your CPU doesn't support hardware virtualization, while a 1 or more indicates that it does. You still have to enable hardware virtualization support in your computer's BIOS, even if this command returns a 1 or more.
Otherwise you will get a warning later on:
KVM is not available. This may mean the KVM package is not installed, 
or the KVM kernel modules are not loaded. 
Your virtual machines may perform poorly. 

Install KVM

sudo apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager 

Add user to libvirtd group

sudo adduser name libvirtd 

Create Virtual Machines via virt-manager

virt-manager 
kvm
Click the Create New Virtual Machine button on the toolbar and the Virtual Machine Manager will walk you through selecting an installation method, configuring your virtual machine's virtual hardware, and installing your guest operating system of choice.

By the way:
You can creae raw image via qemu-img.
qemu-img create -f raw ubuntu_desktop_14.04.5.img 100G
$ ls *.img -all
-rw-r--r-- 1 libvirt-qemu kvm 107374182400  4 18:06 
ubuntu_desktop_14.04.5.img

The Lord has done great things

当耶和华将那些被掳的带回锡安的时候,我们好像做梦的人。 (诗篇 126:1 和合本)
When the Lord restored the fortunes of Zion, we were like those who dreamed. (Psalms 126:1 NIV)
我们满口喜笑、满舌欢呼的时候,外邦中就有人说:耶和华为他们行了大事! (诗篇 126:2 和合本)
Our mouths were filled with laughter, our tongues with songs of joy. Then it was said among the nations, "The Lord has done great things for them." (Psalms 126:2 NIV)
耶和华果然为我们行了大事,我们就欢喜。 (诗篇 126:3 和合本)
The Lord has done great things for us, and we are filled with joy. (Psalms 126:3 NIV)
耶和华啊,求你使我们被掳的人归回,好像南地的河水复流。 (诗篇 126:4 和合本)
Restore our fortunes, Lord , like streams in the Negev. (Psalms 126:4 NIV)
流泪撒种的,必欢呼收割! (诗篇 126:5 和合本)
Those who sow with tears will reap with songs of joy. (Psalms 126:5 NIV)
那带种流泪出去的,必要欢欢乐乐地带禾捆回来! (诗篇 126:6 和合本)
Those who go out weeping, carrying seed to sow, will return with songs of joy, carrying sheaves with them. (Psalms 126:6 NIV)

Where are you?

于是女人见那棵树的果子好作食物,也悦人的眼目,且是可喜爱的,能使人有智慧,就摘下果子来吃了,又给她丈夫,她丈夫也吃了。 (创世记 3:6 和合本)
When the woman saw that the fruit of the tree was good for food and pleasing to the eye, and also desirable for gaining wisdom, she took some and ate it. She also gave some to her husband, who was with her, and he ate it. (Genesis 3:6 NIV)
他们二人的眼睛就明亮了,才知道自己是赤身露体,便拿无花果树的叶子为自己编做裙子。 (创世记 3:7 和合本)
Then the eyes of both of them were opened, and they realized they were naked; so they sewed fig leaves together and made coverings for themselves. (Genesis 3:7 NIV)
天起了凉风,耶和华 神在园中行走。那人和他妻子听见 神的声音,就藏在园里的树木中,躲避耶和华 神的面。 (创世记 3:8 和合本)
Then the man and his wife heard the sound of the Lord God as he was walking in the garden in the cool of the day, and they hid from the Lord God among the trees of the garden. (Genesis 3:8 NIV)
耶和华 神呼唤那人,对他说:"你在哪里?" (创世记 3:9 和合本)
But the Lord God called to the man, "Where are you?" (Genesis 3:9 NIV)


Photo by chuttersnap / Unsplash

Can pthread_mutex_lock still work after pthread mutex_destroy ?

Refer:
https://linux.die.net/man/3/pthread_mutex_init
The pthread_mutex_destroy() function shall destroy the mutex object referenced by mutex; the mutex object becomes, in effect, uninitialized. An implementation may cause pthread_mutex_destroy() to set the object referenced by mutex to an invalid value. A destroyed mutex object can be reinitialized using pthread_mutex_init(); the results of otherwise referencing the object after it has been destroyed are undefined.
What is the undefined behavior ?
Let's us wirte sample codes to verify it.
#include <pthread.h>
#include <iostream>
#include <unistd.h>

using namespace std;

static pthread_mutex_t foo_mutex;

static void *
thread1(void *arg)
{
   while(1) {
       pthread_mutex_lock(&foo_mutex);
       cout << "thread 1 running" << endl;
       sleep(2);
   }
}

static void *
thread2(void *arg)
{
   while(1) {
       pthread_mutex_lock(&foo_mutex);
       cout << "thread 2 running" << endl;
       sleep(2);
   }
}

int main()
{
    pthread_mutex_init(&foo_mutex, NULL);
    pthread_mutex_destroy(&foo_mutex);
    pthread_t p1;
    pthread_t p2;
    pthread_create(&p1, 0, thread1, 0);
    pthread_create(&p2, 0, thread2, 0);

    pthread_join(p1, 0);
    pthread_join(p2, 0);

    return 0;
}
~$ g++ -o pmt pmt.cpp -lpthread
~$ ./pmt
thread 1 runningthread 2 running
thread 2 running
thread 1 running
thread 2 running
thread 1 running
thread 2 running
thread 1 running
......
The result is NOT WORK ANY MORE.

fixed: embedded-redis: Unable to run on macOS Sonoma

Issue you might see below error while trying to run embedded-redis for your testing on your macOS after you upgrade to Sonoma. java.la...