Snippets mdadm

24/January/2019 mdadmraid

Setting minimum and maximum speeds for devices

1
2
3
# 70000 kilobytes/s ~ 68 Mb/s
echo "70000" > /proc/sys/dev/raid/speed_limit_min
echo "100000" > /proc/sys/dev/raid/speed_limit_max

sysctl analogue

1
2
dev.raid.speed_limit_min=70000
dev.raid.speed_limit_max=100000
Snippets mdadm

Selecting a bootable kernel in the U-Boot console via a debugging connection

29/August/2018 debianubootcubieboardkerneluart

What did the embedded system look like?

Manual kernel selection
Manual kernel selection 595x715
u-boot-kernel-select.png


There is one small CubieBoard 2 next to the small router.
And there is no physical access to them.
A USB-UART is connected to a router controlled by LEDE, the pins of which are connected to CubieBoard2.
Both the router and CubieBoard2 are accessible via ssh.

It was the presence of UART in the assembly that allowed us to raise the fallen CubieBoard2 remotely.

How did it fail?

One day a regular update of the Debian kernel arrives
linux-image-4.9.0-8-armmp-lpae.
After the update the system stops responding.

How is this usually done?

Everything is simple here, you take out the microsd card, and then there is no need to describe it further.

Selecting a bootable...

Cheatsheet for debootstrap

12/August/2018 debootstrapchroot

Deploying the required system for a quick debugging


Sometimes you need to quickly test something in a specific environment that is native to that application, such as Ubuntu.
And no, it’s not Docker, because you often need to have a normal ability to work with this environment as a system, edit configs, install packages, and so on.
Rebuilding docker images or configuring something inside them is a very specific and strange pleasure.
KVM is not needed here, LXC takes longer to set up and is more difficult to interact with.
Yes, the easiest way is debootstrap and good old chroot.

Let me note that this is not about isolation and security, but about a quick way to run trusted software in a specific environment.

amd64 xenial

1
2
mkdir /data/.box/amd64_xenial
/usr/sbin/debootstrap --verbose --include=nano,bash-completion,aptitude --arch amd64 xenial /data/.box/amd64_xenial http://archive.ubuntu.com/ubuntu/
Cheatsheet for debootstrap...

Laconic openvpn setup

30/September/2017 openvpnopenssl

Basic example of openvpn settings

1
2
3
4
5
6
7
8
cd /etc/openvpn
mkdir ccd
mkdir crl
mkdir keys
mkdir secret
chmod 700 keys secret
printf '00' > serial
touch index.txt

As an example.
Organization Name: OVPN-NET
Common Name: OVPN-SERVER

nano openssl.cnf

Laconic openvpn setup...

ext4 without journaling, fast and insecure

3/December/2015 ext4tune2fsmkfsmount

This use is not recommended for an important data.

A little faster, but much less reliable

1
2
3
4
mkfs.ext4 -m0 /dev/mapper/lvm-test
# Disable periodic file system checking after a certain number of mounts
tune2fs -c0 -i0 -m0 /dev/mapper/lvm-test
# Same as data=writeback when mounting a partition
ext4 without journaling,...
Page 4 from 4