0%

1
2
3
4
5
6
7
label Kali
MENU LABEL Kali on NFS
KERNEL kali/vmlinuz
APPEND ro initrd=kali/initrd ip=192.168.1.41::192.168.1.3:255.255.255.0:live boot=live netboot=nfs nfsroot=192.168.1.49:/nfs/kali
TEXT HELP
Starts the Kali Linux Live
ENDTEXT

Image should be in folder /nfs/kali/live, default name is filesystem.squashfs

1
2
apt-get install -y xz-utils openssl gawk file
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 11 -v 64 -a -firmware

默认用户名为:root,默认密码为:MoeClub.org

To enable IPv6

1
echo "iface enp0s3 inet6 dhcp" >> /etc/network/interfaces

My system is running overlayfs as root. When I update grub or any kernal related packages, I will encounter following error:

1
/usr/sbin/grub-probe: error: failed to get canonical path of `overlay'.

And here is the fix:

patch grub-mkconfig to not probe / when GRUB_DEVICE is set.

1
2
3
4
5
6
7
8
9
10
11
cat <<'PATCH' | patch /usr/sbin/grub-mkconfig

+++ /usr/sbin/grub-mkconfig 2013-10-28 11:33:15.000000000 -0400
@@ -129,7 +129,7 @@
mkdir -p ${GRUB_PREFIX}
# Device containing our userland. Typically used for root= parameter.
-GRUB_DEVICE="`${grub_probe} --target=device /`"
+GRUB_DEVICE=${GRUB_DEVICE-"`${grub_probe} --target=device /`"}
GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
# Device containing our /boot partition. Usually the same as GRUB_DEVICE.
PATCH

Pass the GRUB_DEVICE parameter through sudo

1
2
3
echo 'Defaults env_keep +="GRUB_DEVICE"' > /etc/sudoers.d/keep-grub-device

chmod 0440 /etc/sudoers.d/keep-grub-device

set it (in bashrc or wherever else) and update away

1
2
export GRUB_DEVICE=/dev/sda5
sudo update-grub

Don’t remember to mount /boot, otherwise the problem will persist.

Some pdftk usage example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

# get meta data
pdftk input.pdf dump_data_utf8

# update meta data, input is from above command
pdftk in.pdf update_info_utf8 pdfinfo.txt output out.pdf

# The output consists of the first 12 pages of inA.pdf, followed by page 3 of inB.pdf and then pages 14 until end of inA.pdf
pdftk A=inA.pdf B=inB.pdf cat A1-12 B3 A14-end output out1.pdf

# combine pdfs
pdftk file1.pdf file2.pdf file3.pdf cat output newfile.pdf

pdftk "${1}" dump_data|head -17 > pdfinfo.txt
pdftk A="${1}" B=insert.pdf cat A1 B1 A2-end output out1.pdf
pdftk out1.pdf update_info pdfinfo.txt output "${1}"
rm -rf out1.pdf