Skip to content

Instantly share code, notes, and snippets.

View CharlieYe0205's full-sized avatar

CharlieYe0205

View GitHub Profile
@CharlieYe0205
CharlieYe0205 / deploy_rails_5.md
Last active May 5, 2022 03:14
Deploy Rails 5 to Ubuntu 18.04

Create user deploy

sudo adduser deploy
sudo adduser deploy sudo
visudo
deploy  ALL=(ALL:ALL) ALL
su deploy
@CharlieYe0205
CharlieYe0205 / deploy_kafka_producer_and_consumer.md
Last active June 19, 2019 00:54
Deploy Kafka Producer and Consumer to Ubuntu 18.04

Setup Gemfile

after follow this to deploy the project first

move listen gem out of development block in Gemfile

gem 'listen', '>= 3.0.5', '< 3.2'

install delivery_boy, racecar and foreman

@CharlieYe0205
CharlieYe0205 / smtp_settings.md
Last active June 19, 2019 00:54
SMTP Settings

Gmail

address: 			smtp.gmail.com
domain:				gmail.com
port:				587
username:			gmail account
password:			gmail password
authentication:		plain
ssl false
@CharlieYe0205
CharlieYe0205 / rvm_install_openssl_fail.md
Last active December 30, 2023 20:18
RVM Install Openssl Fail
rvm pkg install openssl
Requirements installation successful.
Fetching openssl-1.0.1i.tar.gz to /Users/user/.rvm/archives
Extracting openssl to /Users/user/.rvm/src/openssl-1.0.1i.....
Configuring openssl in /Users/user/.rvm/src/openssl-1.0.1i....................
Compiling openssl in /Users/user/.rvm/src/openssl-1.0.1i......................
@CharlieYe0205
CharlieYe0205 / capistrano_rbenv_bundler_not_found.md
Last active July 7, 2019 05:03
Capistrano rbenv bundler not found

Deploy rails via capistrano-rbenv may have the bundler issue.

bundle: command not found

The following line need to be remove even it is list on the offical doc

# set :rbenv_map_bins, %w{rake gem bundle ruby rails} # Remove this
@CharlieYe0205
CharlieYe0205 / brew_install_postgres_issue.md
Last active July 14, 2019 22:41
Brew install Postgres Issue

Install postgres via brew may have the following problem

psql: could not connect to server: No such file or directory. Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@CharlieYe0205
CharlieYe0205 / rvm_rbenv_switch_ruby_version.md
Created July 8, 2019 04:40
Rvm and Rbenv switch ruby version automatically

create a .ruby-version file

2.6.3

Both rvm and rbenv can use this file to switch ruby versions automatically.

@CharlieYe0205
CharlieYe0205 / react_call_function_of_undefined.md
Created July 18, 2019 00:10
React call function of undefined

change

function_name() {};

to

function_name = () => {};
@CharlieYe0205
CharlieYe0205 / kafka_fun.md
Last active August 20, 2019 06:55
Kafka Fun

zookeeper.properties

dataDir={ new_data_dir_instead_of_tmp }/data/zookeeper

server.properties

log.dirs={ new_log_dir_instead_of_tmp }/data/kafka/logs
num.partitions=3 // change this to set default partitions numbers when create topic
@CharlieYe0205
CharlieYe0205 / lodash_fun.md
Last active August 21, 2019 07:18
Lodash Fun

map

_.map(users, 'name')

filter

_.filter(users, {name: 'John'}) # get all users whose name is John, return array