Skip to content

Instantly share code, notes, and snippets.

View malikshi's full-sized avatar
🏠
Working from home

Malik Al malikshi

🏠
Working from home
View GitHub Profile
@malikshi
malikshi / Shadowsocks_With_V2Ray.md
Created February 4, 2019 19:06
Install Shadowsocks With V2Ray Manually

Installing Packages

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean && sudo apt-get install build-essential haveged -y
sudo apt-get install linux-headers-$(uname -r)
sudo apt-get install curl -y
sudo apt-get install shadowsocks-libev -y
sudo apt-get install cron -y
sudo apt-get install screen -y

Install V2Ray

@malikshi
malikshi / shadowsocks-ck-release.sh
Created February 25, 2019 08:09 — forked from cbeuw/shadowsocks-ck-release.sh
Install shadowsocks-libev from package manager and install Cloak server from Github releases
#!/usr/bin/env bash
# Forked and modified by cbeuw from https://github.com/teddysun/shadowsocks_install/blob/master/shadowsocks-all.sh
PATH=$PATH:/usr/local/bin
export PATH
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
@malikshi
malikshi / dos2unix.sh
Created June 18, 2019 13:53 — forked from jappy/dos2unix.sh
Shell script to convert files with CRLF to LF (Mac/Linux)
#! /bin/sh
for x
do
echo "Converting $x"
tr -d '\015' < "$x" > "tmp.$x"
mv "tmp.$x" "$x"
done
@malikshi
malikshi / Huawei_E3372_openwrt.md
Created June 21, 2019 08:05 — forked from bjoern-r/Huawei_E3372_openwrt.md
How to use a Huawei E3372 on OpenWRT

HOWTO use a Huawei E3372 on OpenWRT

This modem is also sold as a MegaFon M150-2 USB dongle

Needed Software

Install the needed packages via opkg tool

opkg update
stream {
log_format basic '$remote_addr [$time_local] '
'$protocol $status $bytes_sent $bytes_received '
'$session_time';
access_log /var/log/nginx/access.log basic;
error_log /var/log/nginx/error.log debug;
include /etc/nginx/stream.conf.d/*.conf;
@malikshi
malikshi / mysql_secure.sh
Created February 9, 2020 00:40 — forked from Mins/mysql_secure.sh
Automating mysql_secure_installation
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10
@malikshi
malikshi / build-openssl.sh
Created February 21, 2020 16:56 — forked from bmaupin/build-openssl.sh
Build openssl (with SSLv2/3 support for security testing)
#!/bin/bash
# Cache sudo password
sudo -v
# Get latest OpenSSL 1.0.2 version from https://openssl.org/source/
# v1.1.0 seems to have removed SSLv2/3 support
openssl_version=1.0.2k
# Install build dependencies
@malikshi
malikshi / DNS Prefetch domains
Created March 4, 2020 16:30 — forked from lukecav/DNS Prefetch domains
WP Rocket - Advanced Options Prefetch DNS requests
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
@malikshi
malikshi / nginx-tuning.md
Created March 17, 2020 15:40 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@malikshi
malikshi / snat_dnat_advantech.md
Created August 21, 2021 04:18 — forked from tomasinouk/snat_dnat_advantech.md
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot)

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

masquarade all outgoing packets to be WLAN0 IP

iptables -t nat -A PREROUTING -s 192.168.1.2 -i eth0 -j MASQUERADE

All packets leaving eth0 will have src eth0 ip address