Skip to content

Instantly share code, notes, and snippets.

View navotera's full-sized avatar

Muhammad Hendra navotera

View GitHub Profile
@navotera
navotera / .htaccess
Last active January 28, 2019 12:02
.htaccess to allow only from indonesia
# -------------------------------------------------------
# Free IP2Location Firewall List by Country
# Source: https://www.ip2location.com/free/visitor-blocker
# Last Generated: 28 Jan 2019 11:37:05 GMT
# [Important] Please update this list every month
# -------------------------------------------------------
<Limit GET HEAD POST>
order deny,allow
allow from 2.255.251.216/32
allow from 14.102.152.0/22
@navotera
navotera / shmsetup.sh
Created September 22, 2020 07:48 — forked from jodell/shmsetup.sh
kernel shared memory calculator
#!/bin/bash
# http://archives.postgresql.org/pgsql-admin/2010-05/msg00285.php
# Output lines suitable for sysctl configuration based
# on total amount of RAM on the system. The output
# will allow up to 50% of physical memory to be allocated
# into shared memory.
# On Linux, you can use it as follows (as root):
#
# ./shmsetup >> /etc/sysctl.conf
@navotera
navotera / my.cnf
Created September 26, 2020 07:49 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated January 2020 ~
#
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
Include "/etc/nginx/modsec/main.conf"
# Allow jetpack (android blog post) and post view
SecRuleRemoveById 949110 959100;
# ------------------------------------------------------------------------
# OWASP ModSecurity Core Rule Set ver.3.0.2
# Copyright (c) 2006-2016 Trustwave and contributors. All rights reserved.
#
# The OWASP ModSecurity Core Rule Set is distributed under
@navotera
navotera / gist:bc3c9a372ed4a2caff1e02c140f31ef9
Last active March 31, 2023 23:37
InstallOh-My-Posh-Windows10

InstallOh-My-Posh-Windows10

ALL THE PROCESS should be installed in the TERMINAL as Administrator (not Power Shell)

  1. Install scoop
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
  1. Install oh-my-posh using scoop
@navotera
navotera / index.php
Created June 7, 2023 11:24
for maintenance index.php
<?php
/**
* Usage:
* Download and unzip the file then RENAME it to index.php
* Into the code find "your site name goes here" and put your Board's/Site's name in there.
* SAVE this file.
*
* Rename your (i.e.: www.mydomain.com/phpBB3/index.php) to something else you like (as a backup)
* Upload THIS renamed file to your Board's root (i.e.: www.mydomain.com/phpBB3/)
* Point your browser to i.e.: www.mydomain.com/phpBB3/index.php), once finished delete this

FROM error_log

Fri Jun 28 09:46:00.148760 2024] [:error] [pid 1922543:tid 140006135953152] [client 180.254.137.10:65494] ModSecurity: Warning. Matched "Operator Rx' with parameter ^(?:(?:\|[^!\\"\\(\\),/:-\\?\\[-\\]\\{\\}]+)/(?:\|[^!\\"\\(\\),/:-\\?\\[-\\]\\{\\}]+)|\)(?:[\s\x0b];[\s\x0b](?:charset[\s\x0b]=[\s\x0b]*\"?(?:iso-8859-15?|utf-8|windows-1252)\b\"?|(?:[^\s\x0b-\"\(\),/:-\?\[-\]c (760 characters omitted)' against variable REQUEST_HEADERS:Accept' (Value: text/htmlapplication/xhtml+xmlapplication/xml;q=0.9/q=0.8' ) [file "/etc/apache2/modsecurity.d/owasp-crs/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf"] [line "1243"] [id "920600"] [rev ""] [msg "Illegal Accept header: charset parameter"] [data "text/htmlapplication/xhtml+xmlapplication/xml;q=0.9/q=0.8"] [severity "2"] [ver "OWASP_CRS/4.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-protocol"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [hostname "