xud6的笔记本

Windows 预安装打印机驱动

 •  Filed under 打印机, Active Directory, windows

将打印机驱动复制到可以访问的共享路径
使用以下powershell脚本安装驱动

 pnputil.exe /a "\\<fileshare>\koaxpj__.inf.inf"

之后确认安装后打印机驱动的路径,在C:\Windows\System32\DriverStore\FileRepository
打开inf文件记录下实际打印机型号的名称,如

 [KONICA MINOLTA.NTamd64]
 "KONICA MINOLTA C368SeriesPCL"
 "KONICA MINOLTA C3851SeriesPCL"

使用以下powershell脚本添加具体驱动

 Add-PrinterDriver -Name "KONICA MINOLTA C368SeriesPCL" -InfPath "C:\Windows\System32\DriverStore\FileRepository\koaxpj__.inf_amd64_c4e736b89265dcc3\koaxpj__.inf"
 
 Add-PrinterDriver -Name "KONICA MINOLTA C3851SeriesPCL" -InfPath "C:\Windows\System32\DriverStore\FileRepository\koaxpj__.inf_amd64_c4e736b89265dcc3\koaxpj__.inf"

MDT 等待网络就绪

 •  Filed under windows, MDT

添加以下 Run Command Line 步骤

PING 1.1.1.1 -n 1 -w 900000

其中1.1.1.1可换为MDT服务器地址

MACOS 修复应用修改后代码签名问题,即xxx.app已损坏

 •  Filed under mac

创建代码签名证书

打开钥匙串访问
打开菜单栏-钥匙串访问-证书助理创建证书
证书类型选代码签名,名称取个终端中容易输入的,创建。
找到刚创建的证书,打开后在信任中代码签名修改为始终信任。

重签名有问题的app

sudo codesign --deep --force --verify --verbose --sign "XXXXXcodesign" /Applications/YYYYY.app

XXXXXcodesign为刚才创建的证书名
YYYYY.app为需要签名的app

H3C下载账号

 • 

用户名:yx800
密码:01230123

apt限制同时下载数量

 •  Filed under linux, debian

Queue-Mode 设置选项

默认值为 host 对每个host发起一个连接。当设为access时,对每个URI类型发起一个连接。由于大部分为http,因此也大致满足要求

永久设置

echo 'Acquire::Queue-Mode "access";' >/etc/apt/apt.conf.d/75download

临时设置

apt -o Acquire::Queue-mode=access upgrade

STM32 HAL UART循环发送缓存

 •  Filed under Embedded
#define UART_SEND_BUFF_SIZE		100
uint8_t UARTSendBuff[UART_SEND_BUFF_SIZE + 2] = {0};
uint16_t UARTSendBuffDataPos = 0;
uint16_t UARTSendBuffUsedPos = 0;
uint8_t UARTSendBuff_FlagSendBusy = 0;
void UARTSendBuff_putData(uint8_t * data,uint16_t len){
    while(len){
        UARTSendBuffDataPos++;
        if(UARTSendBuffDataPos > UART_SEND_BUFF_SIZE){
            UARTSendBuffDataPos = 1;
        }
        UARTSendBuff[UARTSendBuffDataPos] = *data;

        len --;
        data++;
    }
}

void UARTSendBuff_StartSend(){
    if(UARTSendBuff_FlagSendBusy == 0){
        if(UARTSendBuffDataPos == UARTSendBuffUsedPos){
            return;
        }else if(UARTSendBuffDataPos > UARTSendBuffUsedPos){
            UARTSendBuff_FlagSendBusy = 1;
            HAL_UART_Transmit_IT(&huart2,&UARTSendBuff[UARTSendBuffUsedPos + 1],(UARTSendBuffDataPos-UARTSendBuffUsedPos));
            UARTSendBuffUsedPos = UARTSendBuffDataPos;
        }else if(UARTSendBuffDataPos < UARTSendBuffUsedPos){
            if(UARTSendBuffUsedPos == UART_SEND_BUFF_SIZE){
                UARTSendBuffUsedPos = 0;
                UARTSendBuff_FlagSendBusy = 1;
                HAL_UART_Transmit_IT(&huart2,&UARTSendBuff[UARTSendBuffUsedPos + 1],(UARTSendBuffDataPos-UARTSendBuffUsedPos));
                UARTSendBuffUsedPos = UARTSendBuffDataPos;
            }else{
                UARTSendBuff_FlagSendBusy = 1;
                HAL_UART_Transmit_IT(&huart2,&UARTSendBuff[UARTSendBuffUsedPos + 1],(UART_SEND_BUFF_SIZE-UARTSendBuffUsedPos));
                UARTSendBuffUsedPos = 0;
            }
        }
    }
}

void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart){
    UARTSendBuff_FlagSendBusy = 0;
    UARTSendBuff_StartSend();
}

void UARTSEndBuff_Send(uint8_t * data,uint16_t len){
    UARTSendBuff_putData(data,len);
    UARTSendBuff_StartSend();
}