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
.... | |
CUSTOM1_LOG = "/var/log/apache2/domlogs/*/*" | |
.... |
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 | |
while true; do | |
echo > pingresults.txt | |
date | |
cat vps.txt | while read LINE | |
do |
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
--- | |
METHOD 1 | |
This should roughly sort the items on distance in MySQL, and should work in SQLite. | |
If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance. | |
--- | |
SELECT * | |
FROM table | |
ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC |
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
OTHER_IFACE="eth1" | |
OTHER_GW="10.0.3.2" | |
USER="xyz" | |
ip rule add fwmark 35 table 35 | |
ip route add default via $OTHER_GW dev $OTHER_IFACE table 35 | |
ip route flush cache | |
iptables -t mangle -A OUTPUT -m owner --uid-owner $USER -j MARK --set-mark 35 | |
iptables -t nat -A POSTROUTING -o $OTHER_IFACE -m mark --mark 35 -j MASQUERADE |