Skip to content

Instantly share code, notes, and snippets.

View oktavianidewi's full-sized avatar
🏠
Working from home

Dewi Oktaviani oktavianidewi

🏠
Working from home
View GitHub Profile
@oktavianidewi
oktavianidewi / dockerize-simple-api.md
Last active September 12, 2019 21:09
Dockerize simple API from Node-JS

Dockerize NodeJS

a note on how to dockerize NodeJS tutorial source from this link

Write Dockerfile and Build Docker Locally

The docker container is launched based on a docker image, the docker image is created with instructions written in the Dockerfile. So we have to add Dockerfile to the directory in the application directory.

write these set of commands on your Dockerfile

FROM node:7
@oktavianidewi
oktavianidewi / redis_cheatsheet.bash
Created May 23, 2019 03:47 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@oktavianidewi
oktavianidewi / browserify-problem.md
Created November 29, 2018 16:38
browserify problem path not found, then permission problem
➜  browserify
zsh: command not found: browserify
➜  zaun-swagger git:(master) ✗ npm config get prefix
/usr/local/Cellar/node/8.8.1
➜  zaun-swagger git:(master) ✗ npm prefix -g
/usr/local/Cellar/node/8.8.1
➜  zaun-swagger git:(master) ✗ echo $PATH
/Users/dewioktaviani/.rvm/gems/ruby-2.4.1/bin:/Users/dewioktaviani/.rvm/gems/ruby-2.4.1@global/bin:/Users/dewioktaviani/.rvm/rubies/ruby-2.4.1/bin:/usr/local/opt/curl/bin:/usr/local/opt/openssl/bin:/Users/dewioktaviani/.pyenv/shims:/Users/dewioktaviani/.pyenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/dewioktaviani/.rvm/gems/ruby-2.4.1/bin:/Users/dewioktaviani/.rvm/gems/ruby-2.4.1@global/bin:/Users/dewioktaviani/.rvm/rubies/ruby-2.4.1/bin:/usr/local/opt/curl/bin:/usr/local/opt/openssl/bin:/Users/dewioktaviani/.pyenv/shims:/Users/dewioktaviani/.pyenv/bin:/usr/local/sbin/:/Users/dewioktaviani/.rvm/bin:/usr/local/sbin:/Users/dewioktaviani/.rvm/rubies$:/Users/dewioktaviani/.rvm/rubies:/Users/dewioktaviani/.local/bin:/Users/dewiok
@oktavianidewi
oktavianidewi / new-user-rmq
Created November 14, 2018 04:01
Set up new user for rabbitmq with rabbitmqctl
activate rabbitmqctl command
You can access the user-management with rabbitmqctl and use the command:
`add_user {username} {password}`
or more preferably maybe edit an existing user, or set the permissions for the new user with:
`set_permissions [-p vhostpath] {user} {conf} {write} {read}`
For example use the following commands: (it is important to perform these three steps even when creating a new user, if you want to be able to login to the UI console and for your programs to work without facing any permission issues)
@oktavianidewi
oktavianidewi / bash-file-rename.md
Last active July 1, 2018 02:32
rename batch files with bash script

to rename batch files with bash script in mac terminal, type this command:

for f in *.jpg
do 
    mv "$f" "${f/*. /}"
done

in a bash file named rename-files.sh put the file in a folder where the files are going to be rename. run the bash file by : sh rename-files.sh

@oktavianidewi
oktavianidewi / playing-with-heroku.md
Created June 10, 2018 04:51
playing with heroku

heroku installation -> no documentation

heroku login
// insert email and passowrd info

heroku update
// heroku-cli will be updated

to benchmark which one is faster between using subquery and order by in your sql.