Skip to content

Instantly share code, notes, and snippets.

View parsibox's full-sized avatar

Mohsen Davari parsibox

View GitHub Profile
@AidasK
AidasK / HowToDeleteAllCloudflareRecors.md
Last active April 26, 2024 12:19
Cloudflare delete all DNS records. Just go to cloudflare dns zones, open your browers developer console and paste this javascript code.

image

Real developers are not used to clicking, it's allways easier to write a script to do it for you.
@odan
odan / mysq_uuid_v4.md
Last active January 12, 2024 01:11
Generating UUID v4 in MySQL

Generating UUID v4 in MySQL

SELECT
  LOWER(
    CONCAT(
      # 1th and 2nd block are made of 6 random bytes
      HEX(RANDOM_BYTES(4)),
      '-',
 HEX(RANDOM_BYTES(2)),
@fernandoaleman
fernandoaleman / install-rabbitmq-centos-7.md
Last active April 22, 2024 19:00
Install RabbitMQ on CentOS 7

Install RabbitMQ on CentOS 7

sudo yum -y install epel-release
sudo yum -y update

Install Erlang

Download repository

@x011
x011 / Google_IP_Addresses.txt
Created October 8, 2018 10:09
List of Google ip addresses - Feel free to contribute if you find new ip's operated by google.
1.0.0.0/24
1.1.1.0/24
1.2.3.0/24
8.6.48.0/21
8.8.8.0/24
8.35.192.0/21
8.35.200.0/21
8.34.216.0/21
8.34.208.0/21
23.236.48.0/20
@miguelmota
miguelmota / util.php
Last active January 7, 2024 16:07
PHP byte array to hex, hex to byte array, string to hex, hex to string utility functions
<?php
function string2ByteArray($string) {
return unpack('C*', $string);
}
function byteArray2String($byteArray) {
$chars = array_map("chr", $byteArray);
return join($chars);
}
@BenMorel
BenMorel / Font-Awesome-4-to-5-Migration.php
Last active November 15, 2018 13:23
Automatically migrates Font Awesome 4 class names to Font Awesome 5 class names
<?php
/**
* Automatically migrates Font Awesome 4 class names to Font Awesome 5 class names.
*
* WARNING: THIS WILL REWRITE YOUR FILES.
* BACK UP YOUR FILES BEFORE RUNNING THIS SCRIPT.
* YOU HAVE BEEN WARNED.
*
* Note: the migration CSV file was parsed from the official migration documentation:
@rushipkar90
rushipkar90 / Server Load
Last active November 24, 2020 23:26
Server Load
cat /usr/local/apache/conf/modsec2.user.conf | grep xmlrpc
#xmlrpc
===================
SecRule REQUEST_LINE "POST .*xmlrpc.*" "pass,initcol:ip=%{REMOTE_ADDR},setvar:ip.maxlimit=+1,deprecatevar:ip.maxlimit=1/600,nolog,id:35061"
SecRule IP:MAXLIMIT "@gt 5" "log,deny,id:350611,msg:'wp-xmlrpc: denying %{REMOTE_ADDR} (%{ip.maxlimit} connection attempts)'"
#wp-bruteforce
===================
SecRule REQUEST_LINE "POST .*wp-login.*" "pass,initcol:ip=%{REMOTE_ADDR},setvar:ip.maxlimit=+1,deprecatevar:ip.maxlimit=1/600,nolog,id:35011"
SecRule IP:MAXLIMIT "@gt 10" "log,deny,id:350111,msg:'wp-bruteforce: denying %{REMOTE_ADDR} (%{ip.maxlimit} connection attempts)'"
@merty
merty / filter-googlebot-ips.sh
Last active March 19, 2021 17:56
Performs reverse and forward DNS lookups to list Googlebot's IPs, given a list of IP addresses as a file. Useful for filtering access logs to find out actual Googlebot visits. An implementation of https://support.google.com/webmasters/answer/80553?hl=en
#/bin/bash
#
# Performs reverse and forward DNS lookups to list Googlebot's IPs, given a list
# of IP addresses as a file. Useful for filtering access logs to find out actual
# Googlebot visits.
#
# An implementation of https://support.google.com/webmasters/answer/80553?hl=en
while IFS='' read -r IP_ADDRESS || [[ -n "$IP_ADDRESS" ]];
do
@kleinlennart
kleinlennart / drawer_icon.dart
Created May 24, 2018 15:01
Flutter Custom Drawer Icon (use keys)
class _HomePageState extends State<HomePage> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
title: new Text("App"),
leading: new IconButton(
@CodFrm
CodFrm / aes_ecb_pkcs5.php
Created December 19, 2017 05:42
PHP对接java的AES/ECB/PKCS5Padding加密方式
<?php
/**
*============================
* author:Farmer
* time:2017/12/19
* blog:blog.icodef.com
* function:加密方式
*============================
*/