Skip to content

Instantly share code, notes, and snippets.

View saiury92's full-sized avatar
🎯
Focusing

Khánh Thiện saiury92

🎯
Focusing
View GitHub Profile
@tadast
tadast / ssl_puma.sh
Last active January 29, 2024 04:41 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@mrtns
mrtns / gist:78d15e3263b2f6a231fe
Last active May 19, 2024 06:53
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@j-mcnally
j-mcnally / Caddyfile
Created January 14, 2016 20:02
Caddyfile - Example
config_server "https://etcd.local:2379"
service users {
endpoint: "/users",
proxy: "{{services.users.ip}}:{{services.users.port}}"
}
# In this example 'services.users' would be a directory with a json key for every user service container / application.
# Using this we could template the proxy and any other information in the services block, and it would just work with caddy.
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active July 30, 2024 09:52
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@oanhnn
oanhnn / how_to.md
Created May 14, 2017 16:47
How to fix composer error "Content-Length Mismatch"

First, run:

$ composer config --list --global        //this will get the composer home path.
[home] /root/.composer                   //it's my composer home path.

And then, edit the config.json in [home] directory, make it like this:

{
  "config": {
 "github-protocols": [
@hnq90
hnq90 / .tmux.conf
Last active January 6, 2021 08:43
.tmux.conf
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# solve the arrows mess when using vim in tmux
set -g default-terminal "xterm-256color"
# use mouse to scroll the output page instead of the command history
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
@mzaidannas
mzaidannas / Simple Docker Setup with Rails+Nginx+Redis+Postgres.md
Last active March 26, 2024 19:55
Simple Docker Setup with Rails+Nginx+Redis+Postgres.md

Typical rails setup with docker+puma+nginx+postgres

Zaid Annas

Devsinc inc. 30/08/2018

Overview

@hnq90
hnq90 / pre_push
Created April 25, 2019 10:18
Rikkeisoft GitHub Pre-Push Hook
#!/bin/bash
# HOW TO USE: Copy this file to `.git/hooks` in your project directory.
remote_url="$2"
warning="[Warning] Don't push the project' source code to GitHub unless you are allowed."
policy_url="Rikkeisoft's IPR Regulation: https://rikkei.vn/help/view/97"
prompt_user() {
echo $warning
/*
################################################################
# Nhân quả không nợ chúng ta thứ gì, cho nên xin đừng oán giận #
# _ #
# _ooOoo_ #
# o8888888o #
# 88" . "88 #
# (| -_- |) #
# O\ = /O #