Skip to content

Instantly share code, notes, and snippets.

View kiasaki's full-sized avatar
🚧
Building many things

kiasaki kiasaki

🚧
Building many things
View GitHub Profile
@kiasaki
kiasaki / app.js
Created February 1, 2015 18:01
Node.js RethinkDB connect helper
// imports
var host = '0.0.0.0';
var port = process.env.PORT || 8080;
// ... all kind of setup ...
// Routes
app.use(rethinkdb.connectMiddleware);
app.use(require('./routes'));
@kiasaki
kiasaki / iam.policy
Last active August 29, 2015 14:12
IAM Policy for one bucket access
{
"Statement": [
{
"Action": [
"s3:ListAllMyBuckets"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::*"
]
@kiasaki
kiasaki / vimrc
Created December 24, 2014 04:12
Simplified, functional, vimrc file for servers
" Simplified vimrc
" https://gist.github.com/kiasaki/6f27975306a45c169c79
" #############################
" PLUGINS
" #############################
call plug#begin()
Plug 'airblade/vim-gitgutter'
Plug 'bling/vim-airline'
Plug 'edkolev/tmuxline.vim'
@kiasaki
kiasaki / 1liners.sh
Last active August 29, 2015 14:12
Useful one liners
# Generate public key file from secret key file
ssh-keygen -y -f ~/.ssh/key > ~/.ssh/key.pub
# Fetch the fingerprint for a host
# (Useful with salt ssh_kwown_host state)
ssh-keygen -l -f ~/.ssh/known_hosts -F github.com
# Show SSL Cert details
openssl x509 -in certificate.crt -text -noout
@kiasaki
kiasaki / Makefile
Created December 22, 2014 19:07
Terraform Makefile
.PHONY: all setup pull push plan apply destroy
all: plan apply
setup:
terraform remote -backend=HTTP -address=$(TERRAFORM_BACKEND_ADDRESS)/merd.tfstate
pull:
terraform pull
@kiasaki
kiasaki / kibana_view.json
Created December 17, 2014 18:06
Kibana View last hour of logstash
{
"title": "Log Search: last hour",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
#!/bin/bash
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@kiasaki
kiasaki / emacs_cheatsheet.md
Last active December 19, 2017 09:15
emacs_cheatsheet

Learning of emacs in progres...

  • M-x eval-buffer : Self-explanatory

  • M-x replace-string : Self-explanatory

  • C-x C-c : Quit emacs

  • C-g : Cancel current command (keyboard-quit)

Buffers

# How to generate a secret key with Python
# via http://flask.pocoo.org/docs/quickstart/
import os
os.urandom(24)
@kiasaki
kiasaki / uid.rb
Created September 21, 2014 00:48
Rails UID Concern
module Uid
extend ActiveSupport::Concern
included do
before_create :generate_uid
end
def to_param
self.uid
end