Skip to content

Instantly share code, notes, and snippets.

View alsyundawy's full-sized avatar
🏠
WFH | Kaum Rebahan Garis Keras Dan Militas

༺ Initial H ༻ alsyundawy

🏠
WFH | Kaum Rebahan Garis Keras Dan Militas
View GitHub Profile
@alsyundawy
alsyundawy / free-system-space.md
Created May 19, 2019 13:48 — forked from ipbastola/free-system-space.md
Free System space from massive log files

Free System Space from Massive Logs

  1. Remove compressed log files from /var/log
$ sudo find /var/log -type f -name "*.gz" -delete
  1. Truncate Log files
$ cd /var/log
@alsyundawy
alsyundawy / Initial-Server-CentOS-7.md
Created May 21, 2019 02:56 — forked from xuannghia/Initial-Server-CentOS-7.md
Initial Server Setup CentOS 7 - with NGINX, PHP 7.2, MariaDB 10.2, PostgreSQL 10 ,phpMyAdmin 4.8, MongoDB

1. Add Repositories

EPEL repository

sudo yum install -y epel-release

SCLo Software collections Repository

yum -y install centos-release-scl-rh centos-release-scl

Remi repository

@alsyundawy
alsyundawy / network-tuning.conf
Created May 21, 2019 05:20 — forked from pensierinmusica/network-tuning.conf
Linux sysctl configuration file for NginX
## Place this file in "/etc/sysctl.d/network-tuning.conf" and
## run "sysctl -p" to have the kernel pick the new settings up
# Avoid a smurf attack
net.ipv4.icmp_echo_ignore_broadcasts = 1
# Turn on protection for bad icmp error messages
net.ipv4.icmp_ignore_bogus_error_responses = 1
# Turn on syncookies for SYN flood attack protection
@alsyundawy
alsyundawy / PgAdmin4-Nginx-uwsgi.md
Created September 1, 2019 11:36 — forked from rdnvndr/PgAdmin4-Nginx-uwsgi.md
Установка PgAdmin4 + Nginx + uwsgi

Установка PgAdmin4 + Nginx + uwsgi

Установка PgAdmin 4

Для установки PgAdmin 4 через pip необходимо выполнить команды:

sudo apt-get install python3-pip build-essential python3-dev libssl-dev libffi-dev
sudo pip3 install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.1/pip/pgadmin4-4.1-py2.py3-none-any.whl

Для инициализации конфигурации в директории /usr/local/lib/python3.5/dist-packages/pgadmin4/ необходимо создать файл config_local.py:

@alsyundawy
alsyundawy / letsencrypt_esxi.sh
Created October 14, 2019 19:57 — forked from shr00mie/letsencrypt_esxi.sh
Let's Encrypt SSL for ESXi
#!/bin/bash
#
## -------------------------------=[ Info ]=--------------------------------- ##
#
# Generate letsencrypt cert on local server and scp to esxi target.
# Designed and tested on Ubuntu 16.04LTS.
# Assumes you have upnp control over local network. Tested with Ubiquiti USG.
#
# Dependencies:
# miniupnpc (sudo apt install miniupnpc)
@alsyundawy
alsyundawy / build-gcc-9.2.0-on-centos7.md
Created January 9, 2020 18:53 — forked from nchaigne/build-gcc-9.2.0-on-centos7.md
Building GCC 9.2.0 on CentOS 7

Building GCC 9.2.0 on CentOS 7

Introduction

CentOS 7 distribution (as well as RHEL 7) ships with a somewhat outdated version of the GCC compiler (4.8.5 on CentOS 7.5), which may not be suitable to your compilation requirements. For example, C11 - which supersedes C99 - is fully supported only starting from GCC 4.9).

Additionally, recent versions of GCC (GCC6, GCC7, GCC8, GCC9) come with improvements which help detect issues at build time and offer suggestions on how to fix them. Sometimes, these are even actually helpful!

This note describes how to build the latest GCC (9.2.0 as of October 2019) from sources on CentOS 7. This should be applicable as is on RHEL 7. For other Linux distributions, adapt as needed.

@alsyundawy
alsyundawy / build-gcc-7.3.0-on-rhel7.md
Created January 9, 2020 18:53 — forked from nchaigne/build-gcc-7.3.0-on-rhel7.md
Building GCC 7.3.0 on Red Hat Enterprise Linux 7

Building GCC 7.3.0 on Red Hat Enterprise Linux 7

Introduction

Red Hat Enterprise Linux (RHEL) distribution ships with a somewhat outdated version of the GCC compiler (4.8.3 on RHEL 7.1), which may not be suitable to your compilation requirements. For example, C11 - which supersedes C99 - is fully supported only starting from GCC 4.9).

Additionally, recent versions of GCC (GCC6, GCC7) come with improvements which help detect issues at build time and offer suggestions on how to fix them. Sometimes, these are even actually helpful!

This note describes how to build the latest GCC (7.3 as of January 2018) from sources on RHEL 7. This should be applicable as is on CentOS 7. For other Linux distributions, adapt as needed.

@alsyundawy
alsyundawy / Pihole Nginx Config
Created June 29, 2021 12:44 — forked from amanjuman/Pihole Nginx Config
Pihole Nginx Config
curl -sSL https://install.pi-hole.net | bash
sudo apt-get -y install software-properties-common python3-certbot-nginx nginx php7.2-fpm php7.2-cgi php7.2-xml php7.2-sqlite3 php7.2-intl apache2-utils
sudo certbot --nginx --agree-tos --register-unsafely-without-email --no-redirect -d subdomain.example.com
htpasswd -c /etc/nginx/.htpasswd user
chown -R www-data:www-data /var/www/html
usermod -aG pihole www-data
chmod -R 755 /var/www/html
server
{
@alsyundawy
alsyundawy / network-tweak.md
Created August 14, 2021 06:28 — forked from mustafaturan/network-tweak.md
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'