Skip to content

Instantly share code, notes, and snippets.

View BrahimAfa's full-sized avatar
🐢
Creating bugs

Brahim Afassy BrahimAfa

🐢
Creating bugs
View GitHub Profile
@BrahimAfa
BrahimAfa / PDO_Cheatsheet.php
Last active March 7, 2021 11:51 — forked from hanvari/PDO_Cheatsheet.php
PHP PDO Cheatsheet
<?php
/*
Reference:
http://code.tutsplus.com/tutorials/why-you-should-be-using-phps-pdo-for-database-access--net-12059
*/
function connect(){
/*
storage:
dbPath: "/data/db"
journal:
enabled: true
systemLog:
destination: file
path: "/var/log/mongodb.log"
logAppend: true
timeStampFormat: iso8601-utc
processManagement:
@BrahimAfa
BrahimAfa / mongodb_3.2.x_logging.md
Created September 18, 2020 09:21 — forked from leommoore/mongodb_3.2.x_logging.md
MongoDB 3.2.x Logging

MongoDB 3.2.x Logging

The main log file is the mongod.log. You can specify the log file location when you are starting the mongod process but if you have installed on Ubuntu from a package then you log file will normally be located in /var/log/mongodb/mongod.log.

You can tail the log file using:

tail -f /var/log/mongodb/mongod.log

From the Mongo shell you can also view the log file using:

show logs

@BrahimAfa
BrahimAfa / node_nginx_ssl.md
Last active March 29, 2022 21:08 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

this is some useful commands i usually forget a lot.

  • export mongo database
$ mongodump -d db -o your/path/here
  • import mongo database
$  mongorestore --db storeinostore --verbose ./data
@BrahimAfa
BrahimAfa / run_Jenkins_in_docker.md
Last active July 21, 2020 14:46
simple gist for runing jenkins

usefull commands

  • delete all containers : to run sudo commands on script and to not get propted for the password add
username ALL = NOPASSWD: /fullpath/to/command, /fullpath/to/othercommand

/fullpath/to/command can be /usr/bin/apt and this line shoud be added to