Skip to content

Instantly share code, notes, and snippets.

View algotrader-dotcom's full-sized avatar

Mai_Xoa algotrader-dotcom

View GitHub Profile
@algotrader-dotcom
algotrader-dotcom / Extract all links from a web page
Created October 7, 2015 06:14
[Python] Extract all links from a web page
@algotrader-dotcom
algotrader-dotcom / Apache reverse proxy basic authentication with whitelist IPs
Created October 7, 2015 06:46
Apache reverse proxy basic authentication with whitelist IPs
## This conf will basic auth for all exept IP from graph.facebook, twitter..
<VirtualHost IP:443>
ServerName webapp.com
UseCanonicalName Off
ErrorLog /etc/httpd/logs/ssl_reverse_error_log
CustomLog /etc/httpd/logs/ssl_reverse_access_log combined env=!dontlog
RewriteLog "/etc/httpd/logs/ssl_rewrite.log"
RewriteLogLevel 3
@algotrader-dotcom
algotrader-dotcom / Apache reverse proxy redirect loop with special character plus (+) on URL
Created October 7, 2015 08:10
Apache reverse proxy redirect loop with special character plus (+) on URL
# Just add nocanon as below
<Location /example/>
ProxyPass http://anotherserver:8080/example/ nocanon
</Location
@algotrader-dotcom
algotrader-dotcom / Supervisord on CentOS: Keep process always running
Created October 8, 2015 01:33
Supervisord on CentOS: Keep process always running
https://rayed.com/wordpress/?p=1496
https://serversforhackers.com/monitoring-processes-with-supervisord
@algotrader-dotcom
algotrader-dotcom / Apache reverse proxy basic authentication exclude IP, URI
Created October 9, 2015 08:47
Apache reverse proxy basic authentication exclude IP, URI
....
SetEnvIfNoCase Request_URI "^/_ui" noauth
<Proxy *>
AuthType Basic
AuthName "Please Log In"
AuthUserFile /etc/httpd/.htpasswd
Require valid-user
Order deny,allow
Deny from all
@algotrader-dotcom
algotrader-dotcom / rsync with ssh key
Last active September 13, 2016 06:54
rsync with ssh key
## This will sync directory from remote machine to local
sudo rsync -arvz -e "ssh -i your-key.pem" ec2-user@ip-address:/path/to/dir/ temp/
## scp with key
scp -i mykey.pem somefile.txt [email protected]:/
## This will sync from local to remote
sudo rsync -arvz -e "ssh -i your-key.pem" temp/ ec2-user@ip-address:/path/to/dir/
@algotrader-dotcom
algotrader-dotcom / Apache : Permission denied because search permissions are missing on a component of the path
Created October 12, 2015 03:55
Apache : Permission denied because search permissions are missing on a component of the path
## This will be fixed by
find /var/www -type d -exec chmod 755 {} \;
find /var/www -type f -exec chmod 644 {} \;
@algotrader-dotcom
algotrader-dotcom / Fix eth0 interface when cloning Linux VM
Created October 12, 2015 11:03
Fix eth0 interface when cloning Linux VM
So here’s how we fix it:
Remove the kernel’s networking interface rules file so that it can be regenerated
# rm /etc/udev/rules.d/70-persistent-net.rules
# reboot
Edit the network card "name" from eth1 to eth0 in 70-persistent-net.rules
#vi /etc/udev/rules.d/70-persistent-net.rules
@algotrader-dotcom
algotrader-dotcom / SublimeText3 Valid License Build 3083 works!
Created October 12, 2015 14:51
SublimeText3 Valid License Build 3083 works!
----- BEGIN LICENSE -----
Andrew Weber
Single User License
EA7E-855605
813A03DD 5E4AD9E6 6C0EEB94 BC99798F
942194A6 02396E98 E62C9979 4BB979FE
91424C9D A45400BF F6747D88 2FB88078
90F5CC94 1CDC92DC 8457107A F151657B
1D22E383 A997F016 42397640 33F41CFC
@algotrader-dotcom
algotrader-dotcom / Compile apache 2.4 + php from source
Last active December 1, 2022 21:23
Compile apache 2.4 + php from source
1. Requirements
yum install pcre*
yum install libxml*
yum install gdbm-devel
2. Download packages
apr-1.5.2.tar.gz
apr-util-1.5.2.tar.gz