hakopako

Full-stack Engineer's blog

Auth with Sentinel + SQLite3 + PHP7

日本語 | English Sentinel is an authorization and authentication package. I tried it out on a prototype product, but constructing MySQL or PostgreSQL is too much... Then I found out to use sqlite3. Install Sentinel Configure DB connection …

Install php7.1.9 with phpenv on MacOS

日本語 | English I tried to install php7.1.9 with phpenv on MacOS(Sierra/10.12.3), but some errors occurred. This article is a note of it. Install phpenv Brew didin't support to install phpenv itself. So I installed it manually like below.…

How to use pyenv with cygwin - windows

日本語 | English install pyenv pyenv install X.X.X Version 2.X Version 3.X On Linux or MacOS, we can install and set up pyenv with prepared commands such as "brew". However, Windows doesn't go that way. The reason is that python-build does…

Useful linux command tips for dealing with log files

日本語 | English Tips for dealing with text files such as log files when you are required to be done ease aggregation. Usually these depends on machine spec. Tools ・ Excel: good up to about 50K lines. ・ Sublime text: good up to about 300…

Proxy command options and setting file notations - yum/rpm/curl/wget/git/gem/pip/npm -

日本語 | English If proxy is barproxy:1234. yum $ vim /etc/yum.conf proxy=http://barproxy:1234 # add rpm $ rpm --httpproxy barproxy --httpport 1234 http://aaa.com curl # --- command -------- $ curl http://aaa.com --proxy barproxy:1234 $ cu…

AWS Lambda 101 - how to develop, run, deploy - [nodejs]

日本語 | English Overview AWS Lambda 101. An event of returning s3 file content. Use node 4.3 for lambda. Programms package.json / install aws-sdk { "name": "application-name", "version": "1.0.0", "description": "application description", …

Import lots of data to DynamoDB from s3 bucket

日本語 | English Overview For here, create reference table of DynamoDB that contains about 42 million rows by using import function. I was tuned this will finish in 24h. Official document: AWS DataPipeline Let's get started !!!! Generate i…

Switch gist file list to tabs by a chrome extension [gistab]

日本語 | English I often use Gist instead of Evernote and iOS notes. Besides that, gist has really smart syntax-highlight function and it helps programmers to read code easier. But, there is a thing that I don't like. when I put a few file…

How to use Dynamodb local

日本語 | English Overview As a databases, DynamoDB of AWS could be your choice. But it's difficult to use it as a development environment because writing and reading are pricey. So here is DynamoDBLocal for you. It's definitely good to use…

Lambda with sqlite makes serverless and databaseless

日本語 | English Foreword AWS Lambda provides us serverless computing platform so that you can run code by uploading them without pouring time for building servers. This time, I tried not only serverless but also NO AWS DB services such as…

How to generate your own itamae plugins

日本語 | English Versions git 1.8.3.2 ruby 2.0.0 gem 2.0.3 bundler 1.12 rake 10.0 rspec 3.0 itamae v1.6.3 Generate gem template Resource plugin prefix is itamae-plugin-resource- and resource name follow to it with snake case like so. $ bun…

Flexible provisioning tool "Itamae" - manage infrastracture as code

日本語 | English Overview Chef and Ansible are well known provisioning tools, but here is another option I want to share, which is "Itamae". As a background we use itamae, our team was using chef and chef-server. I don't think it's rare ca…

Use goofys to mount S3 bucket on EC2 of AWS [centos6]

日本語 | English Once you mount s3 bucket to EC2, you can use it by linux commands which you must be familiar with, such as cd, mv and cp. Actually, it helped me collecting a lot of server logs to 1 bucket. What I use here is goofys which …

About

About this blog This blog (hakopako) is my tips of solving troubles which I came across working as a full-stack engineer. I hope these tips help you. Profile Writer: hakopako Twitter (@shiiiman_) Location: Tokyo, Japan Email: hakohakoha…

"simplexml_load_string" throws an error - how to catch it -

日本語 | English Loading xml data with just one line like below would bring a few troubles in php, even though it returns "false" when failed. $xml = simplexml_load_string($data); because ... Loading xml that contains control characters wi…