Skip to content

Instantly share code, notes, and snippets.

View arturoleon's full-sized avatar

Arturo Leon arturoleon

View GitHub Profile
@arturoleon
arturoleon / gist:5215543
Created March 21, 2013 18:40
Show accesses by IP.
cat /var/log/httpd/access.log | awk '{print $1}'| sort -n | uniq -c | sort -rn | head -n10
@arturoleon
arturoleon / gist:5193631
Created March 19, 2013 03:59
List the connections per IP given a specific port (80 in this case).
netstat -plan |grep :80 | awk '{print $5}' |cut -d: -f1 |sort |uniq -c |sort -nr
@arturoleon
arturoleon / gist:5193620
Created March 19, 2013 03:56
Remove al messages from exim queue
exim -bpru|awk {'print $3'}|xargs exim -Mrm
@arturoleon
arturoleon / gist:4145331
Created November 25, 2012 21:06
Titanium Mobile: Remove all childrens recursively from an object
function removeChildrens(objeto) {
for (i in objeto.children) {
var child=objeto.children[0];
removeChildrens(child);
objeto.remove(child);
child=null;
}
}
@arturoleon
arturoleon / file.js
Created September 20, 2012 13:47
Fix booxtrap dropdown on iPad
$('body').on('touchstart.dropdown', '.dropdown', function (e) { e.stopPropagation(); });
@arturoleon
arturoleon / app.js
Last active January 6, 2018 03:55
Loading window for Titanium Mobile
//Usage example
var win = Ti.UI.createWindow();
var loadingWindow = require('LoadingWindow')();
win.add(loadingWindow);
//win.remove(loadingWindow)
win.open();
@arturoleon
arturoleon / app.js
Created September 14, 2012 04:58
Stream video to ios/android
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
VideoStreamingTest = {};
Ti.include('streamingvideo.js');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();