Content :
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Author: GitHub Copilot (adapted by Satit Rianpit) | |
| # Date: October 2024 | |
| # Description: This script performs the dumping of HOSxP database tables. | |
| # Usage: ./backup.sh -f /path/to/config_file | |
| # Parameters: | |
| # - -f: Specifies the configuration file to use. | |
| # Returns: 0 if successful, 1 if an error occurs. | |
| # Notes: This script requires the 'zip', 'openssl' and 'mysqldump' commands to be installed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Set interface here | |
| :local inboundInterface "bridge1" | |
| :local outboundInterface "ether1" | |
| #Set bandwidth of outgoing interface | |
| :local ingoingInterfaceBandwidth '1000M' | |
| #Set bandwidth of ingoing interface | |
| :local outgoingInterfaceBandwidth '1000M' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Creation Date: November 3, 2018 | |
| :local Version "2.0" | |
| :local LASTUPDATE "05/10/2019" | |
| # Tested with RouterOS 6.43.4 | |
| # | |
| # Mikrotik script to implement QoS on internet connections. | |
| # The script makes use of Address Lists, Firewall rules (Mangle) for connection tagging, and Queue Trees. | |
| # The script will remove applied rules from previous runs before applying. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /interface bridge add name=bridge | |
| /interface bridge port | |
| add bridge=bridge interface=ether3 | |
| add bridge=bridge interface=ether2 | |
| add bridge=bridge interface=ether1 | |
| /interface list | |
| add comment=defconf name=WAN | |
| add comment=defconf name=LAN |
Moved to git repository: https://github.com/denji/nginx-tuning
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/python | |
| # -*- coding: utf-8 -*- | |
| def lineNotify(message): | |
| payload = {'message':message} | |
| return _lineNotify(payload) | |
| def notifyFile(filename): | |
| file = {'imageFile':open(filename,'rb')} | |
| payload = {'message': 'test'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/python | |
| # -*- coding: utf-8 -*- | |
| import requests | |
| url = 'https://notify-api.line.me/api/notify' | |
| token = '9IBnp37LVHj0a6W5HLq2dF7sqIjGyEVn2DQtpQq7wYv' | |
| headers = {'content-type':'application/x-www-form-urlencoded','Authorization':'Bearer '+token} | |
| msg = 'ทดสอบภาษาไทย hello' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Thanks to https://gist.github.com/Lewiscowles1986/ce14296e3f5222082dbaa088ca1954f7 | |
| if [ "$(whoami)" != "root" ]; then | |
| echo "Run script as ROOT please. (sudo !!)" | |
| exit | |
| fi | |
| echo "deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi" > /etc/apt/sources.list.d/stretch.list | |
| echo "APT::Default-Release \"jessie\";" > /etc/apt/apt.conf.d/99-default-release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Options +FollowSymLinks | |
| RewriteEngine On | |
| RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] | |
| RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] | |
| RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) | |
| RewriteRule ^(.*)$ index.php [F,L] | |
| //Source: http://wp.smashingmagazine.com/2010/07/01/10-useful-wordpress-security-tweaks/ |