Skip to content

Instantly share code, notes, and snippets.

View euikook's full-sized avatar
🎯
Focusing

euikook euikook

🎯
Focusing
View GitHub Profile
@euikook
euikook / start-vm
Last active July 26, 2016 08:27
Headless start VirtualBox VM
#!/usr/bin/env bash
# ~/bin/start-vm
VBoxManage startvm $1 --type headless
@euikook
euikook / gbackup
Last active February 19, 2018 07:57
Backup using rsync+ssh
#!/usr/bin/env bash
#Title : gbackup
#Description : Backup script using rsync+ssh
#Author : E.K. KIM (euikook@gmail.com)
#Date : 2018-02-19
#Version : 1.0
#Usage : gbackup [-i] [-d DAYS] [-h REMOTE-HOST] [-e SSH-OPTS] <SRC-DIR> <DST-DIR>
#Notes : None
@euikook
euikook / README.md
Last active February 18, 2021 04:24 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Foo Bar

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@euikook
euikook / oid-from-mib.sh
Last active August 9, 2018 05:09
How to get OID from MIB file.
#!/usr/bin/env bash
snmptranslate -M . -m ALL -Pu -Tso
@euikook
euikook / Logger.ts
Last active November 2, 2022 16:19
Winston, Typescript, Logger
import * as winston from 'winston';
import * as colors from 'colors/safe';
import { LEVEL } from 'triple-beam';
import * as util from 'util';
export class Logger {
myFormat:any = winston.format.printf((info) => {
return `${info.timestamp} [${info.label}] ${info.level}: ${info.message}`;
});
@euikook
euikook / private-docker-registry.md
Last active October 2, 2018 05:43
Private Docker Registry

Append test.hub to /etc/hosts (each docker host include registry server)

echo "192.168.3.100 test.hub" | sudo tee -a /etc/hosts

Generate self-signed certificates

openssl req   -newkey rsa:4096 -nodes -sha256 -keyout certs/test.hub.key \
-x509 -days 365 -out ./certs/test.hub.crt
@euikook
euikook / trust-the-certificate-at-the-os-level.md
Created October 8, 2018 05:02
Trust the certificate at the OS level

Trust the certificate at the OS level

Ubuntu

cp certs/domain.crt /usr/local/share/ca-certificates/myregistrydomain.com.crt
update-ca-certificates

RED HAT ENTERPRISE LINUX

@euikook
euikook / self-signed-certificates-with-certificate-authority.md
Last active October 10, 2018 07:33
How to self-signed certificate with certificate authority
openssl genrsa -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key \
-subj "/C=KR/ST=Daejeon/L=Yuseong-gu/O=Foo Inc./CN=Foo Certificate Autority/OU=www.foo.com" \
-out ca.crt
@euikook
euikook / DHCP-server-test-in-command-line.md
Last active October 24, 2018 01:01
DHCP Server Test in Command Line
sudo nmap --script broadcast-dhcp-discover
sudo nmap -e enp6s0f0 --script broadcast-dhcp-discover

@euikook
euikook / remove-a-disk-from-lvm-array.md
Last active November 8, 2018 23:56
Remove a disk from LVM array
sudo pvs -o+pv_used
  PV         VG      Fmt  Attr PSize   PFree  Used   
  /dev/sdb1  Storage lvm2 a--  931.51g     0  931.51g
  /dev/sdc1  Storage lvm2 a--   <1.82t 43.01g  <1.78t

I will remove /dev/sdb1 from Storage Virtual Group