Skip to content

Instantly share code, notes, and snippets.

View voicon's full-sized avatar

Vinh TRAN voicon

View GitHub Profile
@voicon
voicon / Readme.md
Created March 11, 2022 12:03 — forked from felixkrohn/Readme.md
centos8 @ OVH/SoYouStart/Kimsufi

centos8 @ OVH/SoYouStart/Kimsufi

How to install CentOS 8 on OVH/SoYouStart/Kimsufi

  • connect to the OVH/SoYouStart/Kimsufi API and create a ipxe script under https://eu.api.kimsufi.com/console/#/me/ipxeScript#POST or equivalent, see centos8.ipxe below
  • boot your server from this netboot, and ping it to follow the process. If you can observe the webserver's logs you will se your server's IP pulling kernel and initrd with "iPXE" user agent, then it will start pinging, and retrieve the kickstart.cfg a bit later (with "curl" user agent). This is the moment when you could set your server back to "Boot from Hard Disk".
  • Also at this point you can connect to your server with SSH using the key/password set in the kickstart file. type tmux a to attach the install's tmux session and follow the progress. For debugging, check the logs in /tmp and those sent over syslog.

upstream documentation

@voicon
voicon / Codes.md
Created December 20, 2021 10:45 — forked from raulmangolin/Codes.md
Facebook Error Codes
Code Message Info
0 Success
1 API Unknown Possibly a temporary issue due to downtime. Wait and retry the operation. If it occurs again, check you are requesting an existing API.
2 API Service Temporary issue due to downtime. Wait and retry the operation.
3 Unknown method
4 API Too Many Calls Temporary issue due to throttling. Wait and retry the operation, or examine your API request volume.
5 Unauthorized source IP address
8 This method requires an
@voicon
voicon / mysql-5.7-master-slave-replication-centos-7.md
Created December 12, 2021 08:21
MySQL 5.7 Master-Slave Replication on CentOS 7

MySQL 5.7 Master-Slave Replication on CentOS 7

Install and configure MySQL 5.7 with master-slave replication. The benefits of this include high availability, backups, disaster recovery and reporting.

Install MySQL 5.7

Enable MySQL repository

yum localinstall -y https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
@voicon
voicon / 1_google_cloud_storage_backup_tutorial.md
Created November 30, 2021 06:33 — forked from rnwolf/1_google_cloud_storage_backup_tutorial.md
Tutorial shows how to make backups to Google Cloud Storage.

Google Cloud Storage backup tutorial

Introduction

This tutorial shows how to make backups to Google Cloud Storage. The backups are:

  • automatic
  • stored off site
  • incremental
@voicon
voicon / example.php
Created July 16, 2021 09:38 — forked from dunglas/example.php
A GraphQL client using the Symfony HttpClient component
<?php
$query = <<<'GRAPHQL'
query GetUser($user: String!) {
user (login: $user) {
name
email
repositoriesContributedTo {
totalCount
}
@voicon
voicon / example.php
Created July 16, 2021 09:36 — forked from dunglas/example.php
A minimalist GraphQL client for PHP
<?php
$query = <<<'GRAPHQL'
query GetUser($user: String!) {
user (login: $user) {
name
email
repositoriesContributedTo {
totalCount
}
@voicon
voicon / nbconvert-render.sh
Created February 8, 2021 08:55 — forked from zthxxx/nbconvert-render.sh
nbconvert code snippet
# https://nbconvert.readthedocs.io/en/latest/usage.html
# notebook: notebook 文件绝对地址,结尾扩展名 .ipynb
# target_name: 输出目标文件名,无后缀名,根据 type 自动对应生成
# format: 渲染格式 - asciidoc, custom, html, latex, markdown, notebook, pdf, python, rst, script, slides
# render_dir: 输出目录绝对路径
python -m nbconvert -y \
--ExecutePreprocessor.kernel_name="${jupyter_kernel}" \
--ExecutePreprocessor.timeout=-1 \
--execute "${notebook}" \
--output-dir "${render_dir}" \
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name <xxxx.xxx>;
# acem: https://gist.github.com/zthxxx/b37cddcb17395e395ad6b430a81edd61
# cloudflare: https://dash.cloudflare.com/<account_id>/<domain_name>/ssl-tls/origin
ssl_certificate /etc/nginx/ssl/<xxxx.xxx>/fullchain.cer;
ssl_certificate_key /etc/nginx/ssl/<xxxx.xxx>/privkey.key;
POSTGRES_USER='xxxxx'
POSTGRES_PASSWORD='xxxxx'
docker volume create pgdata
docker run -d --rm \
-v pgdata:/var/lib/postgresql/data \
-p 127.0.0.1:5432:5432 \
-e "POSTGRES_USER=$POSTGRES_USER" \
-e "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" \
function gen_ssl_cert {
local prefix="${1}"
openssl genrsa -des3 -out "${prefix}.lock.key" 1024
openssl rsa -in "${prefix}.lock.key" -out "${prefix}.key"
rm "${prefix}.lock.key"
openssl req -new -key "${prefix}.key" -out "${prefix}.csr"
openssl x509 -req -days 3650 -in "${prefix}.csr" -signkey "${prefix}.key" -out "${prefix}.crt"
openssl pkcs12 -export -inkey "${prefix}.key" -in "${prefix}.crt" -out "${prefix}.pfx"