This file contains 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 vim /etc/rc.d/rc.local | |
## paste script inside /\ | |
# mount qnap after reboot | |
mount -t cifs //192.168.1.152/Backups /qnap -o username=admin,password=pass,vers=2.0 | |
sudo chmod +x /etc/rc.d/rc.local | |
``` | |
This file contains 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/bash | |
export LC_ALL=C | |
days_of_backups=2 # Must be less than 7 | |
backup_owner="root" | |
parent_dir="/backups/mysql" | |
defaults_file="/etc/my.cnf.d/backup.cnf" | |
todays_dir="${parent_dir}/$(date +%a)" | |
log_file="${todays_dir}/backup-progress.log" |
This file contains 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/bash | |
export LC_ALL=C | |
days_of_backups=2 # Must be less than 7 | |
backup_owner="root" | |
parent_dir="/backups/mysql" | |
defaults_file="/etc/my.cnf.d/backup.cnf" | |
todays_dir="${parent_dir}/$(date +%a)" | |
log_file="${todays_dir}/backup-progress.log" |
This file contains 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 declare(strict_types=1); | |
namespace App\Command; | |
use Psr\Log\LoggerInterface; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
class DeleteOldFilesCommand extends Command |
This file contains 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
/etc/supervisord.d | |
#!/bin/sh | |
## | |
## /etc/rc.d/init.d/supervisord | |
## | |
## Supervisor is a client/server system that | |
## allows its users to monitor and control a | |
## number of processes on UNIX-like operating | |
## systems. |
This file contains 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://getcomposer.org/doc/articles/versions.md#writing-version-constraints | |
1.0 - 2.0 is equivalent to >=1.0.0 <2.1 | |
~1.2 is equivalent to >=1.2 <2.0.0, while ~1.2.3 is equivalent to >=1.2.3 <1.3.0 | |
^1.2.3 is equivalent to >=1.2.3 <2.0.0 as none of the releases until 2.0 should break backwards compatibility. | |
pre-1.0 versions it also acts with safety in mind and treats ^0.3 as >=0.3.0 <0.4.0 | |
1.2.3 =1.2.3.0-stable | |
>1.2 >1.2.0.0-stable |
This file contains 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
IMAGES : | |
<?php<?php | |
trytry { { | |
//// Create a new SimpleImage object Create | |
$image = new \claviska\SimpleImage(); | |
// Magic! ✨ | |
$image | |
->fromFile('image.jpg') // load image.jpg |
This file contains 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
create column auto update timestamp: | |
CREATE TABLE comments2 ( | |
content VARCHAR(100), | |
changed_at TIMESTAMP DEFAULT NOW() ON UPDATE CURRENT_TIMESTAMP | |
); | |
Date Math: | |
SELECT birthdt, birthdt + INTERVAL 15 MONTH + INTERVAL 10 HOUR FROM people; | |
Date Format |
This file contains 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
cerate your bash aliases | |
gedit ~/.bashrc | |
update it | |
source ~/.bashrc | |
# docker-compose | |
alias dcu='docker-compose up --d' | |
alias dcub='docker-compose up --build' | |
alias dcd='docker-compose down' | |
alias dcb='docker-compose build' |
This file contains 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 | |
namespace App\EventListener; | |
use Doctrine\ORM\Event\LifecycleEventArgs; | |
use App\Entity\User; | |
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; | |
class PasswordHashListener | |
{ | |
private $passwordEncoder; | |
public function __construct(UserPasswordEncoderInterface $passwordEncoder) | |
{ |
NewerOlder