Skip to content

Instantly share code, notes, and snippets.

@kaiiiz
kaiiiz / Makefile
Last active August 22, 2024 04:00
A sysfs toy example
KDIR ?= /usr/src/linux
obj-m += sysfs_demo.o
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
@kaiiiz
kaiiiz / 10-auth.conf
Last active July 3, 2020 08:25
2018 NA HW4 - dovecot settings
##
## Authentication processes
##
# Disable LOGIN command and all other plaintext authentications unless
# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
# matches the local IP (ie. you're connecting from the same computer), the
# connection is considered secure and plaintext authentication is allowed.
# See also ssl=required setting.
disable_plaintext_auth = yes
@kaiiiz
kaiiiz / main.cf
Last active July 3, 2020 08:25
2018 NA HW4 - postfix settings
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
@kaiiiz
kaiiiz / iptables.sh
Last active July 3, 2020 08:23
2018 NA HW3 - firewall
#!/bin/bash
EXTIF="eth0"
INTIF="lxcbr0"
WEB1="140.113.235.151 140.113.235.152 140.113.235.153 140.113.235.154" #linux
WEB2="140.113.235.131 140.113.235.132 140.113.235.133 140.113.235.134" #bsd
# Clean tables
iptables -F
iptables -t nat -F
@kaiiiz
kaiiiz / named.conf
Last active July 3, 2020 08:23
2018 NA HW2 - named.conf
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
@kaiiiz
kaiiiz / db.35.229.184
Last active July 3, 2020 08:23
2018 NA HW2 - dns server zone file
$TTL 600
@ IN SOA dns.kaiiiz.nctucs.net. admin.nctucs.net. (
2018042409
1800
900
1W
1D )
; name server
@ IN NS dns.kaiiiz.nctucs.net.