Skip to content

Instantly share code, notes, and snippets.

View MnifR's full-sized avatar
🎯
Focusing

Raouf MnifR

🎯
Focusing
View GitHub Profile
#!/usr/bin/env groovy
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import hudson.model.Actionable;
pipeline {
agent { label 'golang' }
options {
ansiColor('xterm')

Jenkins Back up and restore

Backing up Jenkins

You can manually back up your Jenkins PersistentVolume, or install the Backup plugin.

To install the Backup plugin, open the Jenkins plugin manager. To get the URL for the plugin manager, run the following command:

@MnifR
MnifR / nginx-socketio-ssl-reverse-proxy.conf
Created October 5, 2020 15:23 — forked from gmanau/nginx-socketio-ssl-reverse-proxy.conf
How to setup nginx as nodejs/socket.io reverse proxy over SSL
upstream upstream-apache2 {
server 127.0.0.1:8080;
}
upstream upstream-nodejs {
server 127.0.0.1:3000;
}
server {
listen 80;
git init # initiates git in the current directory
git clone <address> # creates a git repo from given address (get the address from your git-server)
git clone <address> -b <branch_name> <path/to/directory> # clones a git repo from the address into the given directory and checkout's the given branch
git clone <address> -b <branch_name> --single-branch # Clones a single branch
git add file.txt # adds(stages) file.txt to the git
git add * # adds(stages) all new modifications, deletions, creations to the git
git reset file.txt # Removes file.txt from the stage
git reset --hard # Throws away all your uncommitted changes, hard reset files to HEAD
git rm file.txt # removes file.txt both from git and file system
##############################################################################
# NGINX
# DOCUMENTATION: https://nginx.org/en/docs/
##############################################################################
sudo nginx -t # Check syntax
sudo systemctl status nginx # nginx current status
sudo systemctl reload nginx # Reload nginx
sudo systemctl restart nginx # Restart nginx
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/ # Link website
##############################################################################
# VIM CHEATSHEET
# WEBSITE: http://www.vim.org/
# DOCUMENTATION: https://vim.sourceforge.io/docs.php
##############################################################################
##############################################################################
# CURSOR MOVEMENTS
##############################################################################
/* *******************************************************************************************
* SYNOPSIS
* http://nodejs.org/api/synopsis.html
* ******************************************************************************************* */
var http = require('http');
// An example of a web server written with Node which responds with 'Hello World'.
// To run the server, put the code into a file called example.js and execute it with the node program.

connect

mongo --hostname <hostname> \
	--port <port> \
	-u <username> \
	-p <password> \
	--athenticationDatabase <database>

disconnect

@MnifR
MnifR / sql-mongo_comparison.md
Created March 18, 2021 10:18 — forked from aponxi/sql-mongo_comparison.md
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

Cli

rabbitmqctl Service management and operator tasks https://www.rabbitmq.com/rabbitmqctl.8.html

rabbitmq-diagnostics Diagnostics/Health check

rabbitmq-plugins Plugin management

rabbitmqadmin Operator tasks over HTTP API