Skip to main content

Posts

Showing posts from 2017

MySQL restore Database from stopped AWS EC2 ibdata1

There are some way to restore database from a stopped AWS instance. My case is a in-accessable ubuntu instance, it has been miss config firewall (may be) and only snapshot of linux partition left. MySQL 5.7 InoDB I will update guide and link latter. Notes some key mistakes: - Pay attentions to mysql error log after restore. After override ibdata and some database folder in /var/lib/mysql etc. I miss (by the guide) that, I have to copy the ibdata log too. - My error log go speedy to over 12GB on 16GB partition, it go to full hard drive capactity. - So when I remove the log file and stop MySQL, it can not be start again. I guess that when I replace ibdata and some other database, mysql see the not match between index, ID of log or record in system DB, so it output err log. Default may be MySQL do not limit log size so it exceeded the SDD 16GB instance. ...

S3 Encrypt NodeJS upload/server files

https://cloud.google.com/solutions/mysql-remote-access https://stackoverflow.com/questions/19665863/how-do-i-use-a-self-signed-certificate-for-a-https-node-js-server https://github.com/gilt/node-s3-encryption-client https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingEncryption.html S3 encryption with customer provided key SSE-C required SSL. What does it mean ? Protect data at rest (?), at transfer. https://cloud.google.com/compute/docs/load-balancing/tcp-ssl/ https://www.aptible.com/documentation/enclave/tutorials/faq/file-uploads.html SSL sample https://github.com/coolaj86/nodejs-ssl-example But only SSE-C require SSL ? Wall of text, API reference class, property ... http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getSignedUrl-property https://github.com/badunk/multer-s3 https://medi...

Bind multiple port to Docker service

https://www.digitalocean.com/community/questions/how-to-bind-multiple-domains-ports-80-and-443-to-docker-contained-applications Cool nginx reserve proxy config explain: The most basic way to expose a web app running in a Docker container to the outside is to bind port 80 in the container to port 80 on the host system: docker run -d -p 80:80 coreos/apache /usr/sbin/apache2ctl -D FOREGROUND Though when you are running multiple app that you can't have them all listen on the same port. One way to get around this would be to set up an Nginx reverse proxy in front of the containers. For example, say you have two different app. Bind them to a random port on the local host: docker run -d -p 127.0.0.1:3000:80 coreos/apache /usr/sbin/apache2ctl -D FOREGROUND docker run -d -p 127.0.0.1:5000:80 coreos/apache /usr/sbin/apache2ctl -D FOREGROUND Then you can configure an Nginx sconfiguration that looks something like this: upstream app-a {     server 127.0.0.1:3000; } upstr...

RESTful Web services: The basic - IBM Developer Work

© Copyright IBM Corporation 2008, 2015 Trademarks RESTful Web services: The basics Page 1 of 10 RESTful Web services: The basics Alex Rodriguez  ( arodrigu@us.ibm.com ) Software Engineer IBM 09 February 2015 (First published 06 November 2008) Representational State Transfer (REST) has gained widespread acceptance across the Web as a simpler alternative to SOAP- and Web Services Description Language (WSDL)-based Web services. Key evidence of this shift in interface design is the adoption of REST by mainstream Web 2.0 service providers—including Yahoo, Google, and Facebook—who have deprecated or passed on SOAP and WSDL-based interfaces in favor of an easier-to-use, resource-oriented model to expose their services. In this article, Alex Rodriguez introduces you to the basic principles of REST. REST defines a set of architectural principles by which you can design Web services that focus on a system's resources, including how resource states are addressed and transferred o...

Build vs Buy 2

When all the features needed by the users at a given customer are available one could consider this a success. The users have their requirements met and the software vendor has a model that works for them. Unfortunately, there is a problem: All those features that are present in the software but that are not needed by a given user add overhead for the customer and their users. First and foremost, the features are visible and at best may just take up space in menus, toolbars, etc but at worst may confuse the users or make use of required features more complicated. This often translates to lost productivity and increased training effort. The additional features are also likely to result in a higher resource usage, such as memory and storage space as well as network utilisation, which translates into higher capital expenditure for hardware and increased operational costs. https://www.thoughtworks.com/insights/blog/buy-versus-build-shift-issues-buying-software An extreme case is Micros...

Install, config GitLab on Ubuntu 16.04

http://blog.cloud66.com/installing-gitlab-ubuntu/ https://stackoverflow.com/questions/31762841/how-to-serve-other-vhosts-next-to-gitlab-omnibus-server-full-step-by-step-solu GitLab like Redmine use ruby source code. So to run with nginx we need phusion passenger. Run gitlab alongside with many another web (PHP, NodeJS). We need install git, ruby, recompile nginx with phusion passenger. Nginx do not load runtime lib like .so or binary. Install nodejs. Access database (PostgreSQL)sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql/ gitlabhq_production Here about 100 tables for gitlab. So long from the last time I use postgres :(. gitlabhq_production=# \dt                          List of relations  Schema |                   Name                   | Type  | Owner   --------+-----...