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
UseCanonicalName Off | |
<VirtualHost *:80> | |
ServerName vhosts.fqdn | |
ServerAlias *.local.com | |
VirtualDocumentRoot /var/www/laravel/%1/public | |
<Directory ~ "/var/www/laralve/%1/public"> | |
Options Indexes FollowSymlinks MultiViews | |
AllowOverride All | |
Require all granted |
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
#nginx config here | |
#.... | |
#end nginx config | |
stream { | |
server { | |
listen 12345; | |
proxy_connect_timeout 1s; | |
proxy_timeout 3s; | |
proxy_pass 127.0.0.1:3306; |
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
echo "ExitNodes {vn},{jp},{sg},{tw},{hk},{kr},{th}" >> /etc/tor/torrc \ | |
&& echo "MaxCircuitDirtiness 30" >> /etc/tor/torrc |
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 python | |
""" | |
Extracts title from PDF files (Python 3). | |
Depends on: pdf, pyPDF2, PDFMiner3k, unidecode. | |
Usage: | |
pdftitle -d tmp --rename *.pdf{} | |
""" | |
from io import StringIO |
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
<?php | |
/** | |
* @credit https://stackoverflow.com/questions/33046020/laravel-php-prepend-timestamp-to-artisan-console-output | |
*/ | |
namespace App\Commands; | |
trait PrependsTimestamp | |
{ |
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
//To Get Size of all the Databases | |
//please Avoid using this it will take very Long time based on the number of databases | |
$sizeOnly = DB::table('information_schema.TABLES') | |
->sum(DB::raw('data_length + index_length')); | |
$sizeOfAllDataBases = DB::table('information_schema.TABLES') | |
->select(['TABLE_NAME as TableName','table_rows as TableRows','data_length as DataLength','index_length as IndexLength','TABLE_SCHEMA as DatabaseName']) | |
->get() | |
->map(function($eachDatabse){ |
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
function serverHealth(): array | |
{ | |
$start_time = microtime(true); | |
// Linux CPU | |
$load = sys_getloadavg(); | |
$cpuload = $load[0]; | |
// Linux MEM | |
$free = shell_exec('free'); | |
$free = trim($free); | |
$free_arr = explode("\n", $free); |
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
[Unit] | |
Description="seaweedfs master service" | |
[Service] | |
User=ssh_5pdf | |
WorkingDirectory=/var/www/media.123doc | |
ExecStart=/usr/bin/weed master -mdir=/var/www/media.123doc/master -volumePreallocate -volumeSizeLimitMB=128000 -ip=127.0.0.1 | |
Restart=always | |
[Install] |
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
version: '3' | |
services: | |
master: | |
image: chrislusf/seaweedfs:2.40_large_disk # use a remote image | |
# ports: | |
# - 9333:9333 | |
# - 19333:19333 | |
entrypoint: "/usr/bin/weed" | |
command: "master -ip=master -mdir=/data -volumePreallocate -volumeSizeLimitMB=20000" |
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
#!/bin/sh | |
echo "Ho va ten:" | |
read name | |
echo "Lop:?" | |
read class | |
echo "So dien thoai:" | |
read phone_number | |
echo "Thu vien sach" |
OlderNewer