Posts

Delete a Managed VM instance

I had a Dart managed VM running. Since it was an experiment, I wanted to stop and delete the running instances to prevent extra costs. In the console, each time I try to stop or delete the instances, it keeps restarting. The only solution I found (for now, it seems google is working on a allowing deleting managed vm instances) was to upload a non-managed AppEngine application. The simplest setup I use is with the go language. Create the following app.yam l file (here I want to replace the default module. Otherwise enter the proper module name) module: default runtime: go api_version: go1 handlers: - url: / static_files: index.html upload: index.html secure: always Create a dummy main.go file package noserver func init() { } And dummy index.html file <html lang="en"> <head> <title>No server</title> </head> <body> <pre>no server</pre> </body> Then deploy to your <appname>.appspot.com ...

Dart on AppEngine logging on local dev server

While logging works fine on AppEngine I could not manage to have print or any logging when using local development target. It turns out that stderr output is working fine so the solution I ended up with was to create a logger handler (when running locally) that output logging output on to the console. Below is the simplest hello world app that do log fine both locally and on the server import 'dart:io'; import 'package:appengine/appengine.dart'; import 'package:logging/logging.dart'; import 'package:args/args.dart'; main(List args) async { Logger _log = new Logger("app"); ArgParser parser = new ArgParser(); parser.addOption("port", abbr: "p", defaultsTo: "8080"); parser.addFlag("help", abbr: "h"); ArgResults results = parser.parse(args); if (results["help"]) { print(parser.usage); exit(0); } // On dev server we have GAE_PARTITION="dev" // Red...

Dart on AppEngine experiment 1 - avoid killer prices and use f1-micro instances

My first Dart AppEngine experiment doing a dummy HelloWorld turned out to be super expensive. Monitoring the project, 2 instances were always running, costing several bucks for doing...absolutely nothing...It seems that by default custom vm use a rather big instance. Event worst, I was not able to stop these instances that kept restarting. The solution I ended up with was to upload a managed VMs (go in my case) dummy project instead where I could then make as the default and stop the previous instances in a proper way I wanted to try running dart on a micro instance Locally I managed to run my app using: dev_appserver.py --custom_entrypoint "dart bin/server.dart --port {port}" app.yaml and killing my app properly when needed using pgrep -f dev_appserver.py | xargs kill -9 dev_appserver is actually detecting changes as I change my dart file and restart my server, however since it binds to the same port, it sometimes fails. To deploy I can use the following app...

A Contact Form using mdl hosted on Blogger

Image
Getting a contact form on a static website always ends up with an ugly solution (Google sheet form or external website) and using free hosting (wordpress) requires to stick with a given style. Blogger has a contact form that people manage to use with a personal style. I wanted to try blogger template for a long time and was wondering whether it could play well with Material Design Lite. I created a new "blog" that will only contain the contact form for the sake of simplicity. The simplest template I ended up with was this: <html xmlns:b="http://www.google.com/2005/gml/b"  xmlns:data="http://www.google.com/2005/gml/data" xmlns:expr="http://www.google.com/2005/gml/expr"  xmlns="http://www.w3.org/1999/xhtml"> <head> <title><data:blog.pageTitle/></title> <b:skin></b:skin> </head> <body> <b:section id="main_section"></b:section> </body> Add...

Resolving Dart external name from dependencies in WebStorm

After several months with WebStorm, I was still wondering why sometimes a class or function from an external Dart package was not resolved when trying to go to its definition. It turns out that i need to include the package(s) manually https://www.jetbrains.com/webstorm/help/managing-dart-packages-and-assets.html The simplest I found was to right click on the packages directory at the root and to right click Mark Directory As | Cancel Exclusion , although sometimes selecting only the packages I import was sufficient.

Dart on Google Cloud Shell

Google Cloud Shell is available for free until the end of 2015. Good opportunity to try it! It starts right away from google cloud console https://console.developers.google.com/project/ from the Activate Google Cloud Shell icon at the top right Let's install Dart $ sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' # Set up the location of the stable repository. $ sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list' $ sudo apt-get update $ sudo apt-get install dart $ dart --version Dart VM version: 1.12.1 (Tue Sep  8 11:14:08 2015) on "linux_x64" Somehow pub is not symlinked properly so it is needed to symlink it somewhere (I tend to use /usr/local/bin). $ sudo ln -s /usr/lib/dart/bin/pub /usr/local/bin/pub $ pub --version Pub 1.12.1 yeah! git is (of course) installed so I can checkout any project and work on th...

Dart, travis and content_shell

Up to now I was using drone.io for testing my dart packages after a commit. As of today, as dart was stuck to an earlier version (1.10 while 1.13 will soon be out), I decided to try travis. After signin up with my github credentials it proposed me right away all my public projects. Good surprise, integration is as simple as selecting your project in travis and adding the following .travis.yml at the root of your project language: dart dart:   - stable   - dev sudo: false script: pub run test Even better, I was never able to execute my browser test and adding content-shell support is as easy as updating the .travis.yml file with the following content language: dart with_content_shell: true dart:   - stable   - dev sudo: false before_install:   - export DISPLAY=:99.0   - sh -e /etc/init.d/xvfb start script: pub run test -p vm -p content-shell The before install steps are puzzling and explained (somehow) here