This file contains 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 | |
# | |
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box | |
# http://wildfish.com | |
# add the ubuntu gis ppa | |
sudo apt-get -y install python-software-properties | |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable | |
sudo apt-get update |
This file contains 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
sudo apt-get update && sudo apt-get upgrade | |
sudo apt-get install build-essential | |
sudo mount /dev/cdrom /media/cdrom | |
cp /media/cdrom/VMware*.tar.gz /tmp | |
sudo umount /media/cdrom | |
cd /tmp | |
tar xzvf VMware*.gz | |
cd vmware-tools-distrib/ | |
sudo ./vmware-install.pl |
This file contains 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 | |
# | |
# Install Oracle Java 1.6 in Ubuntu 11.10 Server | |
sudo apt-get -y install python-software-properties | |
sudo apt-add-repository -y ppa:ferramroberto/java | |
sudo apt-get update | |
sudo apt-get -y install sun-java6-jdk sun-java6-plugin |
This file contains 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
sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev proj libjson0-dev xsltproc docbook-xsl docbook-mathml gettext postgresql-contrib-9.1 pgadmin3 | |
sudo apt-add-repository ppa:olivier-berten/geo | |
sudo apt-get update | |
sudo apt-get install libgdal-dev | |
# Its looks like: | |
# $ gdal-config --version | |
# 1.9.0 | |
# $ geos-config --version |
This file contains 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 | |
# | |
# Install Postgres 9.1, PostGIS 2.0 and pgRouting on a clean Ubuntu 12.04 install (64 bit) | |
# updated to PostGIS 2.0.1 | |
# add the ubuntu gis ppa | |
sudo apt-get -y install python-software-properties | |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable | |
sudo apt-get update |
This file contains 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 | |
echo "---- APACHE ----" | |
ps -ylC apache2 | awk '{x += $8;y += 1} END {print "Total Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}' | |
echo "---- JBOSS ----" | |
ps -ylC java | awk '{x += $8;y += 1} END {print "Total Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}' | |
echo "-- POSTGRESQL --" | |
ps -ylC postgres | awk '{x += $8;y += 1} END {print "Total Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}' | |
This file contains 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
// Light beat in jQuery | |
function pulse(imgId) { | |
$(imgId).animate({ | |
opacity: 0.7 | |
}, 700, function() { | |
$(imgId).animate({ | |
opacity: 1 | |
}, 700); | |
}); | |
}; |
This file contains 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
float FastInvSqrt(float x) { | |
float xhalf = 0.5f * x; | |
int i = *(int*)&x; // evil floating point bit level hacking | |
i = 0x5f3759df - (i >> 1); // what the fuck? | |
x = *(float*)&i; | |
x = x*(1.5f-(xhalf*x*x)); | |
return x; | |
} |
This file contains 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
######## USING PS ########## | |
## Note: In hign loads, it could return more than 100% of load | |
# Show total % | |
ps aux | awk {'sum+=$3;print sum'} | tail -n 1 | |
# Debug mode: | |
ps aux | awk {'value=$3; if ($3 != "0.0") {print "Adding: " value}; sum+=$3; sumt = "Total sum: " sum; print sumt'} | |
####### USING TOP ######### | |
## Note: It needs 2 seconds to execute to be accurrate | |
top -bn 2 -d 2 | grep '^%Cpu' | tail -n 1 | awk '{print $2+$4+$6 "%"}' |
This file contains 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
@echo off | |
mkdir merged | |
set counter=0 | |
setlocal ENABLEDELAYEDEXPANSION | |
for %%f in (*.shp) do ( | |
if not exist merged\mergedFilter.shp ( | |
echo Uniendo %%f | |
ogr2ogr -f "ESRI Shapefile" merged\mergedFilter.shp %%f |
OlderNewer