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 | |
export DEBIAN_FRONTEND=noninteractive | |
# General utils | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install unzip | |
sudo apt-get -y install software-properties-common python-software-properties |
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 apache2 php7.0 php7.0-gd sqlite php7.0-sqlite3 php7.0-curl | |
sudo apt-get install php7.0-gd php7.0-json php7.0-curl php7.0-mbstring php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip | |
sudo service apache2 restart | |
cd /var/www/html | |
curl https://download.nextcloud.com/server/releases/nextcloud-12.0.4.tar.bz2 | sudo tar -jxv | |
cd /var/www/html/nextcloud | |
sudo mkdir -p /var/www/html/nextcloud/data | |
sudo chown www-data:www-data /var/www/html/nextcloud/data |
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
get-childitem *.mp4 | rename-item -newname { [string]($_.name).substring(3) } |
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 wget https://download.owncloud.org/community/owncloud-8.1.12.zip | |
sudo service nginx stop | |
sudo mv owncloud owncloud-8.0 | |
sudo unzip ./owncloud-8.1.12.zip | |
sudo cp ./owncloud-8.0/config/config.php ./owncloud/config/ | |
sudo mv ./owncloud-8.0/data ./owncloud/ | |
sudo chown -R www-data:www-data ./owncloud | |
cd owncloud | |
sudo -u www-data php occ upgrade | |
sudo service nginx start |
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
SELECT jsonb_build_object( | |
'type', 'FeatureCollection', | |
'features', jsonb_agg(feature) | |
) | |
FROM ( | |
SELECT jsonb_build_object( | |
'type', 'Feature', | |
'id', gid, | |
'geometry', ST_AsGeoJSON(geom)::jsonb, | |
'properties', to_jsonb(row) - 'gid' - 'geom' |
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 /usr/lib/update-notifier/apt-check --human-readable | awk -v RS=[0-9]+ '{print RT+0;exit}' |
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
#!/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
#!/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 |
NewerOlder