Categories
Symfony

Scaffold Symfony app from existing database

Prepare for a new run

rm -r src/Entity/*
rm -r src/Form/*
rm -r src/Controller/*
rm -r src/Repository/*
rm -r templates/*

Copy in a backup of base twig template

cp base.html.twig templates/

Generate entities from an existing database

bin/console doctrine:mapping:import "App\Entity" annotation --path=src/Entity
bin/console make:entity --regenerate App

Make CRUD for each new entity

bin/console make:crud MyEntity
bin/console make:crud AnotherEntity
...

Adjust file permissions

sudo chown -R chris:chris templates/
sudo chown -R chris:chris src/Entity/
sudo chown -R chris:chris src/Controller/
sudo chown -R chris:chris src/Form/

Now, sql insert data fixtures

...
Categories
webserver

Apache & Nginx reverse proxy debugging

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{Host}i\" \"%{User-agent}i\"" chrisdebug
CustomLog ${APACHE_LOG_DIR}/access.log chrisdebug

Logs at /var/log/apache2

Categories
Linux tips

Query DNS data

dig

Query for information on all DNS records

dig your_domain_name.com ANY

Query for A records

dig your_domain_name.com A

host, nslookup and dig share similar functionality.

whois

Return information about a domain name registration, including the name servers it is configured to work with

whois your_domain_name.com