sudo mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
service mysql restart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04 | |
#install necessary libs | |
sudo apt update | |
sudo apt install python3-pip python3-dev libpq-dev nginx curl | |
#install mysql | |
sudo apt install mysql-server | |
sudo apt-get install libmysqlclient-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer dump-autoload | |
php artisan cache:clear | |
php artisan config:clear | |
php artisan view:clear |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo find /home/forge/default/user/ -mindepth 1 -type f -mtime +7 | xargs rm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove all block comments and line comments: | |
(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/|[ \t]*//.*) | |
Remove block comments: | |
(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/) | |
Remove line comments: | |
([ \t]*//.*) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# checkout to old_named branch | |
git checkout <old_name> | |
# create new named branch | |
git branch -m <new_name> | |
# push new named branch to remote | |
git push origin -u <new_name> | |
# delete old named branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_HOST=1.2.3.4 | |
DB_PORT=3306 | |
DB_DATABASE=db_name | |
DB_PASSWORD='password' | |
DB_USERNAME=username | |
pv -f db.sql | mysql -f -h ${DB_HOST} --port=${DB_PORT} -u${DB_USERNAME} -p${DB_PASSWORD} ${DB_DATABASE} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import json | |
import os | |
from pathlib import Path | |
import requests | |
from requests.compat import urljoin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Illuminate\Support\Collection; | |
function csvToArray($filename = '', $delimiter = ',') | |
{ | |
if (!file_exists($filename) || !is_readable($filename)) | |
return false; | |
$header = null; | |
$data = array(); | |
if (($handle = fopen($filename, 'r')) !== false) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$action = AutomationAction::where('type','upload')->whereNull('started_at')->whereHasMorph( 'performer',['App\Video'], function ( $query) { $query->whereNotNull('uploaded_at'); })->update(['status'=>'success','started_at'=>now(),'finished_at'=>now()]); |