Laravel Naming conventions

WhatHowShould FollowNot to Use
ControllersingularPostControllerPostsController
Routepluralposts/1post/1
Named routesnake_case with dot notationusers.show_activeusers.show-active, show-active-users
ModelsingularUserUsers
hasOne or belongsTo relationshipsingularpostCommentpostComments, post_comment
All other relationshipspluralpostCommentspostComment, post_comments
Tablepluralpost_commentspost_comment, postComments
Pivot tablesingular model names in alphabetical orderpost_useruser_post, posts_users
Model propertysnake_case$model->created_at$model->createdAt
Foreign keysingular model name with _id suffixpost_idPostId, id_post, posts_id
Primary keyidcustom_id
Migrationdate_create_posts_table2019_05_08_posts
MethodcamelCasegetAllget_all
Method in resource controllertablestoresavePost
VariablecamelCase$postsWithAuthor$posts_with_creator

Docker

Reference

Commanddescription
systemctl start docker
systemctl status docker
systemctl stop docker
docker info
docker version
start docker
view docker process status
stop docker
view docker info
view docker version
docker images
docker image ls
docker search ubuntu
docker pull ubuntu
docker rmi ubuntu
docker image rm
view image list
view image list ( > v1.13)
search for an image
download an image
delete an image
delete an image ( > v1.13)
docker ps -a
docker ps -l
docker container ls
docker container rm <cid>
docker rm <cid>
view running containers
view all containers
view containers ( > v1.13)
delete container with id <cid>
delete container with id <cid>
docker run imagename
docker run –name bla imagename
docker run -it ubuntu
docker start <cid>
docker stop <cid>
docker stop $(docker ps -q)
docker stats <cid>
docket top <cid>
docker kill<cid>
create and run a container
create and run a named container
create interactive session
start an existing container
stop a container
stop all running containers
view running stats of a container
view top stats of a container
kill a running container
docker attach <cid>
docker exec -it ubuntu bash
reconnect to a running container
Open a new terminal window

How to detach

How container was startedhow to detach
-t and -i is used to launch the containerctrl + P and then ctrl + Q
-t is used to launch the containerctrl + C
otherwisepkiill

Examples

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 --publish 22:22 \
  --name gitlab \
  --restart always \
  --volume /srv/gitlab/config:/etc/gitlab \
  --volume /srv/gitlab/logs:/var/log/gitlab \
  --volume /srv/gitlab/data:/var/opt/gitlab \
  gitlab/gitlab-ce:latest

References:

Free and public dns servers (2019)

ProviderPrimary DNSSecondary DNS
CenturyLink (Level3)209.244.0.3209.244.0.4
Verisign64.6.64.664.6.65.6
Google8.8.8.88.8.4.4
Quad99.9.9.9149.112.112.112
DNS.WATCH84.200.69.8084.200.70.40
Comodo Secure DNS8.26.56.268.20.247.20
OpenDNS Home208.67.222.222208.67.220.220
GreenTeamDNS81.218.119.11209.88.198.133
SafeDNS195.46.39.39195.46.39.40
OpenNIC198.206.14.241172.98.193.42
SmartViper208.76.50.50208.76.51.51
Dyn216.146.35.35216.146.36.36
FreeDNS45.33.97.537.235.1.177
Alternate DNS*198.101.242.7223.253.163.53
Yandex.DNS77.88.8.877.88.8.1
UncensoredDNS91.239.100.10089.233.43.71
Hurricane Electric74.82.42.42
puntCAT109.69.8.51
Neustar156.154.70.1156.154.71.1
Cloudflare1.1.1.11.0.0.1
Fourth Estate45.77.165.194
CleanBrowsing185.228.168.9185.228.169.9

* Automatic ad blocking

enable cors (standard ee)

Simply create the filter:

import java.io.IOException;
 import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.container.ContainerResponseContext;
 import javax.ws.rs.container.ContainerResponseFilter;
 import javax.ws.rs.ext.Provider;
 @Provider
 public class RestResponseFilter implements ContainerResponseFilter{
 @Override
     public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException{
         responseContext.getHeaders().putSingle("Access-Control-Allow-Origin", "*");
         responseContext.getHeaders().putSingle("Access-Control-Allow-Credentials", "true");
         responseContext.getHeaders().putSingle("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
         responseContext.getHeaders().putSingle("Access-Control-Allow-Headers", "Content-Type, Accept");
     }
 }

References

Personal portal to the Internet