Skip to content

Instantly share code, notes, and snippets.

@und3fined
und3fined / add-swap.sh
Last active August 19, 2020 02:52
How to Add Swap Space on CentOS 8
#!/bin/bash
# Make swap space
# ----------------
# How to use?
# Create add-swap.sh file with this content
# chmod +x add-swap.sh
# Run: ./add-swap.sh
if [[ $EUID -ne 0 ]]; then
echo "Please execute script with a superuser..." 1>&2
@und3fined
und3fined / wg-manager.sh
Last active July 20, 2020 06:11
Wireguard manager script
#!/bin/bash
# wireguard user manager
WG_CONFIG="/etc/wireguard/wg0.conf"
WG_CONFIG_USER="/etc/wireguard/user.d"
function get_free_ip {
local ip=$(shuf -i 2-254 -n 1)
wg show | grep "10.0.0.$ip" > /dev/null
if [[ $? == 1 ]] ; then
@und3fined
und3fined / ssh.pub
Created January 17, 2020 04:30
my pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDexsqEMv5M/+ahxtE4DamQmPqH0rVEGO4OAQQR6DbAbI89gGFqz2GdT05wEq2JCbenBnlENtZV79Eo9AH0tKjb9RihVteQr0IyDPIbB1LrBbzsSojRBWlzGNqUgpxl4LQHysWQ+FYVmhHgkEAFCZly99rUD5SK0mVoPxDU0luX5WnqKkmB/myiW/AGeZWR894VbS3QzuTeih1/feJYqeoR6qW+bF0XewCyjIZYNF+lPo6Df13t+whCkqKTogZMRK1ztoszwWlnVmQD6vzE0Uv80VNRpI74EWtta5NwHkcNUMwue9mdsTV79N6aV9Kv7hAeLAU6F8IhEV5v+CZg2DH7 und3fined@und3finedOS.local
@und3fined
und3fined / network.md
Last active August 18, 2022 22:53
Sample Network Configuration

Sample Network Configuration

  • IP: 12.34.56.78
  • Netmask: 255.255.255.0
  • Gateway: 12.34.56.1

Important Information

  • In most cases, you should not need to adjust these files. Instances are normally configured using DHCP. You only really need to change these files if you are trying to enable additional IPs.
  • Changing to the examples below will cause problems if you take a snapshot of an instance and restore it. We recommend reverting back to DHCP before taking a snapshot.
@und3fined
und3fined / let's encrypt.md
Created November 30, 2019 17:04
Config let's encrypt for nginx server with 9 step

1. Install certbot

Flow command:

1 wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

2 yum install epel-release-latest-7.noarch.rpm

If you are using ec2 you can enable optional channel by running:

@und3fined
und3fined / Sample Apollo GraphQL with Github API.md
Last active May 5, 2019 04:56
Sample Apollo GraphQL with Github API

Bí mật cho giấc ngủ hoàn hảo và thức dậy dễ dàng mỗi sáng

Mỗi đêm bạn ngủ thế nào? Bạn chìm sâu vào giấc ngủ hay lăn lộn suốt đêm dài? Làm thế nào để bạn thức dậy dễ dàng hay đó là một thử thách cho bạn?

Nhấn nút <STAR - sao> nếu bạn từng gặp khó khăn như vậy khi thức dậy vào mỗi sáng?

sleep cover

Giấc ngủ ngon là một khía cạnh quan trọng của cuộc sống, thậm chí thay đổi chất lượng giấc ngủ lành mạnh cũng quan trọng như ăn uống lành mạnh và chơi thể thao.

@und3fined
und3fined / git-flow.md
Last active January 22, 2024 15:51
Using git-flow to automate your git branching workflow

Using git-flow to automate your git branching workflow

By Jeff Kreeftmeijer

Source: https://jeffkreeftmeijer.com/git-flow/

=========================

Vincent Driessen’s branching model is a git branching and release management strategy that helps developers keep track of features, hotfixes and releases in bigger software projects. This workflow has lot of commands to type and remember, so there’s also the git-flow library of git subcommands to help automate some parts of the flow to make working with it easier.

@und3fined
und3fined / gist:212a5cfca6e82f734c13a19decb5b665
Created June 29, 2017 17:23
How to install 64-bit Google Chrome on 64-bit RHEL/CentOS 7
#! /bin/bash
# Google Chrome Installer/Uninstaller for 64-bit RHEL/CentOS 6 or 7
# (C) Richard K. Lloyd 2017 <rklloyd@gmail.com>
# See https://chrome.richardlloyd.org.uk/ for further details.
# Barring bug fixes, this is the final version of the script!
# Google Chrome 59+ will *not* work on RHEL/CentOS 6, so users
# on that platform should not upgrade beyond version 58.
@und3fined
und3fined / nightmare-on-amazon-linux.MD
Created June 9, 2017 16:54 — forked from dimkir/nightmare-on-amazon-linux.MD
How to run nightmare on Amazon Linux

Running nightmare on Amazon Linux

You may have thought of running nightmare on AWS Lambda. But before we can run it on Lambda, we need first to make it run on Amazon Linux.

Provision instance which replicates Lambda environment

According to AWS Documentation on Lambda Execution Environment and available Libraries we would need this AMI image with this alias amzn-ami-hvm-2016.03.3.x86_64-gp2. Keep in mind that AMI-image-id for this instance would be different in different regions (eg):

  • In eu-west-1 - ami-f9dd458a
  • In us-east-1 - ami-6869aa05