baumi's blog

baumi's personal blog … Linux, OS X, Windows, Random things, …

Hardening WordPress, tshark decrypting SSL traffic

From a security point of view, WordPress seems to be a nightmare. The default setup exposes hundrets of .php include files in wp-includes/ and wp-content/ that may be directly called. And indeed, many robots out there are scanning the whole internet for these kind of files. Here are some ideas to improve security. Step 1: […]

Effectively storing multiple text files

Step 1: use 7z. The compression is far superior compared to other archivers, because the compression dictionary is reused between files. Compressing one file with 7z and compareing to e.g. gzip will show similar results. Compressing two similar files with 7z as opposed to gzip, will show dramatic differences in compression ratio between 7z and […]

Bash: trim left and right (leading and trailing whitespaces)

Wanted: remove leading and trailing whitespaces from variables or cat’d lines from a textfile. – Simple solution: echo ” a b c d ” | awk ‘{$1=$1};1’ prints: “a b c d” For convenience, i created /usr/bin/trim with this content: #!/bin/bash awk ‘{$1=$1};1’ which then allows echo ” a b c d ” | trim

Useful tools & commands for resizing/growing LVM based disks/filesystems …

gparted … https://www.gnu.org/software/parted/ https://gparted.org/download.php first boot into gparted, rightlick on the locked LVM areas and click “disable”. the lock disappears. then resize them to maximum, then open terminal: useful sample commands: (WARNING: DO *NOT* USE THESE COMMANDS UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING! They are *NOT* thought to be copy/pasted, it’s just a […]

btrfs compression

mount -t btrfs -o compression=lzo /root/btrfs.img /mnt/btrfs or mount -t btrfs -o compression=zlib /root/btrfs.img /mnt/btrfs where lzo is faster. Useful commands for testing: dd if=/dev/zero of=btrfs.img bs=1M count=100 mkfs.btrfs ./btrfs.img mkfs.btrfs -O list-all mount -t btrfs -o compress=lzo ./btrfs.img /mnt/btrfs ATTENTION: the mount options for compression will ONLY be taken over from THE FIRST TIME […]

Previous Posts Next posts