Skip to content

Instantly share code, notes, and snippets.

View mansurali901's full-sized avatar

Mansur Ul Hasan mansurali901

View GitHub Profile
@mansurali901
mansurali901 / database_test_memcached.php
Last active August 21, 2018 18:10
A PHP Script to test memcache server with PHP and MySql
<?php
// This Script is writted according to my test environment
// Before testing script you must need to create database
// and some sample data into Database
// Follow below steps before running this PHP Script
// --> CREATE DATABASE mem_test;
// --> USE mem_test;
// --> GRANT ALL ON mem_test.* TO test@localhost IDENTIFIED BY 'testing123';
// --> CREATE TABLE sample_data (id int, name varchar(30));
// --> INSERT INTO sample_data VALUES (1, "some_data");
@mansurali901
mansurali901 / oom_score_adjust.sh
Last active June 6, 2018 11:41
Adjust value of OOM score to avoid process killed by kernel in case of Out of Memory
#!/bin/bash
# This script is used to disable OOM Killer for Ruby
# Process script will find the ruby process pid and change
# the OOM value to avoid being killed by kernel
# Author : Mansur Ul Hasan
# Email : [email protected]
# Function to find the PID
ProcessName='ruby' # Process Name
AppDir='/usr/local/script/oomadjust' # Application path
@mansurali901
mansurali901 / setup_mongoreplicasets.sh
Created May 31, 2018 07:52
Setup Mongo Replica Sets on Ubuntu 16.04
#!/bin/bash
# This script is written to setup mongo replicasets
# There are three replicas for Mongo replication
# Author : Mansur Ul Hasan
# Email : [email protected]
mkdir /var/lib/mongod{1..3}
mongod --replSet burraq --logpath "/var/log/mongodb/mongod1.log" --dbpath /var/lib/mongod1 --port 27017 &
mongod --replSet burraq --logpath "/var/log/mongodb/mongod2.log" --dbpath /var/lib/mongod2 --port 28017 &
#!/bin/bash
# This script is written to make your Linux machine Router
# With this you can setup your linux machine as gateway.
# Author @ Mansur Ul Hasan
# Email @ [email protected]
# Defining interfaces for gateway.
INTERNET=eth1
LOCAL=eth0
#!/bin/bash
# Author Mansur Ul Hasan
# EMail : [email protected]
# Script is setup to git client 2.5
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc perl-ExtUtils-MakeMaker
cd /usr/src
wget https://www.kernel.org/pub/software/scm/git/git-2.5.3.tar.gz
tar xzf git-2.5.3.tar.gz
@mansurali901
mansurali901 / nginx_php_php-fmp.yml
Last active March 31, 2018 15:28
Ansible playbook to setup Nginx webserver with PHP and PHP-FPM
---
- hosts: vms
tasks:
- name: Add Nginx Repository PPA
apt_repository: repo='ppa:nginx/stable' state=present
register: ppastable
- name: Install Nginx
apt: pkg=nginx state=present update_cache=true
when: ppastable|success
系统数据:
user() 当前用户
database() 当前数据库
version() SQL版本号,最后为系统版本(nt-windows)
@@datadir 数据库路径
连接型:
concat() concat(username,0x3a, password))
group_concat() select group_concat(DISTINCT file_priv, user) from mysql.user; //多个用户情况下, 查看load_file()权限
concat_ws() 与上类似
编码:
@mansurali901
mansurali901 / setup_rootssh.sh
Last active May 20, 2019 09:32
Setup Root SSH for logging session bases SSH sessions logging
#!/bin/bash
# This script is designed to install
# the SSH terminal logging
# currently this script is only work on
# CentOS & Ubuntu
# Author : Mansur Ul Hasan
# EMail : [email protected]
# Skype : genious840
# Facebook : https://www.facebook.com/itmarkaz
# YouTube : https://www.youtube.com/user/mansur7820
@mansurali901
mansurali901 / setup_apache_2.4.32.sh
Last active March 19, 2018 13:19
Install Apache2 in CentOS 6.8 with APR 1.6.3
#!/bin/bash
# This script is designed to installation apache
# from source code with all options using apr &
# apr-utils and library for portability
# Author : Mansur Ul Hasan
# EMail : [email protected]
# Skype : genious840
# Facebook : https://www.facebook.com/itmarkaz
# YouTube : https://www.youtube.com/user/mansur7820
#This COnfiguraion is written by Mansur ul Hasan
# The MySQL Server 5.7 configuration file.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html