默认 upgrade 是更新非 cask 的应用,如果想全部更新,需要增加 2 个参数
brew update brew upgrade --cask --greedy
默认 upgrade 是更新非 cask 的应用,如果想全部更新,需要增加 2 个参数
brew update brew upgrade --cask --greedy
默认使用 pecl 安装的 PHP 扩展是最新版本的,例如以下将安装 oci8-3.3.0
pecl install oci8
假如我们想安装 oci8-2.2.0 则需要需要使用以下的命令进行安装
pecl install oci8-2.2.0
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module install php:remi-8.2
dnf install php
[root@rocky8 yum.repos.d]# php -v
PHP 8.2.11 (cli) (built: Sep 26 2023 11:11:58) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.2.11, Copyright (c) Zend Technologies
with Zend OPcache v8.2.11, Copyright (c), by Zend Technologies
yum install conda
source /etc/profile.d/conda.sh
conda create -n python311 python=3.11
conda activate python311
当前 python 就变成 3.11 的环境了
sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list sudo apt update sudo apt install -y tasksel sudo tasksel install ubuntu-desktop-minimal
然后正常重启就可以了
composer require php-mqtt/client
<?php
require __DIR__.'/vendor/autoload.php';
use PhpMqtt\Client\MqttClient;
$client = new MqttClient('127.0.0.1', 1883, 'client1');
$client->connect();
$client->publish('topic', 'Hello World!');
$client->disconnect();
<?php
require __DIR__.'/vendor/autoload.php';
use PhpMqtt\Client\MqttClient;
$client = new MqttClient('127.0.0.1', 1883, 'client2');
$client->connect();
$client->subscribe('topic', function($topic, $message) {
echo $topic, $message, PHP_EOL;
});
$client->loop(true);
$client->disconnect();
brew install visual-studio-code
首先引入 MQTT 库:
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>1.2.5</version>
</dependency>
然后编写相应 Java 代码,MqttClient 中的第三个 null 参数非常重要,如果没有设置在 Linux 下会因为权限问题出错。
public static void main( String[] args ) throws MqttException {
MqttClient client = new MqttClient("tcp://localhost:1883", "client1", null);
client.connect();
client.publish("topic1", new MqttMessage());
client.disconnect();
}
通过 brew 安装 mosquitto,并启动
brew install mosquitto
mosquitto -v
打开终端订阅 topic1
mosquitto_sub -t topic1
打开新的终端往 topic1 发消息
mosquitto_pub -t topic1 -m "HelloWorld"
docker run -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -p 8080:8080 quay.io/keycloak/keycloak:14.0.0
使用浏览器访问 http://localhost:8080,用户名:admin,密码:admin 访问