Login as root and ...
# create new user
useradd hocvt
# change pass
passwd hocvt
# add to sudoer
usermod -aG wheel hocvt
# login to created user
#!/bin/bash | |
# file /var/www/backup.sh | |
# Run `cd /var/www && sh backup.sh` | |
# This script is used for laravel projects deployed by deployer php | |
function run_backup(){ | |
export $(cat current/.env | sed 's/#.*//g' | xargs) |
#!/usr/bin/env python | |
""" | |
Extracts title from PDF files (Python 3). | |
Depends on: pdf, pyPDF2, PDFMiner3k, unidecode. | |
Usage: | |
pdftitle -d tmp --rename *.pdf{} | |
""" | |
from io import StringIO |
version: '3' | |
services: | |
master: | |
image: chrislusf/seaweedfs # use a remote image | |
ports: | |
- 9333:9333 | |
- 19333:19333 | |
command: "master -ip=master" | |
volumes: |
<?php | |
declare(ticks = 1); | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
class ChatCommand extends Command | |
{ |
#!/bin/bash | |
export $(cat current/.env | sed 's/#.*//g' | xargs) | |
export MYSQL_PWD=$DB_PASSWORD | |
mysqldump -u $DB_USERNAME $DB_DATABASE \ | |
--no-tablespaces \ | |
--verbose \ | |
--result-file $DB_DATABASE.sql |
<?php | |
/** | |
* @credit https://stackoverflow.com/questions/33046020/laravel-php-prepend-timestamp-to-artisan-console-output | |
*/ | |
namespace App\Commands; | |
trait PrependsTimestamp | |
{ |
<?php | |
/** | |
* Url có dạng http://example.com/listing?page={1-100,0} | |
* trong đó 1-100 là loop page, | |
* 0 là tuỳ chọn check die link trước khi add, mặc định là 0 | |
* | |
* @param $url | |
* | |
* @return \Generator | |
*/ |
#!/bin/bash | |
## Use : ss command | |
## variable for change : | |
## | |
##---------- | |
Timetemp='%H%M' | |
Time=$(date +"${Timetemp}") | |
Date=$(date +"%y%m%d") | |
Yest=$(date --date="1 day ago" +"%y%m%d") | |
#Day=$(date +"%a") |
#!/bin/bash | |
# sudo ./mysql-db-create.sh dbname dbuser password | |
# Functions | |
ok() { echo -e '\e[32m'$1'\e[m'; } # Green | |
EXPECTED_ARGS=3 | |
E_BADARGS=65 | |
MYSQL=`which mysql` |
Login as root and ...
# create new user
useradd hocvt
# change pass
passwd hocvt
# add to sudoer
usermod -aG wheel hocvt
# login to created user