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

Server Build Guide: Ubuntu (20.04LTS) LNMP/LAMP

This is a living document which reflects the current process, accumulated and tuned over many years, that I use to set up a Ubuntu 20.04LTS LNMP/LAMP stack from scratch. It might not suit everyone, and probably isn't without its flaws, but it's a good foundation for any new server setup, one that I use for dev and production servers alike.

If you would like a quick, no-fuss, local LNMP stack, check out my ubuntu_lnmp_docker_vagrant repository.

@alsyundawy
alsyundawy / whois.php
Created July 13, 2023 11:40 — forked from kshitiz621/whois.php
PHP code to get WHOIS information of a domain
<?php
/*************************************************************************
php easy :: whois lookup script
==========================================================================
Author: php easy code, www.phpeasycode.com
Web Site: http://www.phpeasycode.com
Contact: [email protected]
*************************************************************************/
$domain = $_GET['domain'];
@alsyundawy
alsyundawy / README.md
Created March 26, 2023 19:44 — forked from alixaxel/README.md
Generating IPv6 PTR records from a Bind9 zonefile using Bash

Generating IPv6 PTR records from a Bind9 Zonefile using Bash.

The following script takes a Bind9 zonefile, gets all AAAA records from it and generated PTR records based on them.

What you need to do:

  1. Edit the Zone header in the script.
  2. Run the script with ./generate_v6_ptr.sh /path/to/zonefile.zone

This will output the zones on STDOUT. If you want to save this to a zonefile, you can use this example:

@alsyundawy
alsyundawy / BrewBindInstallAndSetupMacOS.sh
Last active February 18, 2023 17:50 — forked from Ikkyusan1/BrewBindInstallAndSetupMacOS.sh
Install and setup bind (named) on MacOS 11 Big Sur with brew
#!/bin/bash
# MacOS 11.7 Big Sur
# Homebrew 4.0.1
# bind: stable 9.18.12
# Local caching NS server
# 1) INSTALL BIND
@alsyundawy
alsyundawy / mac_setup.md
Created December 19, 2022 06:34
When you buy a new Mac…

A New Mac

Computer name

  • scutil --set ComputerName "name"
  • scutil --set HostName "name"
  • scutil --set LocalHostName "name"

OS updates

@alsyundawy
alsyundawy / blocklist.sh
Created November 11, 2022 22:49 — forked from mudge/blocklist.sh
A Bash script to generate an Unbound configuration to block all domains on The Firebog's "The Big Blocklist Collection" and allow all domains on Anudeep's list
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Download all ticked blocklists from The Firebog's "The Big Blocklist
# Collection" [0] and block access to them with Unbound by redirecting traffic
# to 0.0.0.0.
#
# [0]: https://firebog.net
(
@alsyundawy
alsyundawy / glibc-2.17_centos6.sh
Created July 18, 2022 00:45 — forked from jhult/glibc-2.17_centos6.sh
update glibc to 2.17 for CentOS 6
#!/bin/bash
# update glibc to 2.17 for CentOS 6
GLIBC=glibc
OS=el6
SERVER=https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6
VERSION=2.17-55
FULL_VERSION=$GLIBC-$VERSION.fc20
X64=x86_64
@alsyundawy
alsyundawy / fix_centos_network.sh
Created July 16, 2022 22:14 — forked from DBezemer/fix_centos_network.sh
Fix CentOS 6 network after VM clone
#!/bin/bash
# Annoying bug in vmware guest centos6
# eth0 doesn't exist
ifconfig eth0 2>/dev/null >/dev/null
if [ $? -ne 0 ] ; then
# Rename eth1 with eth0
echo "UDEV Config..."
rm /etc/udev/rules.d/70-persistent-net.rules
# Change ifcfg-eth0 with hostname address (in /etc/hosts)
echo "Changing eth0 address..."
@alsyundawy
alsyundawy / regex.custom.pm
Created July 6, 2022 19:12 — forked from ethanpil/regex.custom.pm
Custom regex rules for CSF/LFD and NginX plus Wordpress fail2ban plugin
#!/usr/bin/perl
###############################################################################
# Copyright 2006-2015, Way to the Web Limited
# URL: http://www.configserver.com
# Email: [email protected]
###############################################################################
sub custom_line {
my $line = shift;
my $lgfile = shift;
@alsyundawy
alsyundawy / ufw-denier.sh
Created July 6, 2022 19:09 — forked from Ekultek/ufw-denier.sh
A script to download bad IP addresses and deny them with UFW
#!/bin/bash
TMP_DIR="/tmp"
URL_LINKS=$"http://www.blocklist.de/lists/ssh.txt
http://www.blocklist.de/lists/apache.txt
http://www.blocklist.de/lists/asterisk.txt
http://www.blocklist.de/lists/bots.txt
http://www.blocklist.de/lists/courierimap.txt
http://www.blocklist.de/lists/courierpop3.txt
http://www.blocklist.de/lists/email.txt