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
if lsblk | grep -q '^sdb'; then | |
parted --script /dev/sdb mklabel gpt mkpart primary 0% 100% | |
echo "none" >/sys/class/block/sdb/queue/scheduler | |
pvcreate /dev/sdb1 | |
vgcreate vg_data /dev/sdb1 | |
lvcreate -l 100%FREE -n lv_data vg_data | |
mkfs.xfs -f /dev/vg_data/lv_data | |
mkdir -p /data |
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
host=$(hostname) | |
/sbin/chkconfig -list > 01.1.services.txt | |
/bin/cat /etc/xinetd.conf > 01.2.etc_xinetdconf.txt | |
/bin/cat /etc/xinetd.d/r* > 01.3.etc_xinetdd_r.txt | |
/bin/ls -al /home/* > 01.4.home_dirs.txt | |
/bin/cat /etc/hosts.equiv > 02.${host}_host_equiv.txt | |
/bin/ls -l /etc/hosts.equiv > 03.${host}_perm_equiv.txt | |
/bin/cat /etc/passwd > 04.${host}_etc_passwd.txt | |
/bin/more /etc/shadow > 05.etc_shadow.txt | |
/usr/bin/ypcat passwd > 06.passwd.txt |
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
import logging | |
import os | |
import pathlib | |
import sys | |
from datetime import datetime | |
import time | |
from dotenv import load_dotenv | |
# env = load_dotenv() |
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 | |
# Script Gen file and rename file | |
number_small_file=1000 | |
number_large_file=500 | |
#sudo apt install pwgen -y | |
# ================ Small file ================ |
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 bash | |
# shellcheck disable=SC1117 | |
# Ubuntu Kernel PPA info | |
ppa_host="kernel.ubuntu.com" | |
ppa_index="/~kernel-ppa/mainline/" | |
ppa_key="17C622B0" | |
# If quiet=1 then no log messages are printed (except errors) |
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
sub parse_config { | |
my ($class, $filename, $raw) = @_; | |
my $cfg = $class->SUPER::parse_config($filename, $raw); | |
my $ids = $cfg->{ids}; | |
=comment-out | |
# make sure we have a reasonable 'local:' storage | |
# we want 'local' to be always the same 'type' (on all cluster nodes) |
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/sh | |
# The following arguments are passed to the script: | |
# | |
# <master-name> <role> <state> <from-ip> <from-port> <to-ip> <to-port> | |
MASTER_IP=$6 | |
VIP=172.17.0.101 | |
NETMASK=16 | |
IF=eth0 | |
MY_IP=$(ip addr show dev $IF | grep "global $IF" | head -1 | sed -e "s/^.*inet \(.*\)\/$NETMASK .*$/\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
#!/usr/bin/env bash | |
# print usage | |
DOMAIN=$1 | |
if [ -z "$1" ]; then | |
echo "USAGE: $0 ghtk.local" | |
echo "" | |
echo "This will generate a non-secure self-signed wildcard certificate for given domain." | |
echo "This should only be used in a development environment." |
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 python | |
import socket | |
from kombu import Connection | |
host = "localhost" | |
port = 5672 | |
user = "guest" | |
password = "guest" | |
vhost = "/" | |
url = 'amqp://{0}:{1}@{2}:{3}/{4}'.format(user, password, host, port, vhost) | |
with Connection(url) as c: |
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 [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
cd /root | |
wget https://mirrors.sonic.net/pub/OpenBSD/OpenSSH/portable/openssh-8.5p1.tar.gz | |
tar -zxvf openssh-8.5p1.tar.gz | |
cd openssh-8.5p1 |
NewerOlder