Skip to content

Instantly share code, notes, and snippets.

🌐
Terraform again

Afonso Rodrigues afonsoaugusto

🌐
Terraform again
Block or report user

Report or block afonsoaugusto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@afonsoaugusto
afonsoaugusto / gist:6eb19da1e203ffe176b1
Created Mar 20, 2015
Log error deploy openshift with my git
View gist:6eb19da1e203ffe176b1
Started by user Jenkins Admin
Building remotely on appbldr (app-build) in workspace /var/lib/openshift/550ca7224382ec451900014a/app-root/runtime/repo
Checkout:repo / /var/lib/openshift/550ca7224382ec451900014a/app-root/runtime/repo - hudson.remoting.Channel@1e8b1a6:appbldr
Using strategy: Default
Last Built Revision: Revision 9d56910d598ea2718e46a619deab4dcb8ea3855f (origin/master)
Checkout:repo / /var/lib/openshift/550ca7224382ec451900014a/app-root/runtime/repo - hudson.remoting.LocalChannel@1dd6242
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository origin
Fetching upstream changes from https://github.com/afonsoaugusto/diario-online-fonte.git
View gist:1a80b55364bbd33503e0
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /var/lib/openshift/550b287c4382ecebeb000090/jbossas
JAVA: /etc/alternatives/java_sdk_1.6.0/bin/java
JAVA_OPTS: -server -XX:+TieredCompilation -Xms40m -Xmx256m -XX:MaxPermSize=102m -XX:+AggressiveOpts -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dorg.apache.tomcat.util.LOW_MEMORY=true -DOPENSHIFT_APP_UUID=550b287c4382ecebeb000090 -Dorg.jboss.resolver.warning=true -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djboss.node.name=app-diarioescolar.rhcloud.com -Djgroups.bind_addr=127.5.118.1 -Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on
=========================================================================
2015/03/23 23:23:34,560 INFO [org.jboss.modules] (main) JBoss Modules version 1.1.1.GA
2015/03/23 23:23:35,829 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.2.GA
2015/03/23 23:23:35,976 INFO [org.jboss.as] (MSC
View setup_node.sh
sudo apt-get install git
git clone https://github.com/afonsoaugusto/poc-node.git
cd poc-node
sudo apt-get install make gcc
# ./VBoxLinuxAdditions.run
#sh ./VBoxLinuxAdditions*.run
#Crie a pasta a ser montada:
#sudo mkdir /mnt/nome_pasta
#Montando:
#sudo mount -t vboxsf nome_pasta_compartilhada /mnt/nome_pasta
View install_ogr2ogr_ubuntu.sh
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install gdal-bin
View import_data_geospatial.sh
#No arquivo zip, ele irá conter este conjunto de arquivos:
#tl_2013_us_zcta510.prj
#tl_2013_us_zcta510.shx
#tl_2013_us_zcta510.shp
#tl_2013_us_zcta510.dbf
#tl_2013_us_zcta510.shp.xml
#Para realizar o import é necessário que todos estejam na pasta informada
ogr2ogr -f <Plataforma> MySQL:<DatabaseName>,host=localhost,user=root,password=root <caminho com os arquivos>/<arquivo shape>.shp -nln <tabela de será importada> -update -overwrite -lco engine=MYISAM
ogr2ogr -f MySQL MySQL:geo_loc,host=localhost,user=root,password=root /home/mvp/Downloads/tl_2013_us_zcta510.shp -nln points_new -update -overwrite -lco engine=MYISAM
View desc_spatial.sql
mysql> show tables;
+-------------------+
| Tables_in_geo_loc |
+-------------------+
| geometry_columns |
| points_new |
| spatial_ref_sys |
+-------------------+
3 rows in set (0,05 sec)
View cerate_column_point_mysql.sql
CREATE TABLE points (pt POINT);
SET @intptlon10 = ST_GeomFromText('POINT(-19.758839 -43.939613)');
SET @intptlat10 = ST_GeomFromText('POINT(-19.758839 -43.939613)');
insert into points values (@intptlon10);
insert into points values (@intptlat10);
mysql> SELECT ST_AsText(pt) FROM points;
+------------------------------+
| ST_AsText(pt) |
+------------------------------+
View example_ST_Distance_Sphere.sql
mysql> SET @Casa = ST_GeomFromText('POINT(-19.758839 -43.939613)');
Query OK, 0 rows affected (0,00 sec)
mysql> SET @Praca = ST_GeomFromText('POINT(-19.7582095 -43.938092)');
Query OK, 0 rows affected (0,00 sec)
mysql> SELECT round(ST_Distance_Sphere(@Casa, @Praca),2);
+--------------------------------------------+
| round(ST_Distance_Sphere(@Casa, @Praca),2) |
+--------------------------------------------+
@afonsoaugusto
afonsoaugusto / setup_php.sh
Last active Jan 23, 2018
Setup enviroment ubuntu (nodejs, mysql 5.7, php7)
View setup_php.sh
#update do sistema
sudo apt-get update -y
sudo apt-get install -y build-essential
sudo apt-get install -y dialog
export DEBIAN_FRONTEND=noninteractive
#install node
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
#install react
View Pred.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.