Skip to content

Instantly share code, notes, and snippets.

View VijayaSankarN's full-sized avatar

Vijaya Sankar N VijayaSankarN

View GitHub Profile
@ayub-ansari
ayub-ansari / BooleanExpressionCalculation.cls
Last active July 4, 2018 13:54
Boolean expression calculation apex - Salesforce
/*_________________________________________________________________________________
// BooleanExpression.evaluateExpression('false and (false or (true and (false or true)))')
//updated by ayub...may need to change
___________________________________________________________________________________
*/
public class BooleanExpressionCalculation{
public static boolean evaluateExpression(String expression){
system.debug(expression.containsIgnoreCase('false')+'__'+expression.containsIgnoreCase('true'));
@fduran
fduran / gist:1870507
Created February 20, 2012 18:27
Apache find IPs with most connections
# www.fduran.com
# Number of top 10 current TCP connections per IP
netstat -tan| grep -v 'LISTEN'| awk '{print $5}'| grep -v 'and' |grep -v 'Address' |cut -d':' -f1 |sort -n | uniq -c | sort -rn | head -n10
# Top 10 IPs in Apache log files
cd /var/log/apache2; for i in ./access.log*; do echo $i; cat $i | awk '{print $1}'| sort -n | uniq -c | sort -rn | head -n10; done