Skip to content

Instantly share code, notes, and snippets.

user nginx;
worker_processes 4;
daemon off;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name localhost;
root /var/www;
index index.php index.html index.htm;
location / {
@aminelch
aminelch / description.md
Created September 9, 2021 10:30
add docker for no Root user

Post-installation steps for Linux:

#Manage Docker as a non-root user🔗

The Docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can only access it using sudo. The Docker daemon always runs as the root user. $- sudo usermod -aG $USER

To create the docker group and add your user:

Create the docker group.

window.onload=()=> {
let form = document.querySelector('#form-search')
let btnSubmit= form.querySelector("button[type=submit]")
const btnSubmitText= btnSubmit.textContent
form.addEventListener("submit",function(e){
e.preventDefault()
let searchField= form.querySelector('#q')
app.showAjaxAnimation()
const requestUri=form.getAttribute('href')
let xhr = new XMLHttpRequest();
@aminelch
aminelch / useful links.md
Created April 29, 2020 04:56
useful link for web developer

corriger le message d'un commit git commit --amend -m Nouveau message pour le commit

@aminelch
aminelch / .java
Created May 27, 2019 22:43
getAllQuestion method
public List<Question> getAllQuestions() {
List<Question> questions = new ArrayList<Question>();
Connection connection = null;
Statement statement = null;
ResultSet resultSet = null;
try {
connection = ConnectionConfiguration.getConnection();
statement = connection.createStatement();
resultSet = statement.executeQuery("SELECT* FROM questions ORDER BY RAND() LIMIT 8");
@aminelch
aminelch / .java
Created May 27, 2019 02:37
simple class to comminucate with Mysql Database
package sqlDatabase;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class Main {
public static Connection getConnection() throws Exception {
@aminelch
aminelch / sh
Last active April 29, 2019 21:06
qlq commandes utiles
#simple unzip
unzip latest.zip
#To unzip a ZIP file in a different directory than the current one, use the -d switch.
unzip filename.zip -d /path/to/directory
#To enable and disable services to auto-start at reboot, use the following commands
#Enable service