XDQ的笔记本

robocopy

 •  Filed under windows
ROBOCOPY "\\servername\sharelocation" "\\newservername\newsharelocation" /MIR    /SEC /LOG:location:\nameoflogfile

重置mac appstore缓存

 •  Filed under mac

关闭App Store
使用终端执行

open $TMPDIR../C/com.apple.appstore/

删除打开文件夹下的所有文件

selinux 常用命令

 •  Filed under linux, centos, centos7, selinux

查看是否有被selinux阻挡

sudo cat /var/log/audit/audit.log | grep denied

boolean

查看boolean状态

sudo sestatus -b

sudo sestatus -b | grep -i sendmail

设置boolean

sudo setsebool -P $boolean名 $1或0

常用boolean

boolean名 意义
httpd_can_network_connect 允许httpd反向代理
httpd_can_sendmail 允许httpd发送邮件

semanager

安装semanager

sudo yum install -y policycoreutils-python

获取系统中的可用label

sudo semanage fcontext -l |grep {SOMETHING}

给文件设置label

sudo semanage fcontext -a -t httpd_sys_content_t /path/to/file
restorecon -v /path/to/file

给文件夹设置label

sudo semanage fcontext -a -t httpd_sys_content_t "/path/to/dir(/.*)?"
restorecon -R -v /path/to/dir

CC1310 Sensor Controller 变更RTC事件时序

 •  Filed under MCU, TI, CC1310

在delay时间后以interval的周期运行Sensor Controller的RTC事件

#include DeviceFamily_constructPath(inc/hw_aon_rtc.h)

uint32_t scifOsalEnterCriticalSection(void);
void scifOsalLeaveCriticalSection(uint32_t key);

//delay应大于8
void SceRTCDelay(uint32_t delay,uint32_t interval){
    uint32_t key, sec, subsec,startTime;
    /* disable hwi to make sure startTime won't become past */
    key = scifOsalEnterCriticalSection();
    /* read current rtc value */
    sec = HWREG(AON_RTC_BASE + AON_RTC_O_SEC);
    subsec = HWREG(AON_RTC_BASE + AON_RTC_O_SUBSEC);
    /* calc next start time */
    startTime = ((sec << 16) | (subsec >> 16)) + delay;
    /* update the RTC cannel config */
    scifStartRtcTicks(startTime, interval);
    scifOsalLeaveCriticalSection(key);
}

TI CC1310 TRNG使用

 •  Filed under MCU, TI, CC1310

头文件

#include DeviceFamily_constructPath(driverlib/trng.h)

初始化

Power_setDependency(PowerCC26XX_PERIPH_TRNG);
TRNGEnable();
while (!(TRNGStatusGet() & TRNG_NUMBER_READY))
{
    //wait for random number generator
}

读取低32位

TRNGNumberGet(TRNG_LOW_WORD)

判断是否已经启动

if (0 == (HWREG(TRNG_BASE + TRNG_O_CTL) & TRNG_CTL_TRNG_EN))
{
    //trng is disable
}

关闭

TRNGDisable();
Power_releaseDependency(PowerCC26XX_PERIPH_TRNG);