2020年8月18日 星期二

Windows AD accountexpires 欄位摘要

1700-01-01  最早時間表示
31241952000000000

1970-01-01
116445312000000000

2020-08-01
132407712000000000

10000000 = 1 秒 

PHP程式計算時間

$time1="2020-08-01 00:00:00";
$time2="2020-08-15 00:00:00";
132407712000000000 + (strtotime($time2) - strtotime($time1)) * 10000000


2020年8月13日 星期四

pipe tar gzip without creating intermediary files

 tar cf - dirname | gzip -9 > file.tar.gz

pipeline 上傳檔案

 cat file|curl -F file=@- http://127.0.0.1/upload.php?a=1

2020年8月12日 星期三

Ubuntu 18.4 capture screen with VLC

安裝

apt install -y vlc vlc-plugin-access-extra

使用
Media-Open capture Device-Capture mode-Desktop-Play-Convert-Browse-Start

2020年8月7日 星期五

How do I allow remote desktop to domain controller?

1.gpedit

2.Computer Configuration - Windows settings - Security Settings - Local policies - User Rights Assignment

2020年8月5日 星期三

resize ext4 partition

1.parted /dev/whatever
2.resize2fs /dev/whatever
3.e2fsck /dev/whatever

2020年8月3日 星期一

bash 由變數轉向

t='1 2 3';
while read a b c;do
echo a=$a b=$b c=$c

done <<< $(echo $t)
echo a=$a b=$b c=$c