Skip to content

Instantly share code, notes, and snippets.

View vkaylee's full-sized avatar

Lee Tuan vkaylee

  • Ho Chi Minh City, Vietnam
  • 06:07 (UTC +07:00)
View GitHub Profile
@vkaylee
vkaylee / ddrescue.md
Created October 17, 2024 13:54 — forked from cetinajero/ddrescue.md
Guide for using Ddrescue to recover data

Guide for using Ddrescue to recover data

Start command:

ddrescue -d /dev/sda output.img output.mapfile

NOTE: If direct disc access is not available in your system, try raw devices.

@vkaylee
vkaylee / replace_env_values.sh
Last active April 17, 2023 08:30
Bash shell: Replace values of env file by actual variable values
#!/usr/bin/env bash
tmpFile="$(mktemp)"
inputFilePath="${1}"
#################################################################################
# This script will look up key=value in the ENV file #
# Replace the value by the value of key in the runtime environment #
# If the value of the key is not existed, do nothing and keep the original one #
# All other things will be kept to output #
#################################################################################
# Input: #
@vkaylee
vkaylee / LICENSE
Created August 9, 2022 09:39 — forked from jirutka/LICENSE
Generate a new GPG key pair in a temporary GPG Home and export it to a file. It can run completely unattended, without prompting for a passphrase.
The MIT License
Copyright 2018-2019 Jakub Jirutka <[email protected]>.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@vkaylee
vkaylee / 0-go-os-arch.md
Created October 12, 2021 04:15 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@vkaylee
vkaylee / nginx.conf
Created November 17, 2019 13:48 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
// Source: https://gist.github.com/luetkemj/2023628
<?php
$args = array(
//////Author Parameters - Tham số lấy bài viết theo tác giả
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
'author' => '1,2,3,', //(int) - Các ID tác giả cần lấy bài viết (thêm dấu - vào để loại trừ tác giả, ví dụ: -14, -20)
'author_name' => 'luetkemj', //(string) - Lấy bài viết dựa theo tên nick name của tác giả
'author__in' => array( 2, 6 ), //(array) - Lấy bài dựa theo ID của tác giả
'author__not_in' => array( 2, 6 ), //(array)' - Các ID của tác giả không muốn lấy bài