分类目录归档:未分类

控制台应用静态库编译

cmake_minimum_required(VERSION 3.14)
project(CommaSdkActivator)

set(CMAKE_CXX_STANDARD 11)


# yum install glibc-static libstdc++-static
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")

if(WIN32)
  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,5.01")
endif()

if(MSVC)
    # Use the static C library for all build types
    foreach(var
        CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
        CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
        CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
        CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
      )
      if(${var} MATCHES "/MD")
        string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}")
      endif()
    endforeach()
endif(MSVC)

add_executable(CommaSdkActivator main.cpp)

指定ndk的库输出

defaultConfig {
applicationId “com.commaai.facesdkdemo”
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName “1.0”

testInstrumentationRunner “androidx.test.runner.AndroidJUnitRunner”

ndk {
abiFilters “armeabi-v7a”
}
}

VT102图形测试whiptail

#!/bin/bash

whiptail --title "K8s,  Vision @ 2019" --menu "Choose your option" 20 65 13 \
"1" "Single K8s One-click" \
"2" "Cluste K8s One-click" \
"3" "Cluste K8s add node" \
"4" "Single K8s add node" \
"5" "del node" \
"6" "Uninstall K8s" \
"7" "Quit"  3>&1 1>&2 2>&3
#!/bin/bash
whiptail --title "导入集群IP地址(包含本机ip默认第一个ip对应本机ip作为master)" --yes-button "YES" --no-button "NO"  --yesno "批量导入集群IP地址?" 10 60
#!/bin/bash
whiptail --title "#请输入本机Ip(master)并回车#" --inputbox "请检查IP是否一致,确定提交?" 10 60 "$IP" 3>&1 1>&2 2>&3
#!/bin/bash
#---
if ( whiptail --title "Title hylan:yesno" --yesno "Choose between Yes and No." 10 60 ) then
     echo "You chose Yes. Exit status was $?."
else
     echo "You chose No. Exit status was $?."
fi
#---
if (whiptail --title "Title hylan:yesno" --yes-button "Hylan" --no-button "Candy"  --yesno "Which do you like better?" 10 60) then  
   echo "You chose Hylan. Exit status was $?."; 
   echo "You Best!"
else    
   echo "You chose Candy. Exit status was $?.";
fi
#---
whiptail --title "Title hylan:msgbox" --msgbox "Create a message box with whiptail. Choose Ok to continue." 10 60
#---
whiptail --title "Title hylan:inputbox" --inputbox "What is your pet's name?" 10 60 hylancandy 3>&1 1>&2 2>&3
#---
whiptail --title "Title hylan:passwordbox" --passwordbox "Enter your password and choose Ok to continue." 10 60 3>&1 1>&2 2>&3
#---
whiptail --title "Title hylan:menu" --menu "Choose your option" 15 60 4 \
"1" "Grilled Spicy Sausage" \
"2" "Grilled Halloumi Cheese" \
"3" "Charcoaled Chicken Wings" \
"4" "Fried Aubergine"  3>&1 1>&2 2>&3

#---
whiptail --title "Title hylan:checklist" --checklist "Choose preferred Linux distros" 15 60 4 "debian" "Venerable Debian" ON "ubuntu" "Popular Ubuntu" OFF "centos" "Stable CentOS" ON "mint" "Rising Star Mint" OFF 3>&1 1>&2 2>&3

{
     for (( i=0 ; i<=100 ; i+=20 )); do
         sleep 1
         echo $i
     done
} | whiptail --gauge "Please wait while installing" 6 60 0

#---
whiptail --title "Title hylan:checklist" --radiolist "Choose preferred Linux distros" 15 60 4 "debian" "Venerable Debian" ON "ubuntu" "Popular Ubuntu" OFF "centos" "Stable CentOS" ON "mint" "Rising Star Mint" OFF 3>&1 1>&2 2>&3

关闭WPS广告

“1.我们首先点击电脑左下角的开始。2.然后点击Wps Office文件夹。3.随后点击配置工具。4.我们在弹出的窗口中点击高级。5.再点击其他选项。6.最后取消勾选WPS热点及广告推送就可以了。



安装ISTIO-1.6.8版本

承接上K8s的安装教程,继续安装ISTIO。

K8s离线版本安装全过程


因为ISTIO具备完整的监控,包括grafana/prometheus等,故需要先删除原集群的相关监控,然后按istio方式部署。
第一步:检查目标K8s是否满足安装istio的条件。

istio x precheck

第二步:安装示范DEMO

istioctl install --set profile=demo
安装结束后,可用命令检查是否安装完整
 istioctl verify-install

彻底禁用IPV6

使用kubespray安装k8s时,必须禁用IPV6,否则会导至请求以ipv6方式请求,从而最终无法安装docker-ce等。
第一步:编辑/etc/sysctl.conf配置,增加net.ipv6.conf.all.disable_ipv6=1

第二步:编辑/etc/sysconfig/network配置,增加 NETWORKING_IPV6=no

第三步:编辑/etc/sysconfig/network-scripts/ifcfg-ens33,确保IPV6INIT=no是存在。而ifcfg-ens33可能在不同的系统中,是不同的名字。可以先通过ls /etc/sysconfig/network-scripts/检查确认具体名字后,再修改。

第四步:关闭防火墙的开机自启动
systemctl disable ip6tables.service
第五步:执行sysctl -p或者reboot重启命令
第六步:使用ifconfig检查验证ipv6是否真的禁用。

安装docker-ce最新版本

移除当前版本:docker-ce版本
rpm -qa | grep docker|xargs yum remove -y
安装最新版本:
curl -fsSL https://get.docker.com/ | sh

离线包下载:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
一共三个安装文件:
yum localinstall -y
>> docker-ce-20.10.8-3.el7.x86_64.rpm
>> docker-ce-cli-20.10.8-3.el7.x86_64.rpm
>> docker-ce-rootless-extras-20.10.8-3.el7.x86_64.rpm

docker-compose

https://github.com/docker/compose/releases?after=1.28.1

安卓应用安装脚本

adb install的动作是拆分成两个动作完成的。
首先:adb push file.apk /data/local/tmp
接着:adb pm install /data/local/tmp/file.apk
最后:adb shell “rm -f /data/local/tmp/file.apk”
所以,当采用adb install 时,可登录shell中,直接进入/data/local/tmp目录下,如下图所示。

@echo off
 
set apkname=%1%
 
::传入apk路径
echo 您输入了参数:%apkname% 
 
Set filename=%apkname%
set filename=%~nx1
echo 文件名为:%filename%
set folder=%~dp1
echo 路径为:%folder%
 
tryagaint:
adb connect 192.168.30.22:5555 && adb install %apkname% && goto myexit
timeout /t 10
goto tryagaint

:myexit
echo "success to install"
pause
@echo off
 
set apkname=%1%
 
::传入apk路径
echo 您输入了参数:%apkname% 
 
Set filename=%apkname%
set filename=%~nx1
echo 文件名为:%filename%
set folder=%~dp1
echo 路径为:%folder%
 
 
adb push %apkname% /data/local/tmp
echo 复制到设备完成!***开始安装,耐心等待***
adb shell pm install -r /data/local/tmp/%filename%
echo ***安装完成***
adb shell rm /data/local/tmp/%filename%
echo ***删除临时文件***

istio-1.6.8的安装过程

istio-1.6.8支持K8s-1.15.7版本。
1.第一步:下载ISTIO-1.6.8并解压,它会解压至istio-1.6.8目录。
2.第二步:进入解压目录,找到istioctl的路径,并添加至环境变量,参考如下所示。

export PATH=$PATH:/root/istio-1.6.8/bin
export KUBERNETES_MASTER="http://172.16.3.244:6443"

3.第三步:安装demo
三、安装ISTIO
istioctl install –set profile=demo

———–错误收集——————
如果是使用K8s离线安装包,进行安装,则可能是已经修改了kubeconfig的路径,则可检查如下方式。

grep -r 'kubeconfig' ./K8s


解决办法:

cp /etc/kubernetes/bootstrap.kubeconfig /etc/kubernetes/admin.conf
cp /etc/kubernetes/admin.conf ~/.kube/config