Skip to content

Instantly share code, notes, and snippets.

@kenshin17
kenshin17 / install-ndppd-active-ipv6-subnet.sh
Last active January 21, 2024 14:56
Script install NDP Proxy Daemon, active full subnet ipv6.
#!/bin/bash
# Author: kenshin17
# OS: Centos 7
# Description: Script install NDP Proxy Daemon, active full subnet ipv6.
IPv6SUBNET="xxxx:xxxx:xxxx:xxxx::/64"
echo "######################## CONFIG SYSCTL #########################"
echo "net.ipv6.conf.all.accept_ra = 2" >> /etc/sysctl.conf
echo "net.ipv6.conf.eth0.accept_ra = 2" >> /etc/sysctl.conf
@kenshin17
kenshin17 / Dockerfile
Created July 10, 2023 10:43 — forked from fhdalikhan/Dockerfile
Dockerfile for PHP 7.4 FPM Alpine
FROM php:7.4-fpm-alpine
WORKDIR /var/www/html
# Setup GD extension
RUN apk add --no-cache \
freetype \
libjpeg-turbo \
libpng \
freetype-dev \
@kenshin17
kenshin17 / jwtRS256.sh
Created March 13, 2023 06:52 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@kenshin17
kenshin17 / kubedf
Created October 25, 2021 10:21 — forked from redmcg/kubedf
Bash script to show k8s PVC usage
#!/usr/bin/env bash
NODESAPI=/api/v1/nodes
function getNodes() {
kubectl get --raw $NODESAPI | jq -r '.items[].metadata.name'
}
function getPVCs() {
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\
  1. Make sure mysql-client is installed. If not, then :
    sudo apt install mysql-client
	or
    sudo apt-get install mysql-client
  1. Open php.ini

; PHP's default character set is set to UTF-8.

@kenshin17
kenshin17 / curl.md
Created June 16, 2021 03:06 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@kenshin17
kenshin17 / nginx-tls.conf
Created January 28, 2021 03:04 — forked from gavinhungry/nginx-tls.conf
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
@kenshin17
kenshin17 / haproxy.config
Created January 21, 2021 06:39 — forked from meineerde/haproxy.config
Set all cookies set in the HTTP response to HttpOnly
acl httponly_cookie res.hdr(Set-Cookie),lower -m sub httponly
rspirep ^(set-cookie:.*) \1;\ HttpOnly if !httponly_cookie
@kenshin17
kenshin17 / compile-postgreSQL-11.5-Ubuntu-16.04.LTS.sh
Created November 4, 2019 07:40
Compile PostgreSQL 11.5 on Ubuntu
#!/bin/bash
# File : compile-postgreSQL-11.5-Ubuntu-16.04.LTS.sh
# OS : Ubuntu 16.04.6 LTS
# LastUpdate : 10:06 2019.10.07
# Description : Compile PostgreSQL 11.5 on Ubuntu
###########################################
##POSTGRESQL : /postgres/pgscript/postgres-stop.sh | /postgres/pgscript/postgres-restart.sh <<<<<RESTART>>>>>
# | CONFIG FILE : /postgres/pgdata/{postgresql.conf,pg_hba.conf}
# | CONNECT DBA : /postgres/pgscript/postgres-connect-dba.sh
@kenshin17
kenshin17 / iterm2-solarized.md
Created March 18, 2020 16:50 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k