Skip to content

Instantly share code, notes, and snippets.

Shai chikosan

Block or report user

Report or block chikosan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chikosan
chikosan / audit.rules
Created Jun 3, 2019 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
View audit.rules
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@chikosan
chikosan / dev_signed_cert.sh
Created Mar 4, 2019 — forked from dobesv/dev_signed_cert.sh
Script to create (1) a local certificate authority, (2) a host certificate signed by that authority for the hostname of your choice
View dev_signed_cert.sh
#!/usr/bin/env bash
#
# Usage: dev_signed_cert.sh HOSTNAME
#
# Creates a CA cert and then generates an SSL certificate signed by that CA for the
# given hostname.
#
# After running this, add the generated dev_cert_ca.cert.pem to the trusted root
# authorities in your browser / client system.
#
@chikosan
chikosan / install_lamp_18.sh
Created Feb 24, 2019 — forked from ankurk91/install_lamp_18.sh
Ubuntu 18.04 - PHP development (php 7.2, MySQL 5.7, apache 2.4)
View install_lamp_18.sh
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 18.04 dev Server
# Run like - bash install_lamp.sh
# Script should auto terminate on errors
echo -e "\e[96m Adding PPA \e[39m"
sudo add-apt-repository -y ppa:ondrej/apache2
@chikosan
chikosan / backup-disk.sh
Created Apr 14, 2018 — forked from lihaibh/backup-disk.sh
create snapshot of a remote linux disk to your local machine
View backup-disk.sh
#/usr/bin/env sh
SSH_HOST=host.name
BACKUP_DISK="sda"
DISK_SIZE_BYTES=$(($(ssh $SSH_HOST "lsblk --all | grep \"$BACKUP_DISK\" | head -1" | while read c1; do echo $c1; done | cut -d" " -f4 | sed "s/G//g") * 1073741824))
BLOCK_SIZE=512
IMAGE_NAME="./sda.disk"
[ -f $IMAGE_NAME ] && IMAGE_CUR_SIZE=$(stat -c "%s" $IMAGE_NAME) || IMAGE_CUR_SIZE=0
WRITEN_BLOCKS=$(($IMAGE_CUR_SIZE / $BLOCK_SIZE))
echo -e "Current clone file size: \e[1m$IMAGE_CUR_SIZE\e[0m, total remote disk size: \e[1m$DISK_SIZE_BYTES\e[0m"
View vmtools-remote-install
#!/bin/bash
# shopt -s nullglob
shopt -s nocasematch
veros=$( grep 'release' /etc/*release | grep release | cut -d " " -f4 | uniq )
#read -p "please enter your ip:" ipinput
#ssh -o StrictHostKeyChecking=no $ipnput -l root "main"
vminstall() {
You can’t perform that action at this time.