Skip to content

Instantly share code, notes, and snippets.

View tr4nk's full-sized avatar

Khai Tran tr4nk

  • Ho Chi Minh City, Vietnam
View GitHub Profile

Set folder permissions for website

Prerequisites

  • Dir: /var/www/my-website.com/
  • User: john
  • Web server group: www-data

TL;DR

Set folder permissions for laravel project:

@tr4nk
tr4nk / Cake2_AppModel.php
Created February 25, 2020 02:52
Cake2 AppModel
<?php
App::uses('Model', 'Model');
class AppModel extends Model
{
/**
* Connects to specified database
*
* @param String name of different database to connect with.
* @param String name of existing datasource
@tr4nk
tr4nk / multiple_ssh_setting.md
Last active October 3, 2019 15:30 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key:

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@tr4nk
tr4nk / copy_file_list.sh
Created June 7, 2019 04:21
Copy file list from dir A to dir B/subdir
#!/bin/bash
# declare the following variables: SRC, DEST, LIST_FILE
# cmd: copy_file_list.sh "subdir"
SRC=/d/path/to/A
DEST=/d/path/to/B
# (subdir)
DEST_PARENT=$1
@tr4nk
tr4nk / .0-sample php-apache docker-compose file.md
Last active January 21, 2018 03:14
sample php-apache docker-compose file

Sample php-apache docker-compose file

Project directory structure

project

  • .docker
    • docker-compose.yml
    • vhost.conf

Notes

Set your database config host and port the same as environment variables DB_HOST and DB_PORT (defined in docker-compose.yml).

@tr4nk
tr4nk / curl-with-sftp-https.md
Created January 6, 2018 05:58
Install curl with sftp and https support on Ubuntu
  • Download latest curl
  • Manual install curl:
sudo apt install libssh2-1-dev libssl-dev
cd curl/
./configure --with-ssl --with-libssh2
make
sudo make install
  • Test installation: