Linux Shell 程式設計與管理實務 p159 範例6-5-1:

#   範例6-5-1
#
#   用途: 找出 /etc 目錄中最新的檔案,符號連結檔不計入。
#
#
#! /bin/bash
unset -v newfile
for f in /etc/*; do  
    [ -f $f -a ! -L $f ] &&     # [ ] 代表條件判斷, 
                                # -f $f :  若 $f 檔案存在, 
                                # -a : 且 
                                # ! -L $f : 該檔案不是符號連結檔
    [[ $f -nt $newfile ]] &&    # 比較檔案時間
    newfile=$f                  # 只記錄較新的檔案
done

echo "最新的檔案是: $newfile"

執行結果: 最新的檔案是: /etc/mailcap

ls -la /etc/mailcap

-rw-r--r-- 1 root root 106597 9月 11 07:29 /etc/mailcap (2024/09/11 AM 07:29)


OpenSSH 可移植版-遠端代碼競行漏洞

二 02 七月 2024 by ols3

OpenSSH sec

sshd(8) in Portable OpenSSH versions 8.5p1 to 9.7p1 (inclusive). Race condition resulting in potential remote code execution. A race condition in sshd(8) could allow remote code execution as root on non-OpenBSD systems. This attack could be prevented by disabling the login grace timeout (LoginGraceTime …

read more

xz-utils 植入後門 (CVE-2024-3094)

五 29 三月 2024 by ols3

xz-utils: backdoor in upstream xz/liblzma leading to ssh server compromise

Debian CVE-2024-3094

Malicious code was discovered in the upstream tarballs of xz, starting with version 5.6.0. Through a series of complex obfuscations, the liblzma build process extracts a prebuilt object file from a disguised test file existing …

read more

白宮敦促開發人員放棄 C 和 C++

四 29 二月 2024 by ols3

拜登政府呼籲開發人員採用記憶體安全的程式語言,並遠離那些導致緩衝區溢位和其他記憶體存取漏洞的語言。

https://www.infoworld …

read more

純文字簡報工具 sent

一 19 二月 2024 by ols3

sent

安裝及用法:

git clone https://git.suckless.org/sent
cd sent/
make && ./sent example
read more

C++ for Python programmers

四 18 一月 2024 by ols3

OpenBSD 工作站安全強化技巧

四 04 一月 2024 by ols3

給 Geany IDE 加一個 clang 外掛

日 24 十二月 2023 by ols3

外掛 .so 能上了,再進下一步 ...

clang-complete

read more

OpenSSH 9.6 (2023/12/18)

四 21 十二月 2023 by ols3

OpenSSH 9.6 釋出,修正 SSH 傳輸協定的缺陷,避免 Terrapin 攻擊(MITM 中間人水龜攻擊):

當客戶端和伺服器都支援時,OpenSSH 9.6 新的「嚴格 KEX」協定 …

read more

Quod Libet

三 20 十二月 2023 by ols3

Quod Libet 是一個用 Python 編寫的基於GTK+的音訊播放器,使用Mutagen標記庫。它的設計理念是使用者更了解如何組織音樂。它可以讓您根據正規 …

read more

物盡其用,Intel G3420 邁入第十個年頭

六 02 十二月 2023 by ols3

我只買當期末代或最便宜的 CPU 產品,因為,夠用就好,而且,我也用不完它所有的功能。

這顆 G3420 用了快 10 年了,目前,仍是我工作 …

read more

Geany IDE 獨立免安裝 AppImage

五 01 十二月 2023 by ols3

Geany 2.0.0 AppImage 釋出 ...

Geany 是一款功能強大、穩定且輕量級的程式設計編輯器,我把它包成一個獨立可執行的 AppImage,完全免安裝。

  • 支援 …
read more

uemacs 的加密功能

六 25 十一月 2023 by ols3

uemacs 的加密功能:

uemacs crypt function

/*  CRYPT.C
 *
 *  Encryption routines
 *
 *  written by Dana Hoggatt and Daniel Lawrence
 */

#include    <stdio.h>
#include    "estruct.h"
#include    "edef.h"
#include        "efunc.h"

#if CRYPT

static int mod95(int);

/*
 * reset encryption key of current buffer
 *
 * int f;       default flag
 * int n;       numeric argument
 */
int …
read more

uemacs 中文可用版 4.0.15.1 tw

三 22 十一月 2023 by ols3

我是重度的 Emacs 編輯器的使用者, 過去出版的書籍全都是在 Emacs 中完成的; 但 Emacs 太厚重, 在遠端跨主機工作不方便, 輕便的 uemacs 便 …

read more

AES 加解密器

二 21 十一月 2023 by ols3
  • v1.0.4.1 : 加解密速度快 4 倍、強化記憶體配置。
  • v1.0.4.0 : 新增 Salt '鹽巴調味' 功能,讓暴力破解、字典攻擊、彩虹表攻擊更困難。
  • 主 …
read more

SSL libraries

五 03 十一月 2023 by ols3

NGINX

三 25 十月 2023 by ols3

X3BL 簡易 HTTPS Server v1.0.1

一 23 十月 2023 by ols3

https://www.ols3.net:8080/

X3BL 簡易 HTTPS Server v1.0.1:

  • 高擴展性:可以輕鬆處理數萬個連接
  • 支援 Let's Encrypt TLS 憑證

X3BL-HTTPS-Server

壓力測試: (由慢速的學術網路連入)

Running …
read more

適用於 Windows 的 GCC/MinGW-w64 獨立編譯器

六 21 十月 2023 by ols3

WinLibs : 適用於 Microsoft Windows 的免費 C 和 C++ 編譯器。

GCC(GNU 編譯器集合)是一個免費的開源編譯器,適用於 C 和 C++(以及 Objective-C、Fortran、D 等其他語言)。 MinGW-w64是一個免費開源 …

read more

OpenBSD 7.4 推出!

二 17 十月 2023 by ols3

OpenBSD 7.4 推出啦! ;-)

OpenBSD 7.4 release

Changelog

OpenBSD

read more