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...