How to add/drop column to SQLite DB

Add Column

sqlite> .schema RegisterInfo
sqlite> CREATE TABLE RegisterInfo(sysSerial BIGINT PRIMARY KEY, RegisterServerURL VARCHAR(500), RegisterState INTEGER, MainURL VARCHAR(500), LicenseKey VARCHAR(500), PassCode VARCHAR(64), IsUnitUnreg INTEGER, HostUnitID INTEGER, StationID INTEGER);

sqlite> alter table RegisterInfo add column test varchar(100);
sqlite> .schema RegisterInfo
CREATE TABLE RegisterInfo(sysSerial BIGINT PRIMARY KEY, RegisterServerURL VARCHAR(500), RegisterState INTEGER, MainURL VARCHAR(500), LicenseKey VARCHAR(500), PassCode VARCHAR(64), IsUnitUnreg INTEGER, HostUnitID INTEGER, StationID INTEGER, test varchar(100));


Drop Column
SQLite not support drop column command
You can:
1.Create a new table
2.Copy old table data to new table
3.Drop old table
4.Rename new table name as old table name

sqlite> CREATE TABLE RegisterInfo_new(sysSerial BIGINT PRIMARY KEY, RegisterServerURL VARCHAR(500), RegisterState INTEGER, MainURL VARCHAR(500), LicenseKey VARCHAR(500), PassCode VARCHAR(64), IsUnitUnreg INTEGER, HostUnitID INTEGER);
sqlite> insert into RegisterInfo_new
   ...> select sysSerial,RegisterServerURL,RegisterState,MainURL,LicenseKey,PassCode,IsUnitUnreg,HostUnitID from RegisterInfo;
sqlite> drop table RegisterInfo;
sqlite> alter table RegisterInfo_new rename to RegisterInfo;

Parser json array example by Jansson

Example code
/*root as follow*/
{"success":true,"data":[{"sysSerial":1,"StationId":0,"Name":"Warning","RetentionPolicyId":3,"UploadPolicyId":1,"Color":"#000000","FormAssigned":"4"},{"sysSerial":2,"StationId":0,"Name":"Traffic","RetentionPolicyId":3,"UploadPolicyId":1,"Color":"#df8787","FormAssigned":"2"},{"sysSerial":3,"StationId":0,"Name":"Test","RetentionPolicyId":4,"UploadPolicyId":1,"Color":"#5e0b0b","FormAssigned":""}]

    json_error_t error;
    json_t *root = json_loads(jsonStr, 0, &error);
    if(root){
        json_t *jsonData = json_object_get(root, "data");
        if(jsonData == NULL){
            json_decref(root);
            return -1;
        }
        if(json_is_array(jsonData)){
            const int length = json_array_size(jsonData);
            for(int i = 0; i < length; i++){ // Iterates over the sequence elements.
                json_t *jsonObject = json_array_get(jsonData, i);
                json_t *jsonSysSerial = json_object_get(jsonObject, "sysSerial");
                int sysSerial = json_integer_value(jsonSysSerial);
                json_t *jsonStationId = json_object_get(jsonObject, "StationId");
                int stationId = json_integer_value(jsonStationId);
                json_t *jsonName = json_object_get(jsonObject, "Name");
                const char *name = json_string_value(jsonName);
                json_t *jsonRetentionPolicyId = json_object_get(jsonObject, "RetentionPolicyId");
                int retentionPolicyId = json_integer_value(jsonRetentionPolicyId);
                json_t *jsonUploadPolicyId = json_object_get(jsonObject, "UploadPolicyId");
                int uploadPolicyId = json_integer_value(jsonUploadPolicyId);
                json_t *jsonColor = json_object_get(jsonObject, "Color");
                const char *color = json_string_value(jsonColor);
                json_t *jsonFormAssigned = json_object_get(jsonObject, "FormAssigned");
                const char *formAssigned = json_string_value(jsonFormAssigned);
                //printf("sysSerial = %d, StationId = %d, Name = %s, RetentionPolicyId = %d, UploadPolicyId = %d, Color = %s, FormAssigned = %s\n", sysSerial, stationId, name, retentionPolicyId, uploadPolicyId, color, formAssigned);
            }
        }
        json_decref(root);
    }

cross compile openssl & curl on hisi3516cv300


I wrote a script(build.sh) as fellow to build openssl





CUR_PATH=`pwd`
BUILD_PATH=$CUR_PATH/MyBuild
mkdir $CUR_PATH/MyBuild && mkdir $CUR_PATH/MyBuild/ssl
CC=arm-hisiv600-linux-gnueabi-gcc  RANLIB=arm-hisiv600-linux-gnueabi-ranlib ./config no-asm shared --openssldir=ssl --prefix=$BUILD_PATH
#corss compile not support -m64, so remove this CFLAG.In my environment. I modified a none-m64 Makefile than replace original Makefile
cp ./Makefile.none_m64 Makefile
make CC=arm-hisiv600-linux-gnueabi-gcc AR="arm-hisiv600-linux-gnueabi-ar r" RANLIB=arm-hisiv600-linux-gnueabi-ranlib 
arm-hisiv600-linux-gnueabi-strip -s libcrypto.so.1.0.0
arm-hisiv600-linux-gnueabi-strip -s libssl.so.1.0.0
make install


I wrote a script(build.sh) as fellow to build curl




#!/bin/sh
CUR_PATH=`pwd`
PREFIX_PATH=$CUR_PATH/MyBuild
./configure --host=arm-hisiv600-linux-gnueabi CFLAGS="-mcpu=arm926ej-s" \

--enable-shared --disable-static \
--with-ssl=/IPCameraProj-Svn/opensource/Http-Server/openssl-1.0.2m/MyBuild \
LDFLAGS="-L/IPCameraProj-Svn/opensource/Http-Server/openssl-1.0.2m/MyBuild/lib/" \
LIBS="-lssl -lcrypto" \
--prefix=$PREFIX_PATH --without-librtmp --without-zlib

Install KDE Desktop for Ubuntu 24.04

1. Enter following command to install the KDE-plasma sudo apt install kde-plasma-desktop 2. Disable the login screen 2-1. Create default sdd...