Skip to content

Instantly share code, notes, and snippets.

View 831jsh's full-sized avatar
💭
I may be slow to respond.

SeongHo's Project 831jsh

💭
I may be slow to respond.
View GitHub Profile
@831jsh
831jsh / bash_snippets.md
Created September 16, 2017 13:02 — forked from renoirb/bash_snippets.md
JavaScript snippets

Bash useful and neat snippets

Ensure a process exist

# incomplete
ps -o pid -C ssh-agent|sed -n '2p'
@831jsh
831jsh / KUBERNETES.md
Created September 16, 2017 13:02 — forked from renoirb/KUBERNETES.md
Setup Pine64 5 node cluster from longsleep Ubuntu 16.04 base image
@831jsh
831jsh / sysctl.conf
Created September 16, 2017 19:02 — forked from sokratisg/sysctl.conf
Tuned sysctl.conf for use by CentOS/RHEL 6.x or later
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Turn on execshield
# 0 completely disables ExecShield and Address Space Layout Randomization
# 1 enables them ONLY if the application bits for these protections are set to “enable”
# 2 enables them by default, except if the application bits are set to “disable”
# 3 enables them always, whatever the application bits
@831jsh
831jsh / permissions.sql
Created September 16, 2017 19:03 — forked from sokratisg/permissions.sql
MySQL permissions for Backup Admin
CREATE USER 'backupadmin'@'localhost' IDENTIFIED BY '<secret_password>';
GRANT LOCK TABLES, SELECT ON <DB_NAME>.* TO 'backupadmin'@'localhost';
GRANT RELOAD ON *.* TO 'backupadmin'@'localhost';
GRANT CREATE, INSERT, DROP ON mysql.ibbackup_binlog_marker TO 'backupadmin'@'localhost';
GRANT CREATE, INSERT, DROP ON mysql.backup_progress TO 'backupadmin'@'localhost';
GRANT CREATE, INSERT, SELECT, DROP ON mysql.backup_history TO 'backupadmin'@'localhost';
GRANT REPLICATION CLIENT ON *.* TO 'backupadmin'@'localhost';
GRANT SUPER ON *.* TO 'backupadmin'@'localhost';
GRANT CREATE TEMPORARY TABLES ON mysql.* TO 'backupadmin'@'localhost';
FLUSH PRIVILEGES;
@831jsh
831jsh / ovirt-private-ca.md
Created October 11, 2017 11:02 — forked from qrkourier/ovirt-private-ca.md
Install a Server Certificate For oVirt Manager UI

Install server certificates issued by a private CA in oVirt4 Manager and Host

  • generate a signing request on the system where oVirt Manager is running (the engine server)
openssl req -new -sha256 -key /etc/pki/ovirt-engine/keys/apache.key.nopass -out /tmp/engine.csr
  • Submit the CSR to the issuer and wait. Or, if you are the issuer and you happen to be using FreeIPA/IdM, you may issue the certificate with ipa-admintools. For example,

To install tcptraceroute on Debian/Ubuntu:

$ sudo apt-get install tcptraceroute

To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:

$ sudo yum install tcptraceroute
@831jsh
831jsh / README.md
Created February 21, 2018 13:10 — forked from ringe/README.md
KVM QCOW2 Live backup

Live backup of KVM virtual machines

This script will let you make backups of live VMs running on KVM, using libvirt.

The backup job will suspend the VM for the time it takes to copy the RAM to disk.

Credits: Luca Lazzeroni

I've made some minor adjustments.

@831jsh
831jsh / vm-backup.sh
Created February 21, 2018 13:16 — forked from cabal95/vm-backup.sh
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
@831jsh
831jsh / mount_vm.sh
Created February 21, 2018 13:18 — forked from xezpeleta/mount_vm.sh
Proxmox VM Backup ./mount_vm.sh <VMID> ./umount_vm.sh <VMID>
#! /bin/sh
if [ $# -eq 0 ]
then
echo "No arguments supplied"
exit 1
fi
if [ -z "$1" ]
@831jsh
831jsh / tmux.conf
Created March 20, 2018 16:17 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000