This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "missing parameter" | |
exit 1 | |
fi | |
ZONEFILE=$1 | |
if ! [ -f $ZONEFILE ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dd if=/dev/urandom of=myvolume.key bs=1 count=2048 | |
cryptsetup luksFormat -c aes-cbc-essiv:sha256 -s 256 /path/to/myvolume | |
cryptsetup luksAddKey /path/to/myvolume myvolume.key | |
cryptsetup luksRemoveKey /path/to/myvolume | |
cryptsetup luksDump /path/to/myvolume | |
cryptsetup luksOpen -d myvolume.key /path/to/myvolume myvolume_enc | |
mkfs.ext4 /dev/mapper/myvolume_enc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.gigahype.com/resize-luks-encryped-lvm-partition/ | |
# 1. Unmount the filesystem: | |
umount /secret | |
# 2. Run a filesystem check to clean up the inode tables before working with it: | |
fsck.ext3 -C 0 -f /dev/mapper/encrypted | |
# 3. Close out the LUKS filesystem: | |
cryptsetup luksClose encrypted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nfs> | |
<nfs_entries config:type="list"> | |
<nfs_entry> | |
<mount_point>/var/tmp</mount_point> | |
<nfs_options>bind</nfs_options> | |
<server_path>/tmp</server_path> | |
<vfstype>auto</vfstype> | |
</nfs_entry> | |
</nfs_entries> | |
</nfs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws s3api list-objects --bucket <bucket-name> --output json --query "[sum(Contents[].Size), length(Contents[])]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# filter by request host header | |
varnishlog -q 'ReqHeader ~ "Host: example.com"' | |
# filter by request url | |
varnishlog -q 'ReqURL ~ "^/some/path/"' | |
# filter by client ip (behind reverse proxy) | |
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"' | |
# filter by request host header and show request url and referrer header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lvresize --poolmetadata +50M data/dockerpool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log 127.0.0.1 local0 | |
log 127.0.0.1 local1 notice | |
log-send-hostname | |
maxconn 4096 | |
pidfile /var/run/haproxy.pid | |
user haproxy | |
group haproxy | |
daemon | |
stats socket /var/run/haproxy.stats level admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env stap | |
global log_nfs_file_open = 1; | |
global log_nfs_file_read = 1; | |
global log_nfs_file_write = 1; | |
global log_nfs_getattr = 1; | |
global log_nfs_permission = 1; | |
global log_nfs_opendir = 1; | |
global log_nfs_lookup = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: | |
# https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-or-empty-bucket.html | |
# empty a bucket | |
# aws s3 rm s3://bucket-name --recursive | |
# delete a bucket | |
# aws s3 rb s3://bucket-name --force |
OlderNewer