ca sign cert

Submitted by lepton on Wed, 07/29/2020 - 14:18


openssl genrsa -out cakey.pem 2048

openssl req -new -x509 -days 3650 -key cakey.pem -out cacert.pem

openssl genrsa -out c1.key 2048

openssl req -new -key c1.key -out c1.csr

#commonName = optional
openssl ca -in c1.csr -out c1.crt -days=3650 -create_serial

openssl pkcs12 -export -clcerts -in c1.pem -out c1.p12

time machine backup to samba

Submitted by lepton on Tue, 07/14/2020 - 11:53

1. make a sparseimage or sparsebundle file using Disk Utility
 //hdiutil create -size 1000g -type SPARSEBUNDLE -nospotlight -volname "Name" -fs "Journaled HFS+" -verbose file.sparsebundle

2. copy the file to a samba dir

3. mount the disk image file

4. sudo tmutil setdestination /Volumes/DiskImageMountPoint

5. now the disk is available in time machine

gentoo simple install

Submitted by lepton on Mon, 06/22/2020 - 17:07

download stage3

tar xpvf stage3-*.tar.bz2 --xattrs-include='*.*' --numeric-owner


cp --dereference /etc/resolv.conf /mnt/gentoo/etc/

mount --types proc /proc /mnt/gentoo/proc

mount --rbind /sys /mnt/gentoo/sys

mount --make-rslave /mnt/gentoo/sys

mount --rbind /dev /mnt/gentoo/dev

mount --make-rslave /mnt/gentoo/dev

WireGuard connect

Submitted by lepton on Tue, 05/26/2020 - 15:39

wg genkey | tee server.key | wg pubkey >

PEER_Endpoint="endpoint ip:9902" #maybe empty
ip link del wg0 ip link add dev wg0 type wireguard
ip addr add $MY_IP dev wg0
wg set wg0 listen-port $MY_PORT private-key /etc/wireguard/server.key
wg set wg0 peer $PEER_A_PUB $PEER_Endpoint allowed-ips $PEER_A_IP/32
ip link set wg0 up

in dir /etc/wireguard

How to clear the /Library/StageExtensions folder

Submitted by lepton on Wed, 04/22/2020 - 14:33

This command will clear all the /Library/StageExtensions folder.

# sudo kextcache --clear-staging


only clear some file

# sudo rm -rf /Library/Extensions/somefile

# sudo kextcache -invalidate /

# ls /Library/StagedExtensions/



#sudo kextcache  -prune-staging //Prunes the kernel extension staging area by removing all kernel extensions no longer present in their original location.