Skip to content

Instantly share code, notes, and snippets.

View GregGGregGreG's full-sized avatar
🎯
Focusing

Andrii Ostapenko GregGGregGreG

🎯
Focusing
View GitHub Profile
@GregGGregGreG
GregGGregGreG / README.md
Created February 26, 2021 09:35 — forked from deviantony/README.md
Portainer HTTP API by example

Introduction

This document presents a simple way to manage your Docker resource by using Portainer as a gateway (HTTP queries against the Portainer API).

The API documentation is available here: https://app.swaggerhub.com/apis/deviantony/portainer/

WARNING: This documentation is valid for Portainer >= 1.18.0.

NOTE: I'm using httpie to execute HTTP queries from the CLI.

@GregGGregGreG
GregGGregGreG / sequelizeBulkInsert.js
Created July 2, 2020 08:46 — forked from evansiroky/sequelizeBulkInsert.js
Insert CSV using sequelize bulk insert
var fs = require('fs'),
async = require('async'),
csv = require('csv');
var input = fs.createReadStream(filename);
var parser = csv.parse({
columns: true,
relax: true
});
@GregGGregGreG
GregGGregGreG / start_docker_registry.bash
Created June 17, 2020 08:22 — forked from u1i/start_docker_registry.bash
Start docker registry with letsencrypt certificates and Basic Auth
#!/usr/bin/env bash
# install docker
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# install docker-compose
# https://docs.docker.com/compose/install/
# install letsencrypt
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

To install dependencies of the above script:

npm install yaml

Usage:

parameters:   <inputdir> <outputfile> [--help]
  --help         generates this message.
  <inputdir>     a directory containing individual yml files in a swagger structure.

a directory containing the merged swagger yml files.

These are generic npm scripts that you can copy & paste into your package.json file as-is and get access to convinience scripts to manage your Docker images all in one place.

How to Use

npm i -g mrm-task-npm-docker
npx mrm npm-docker

Contribute

Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker

@GregGGregGreG
GregGGregGreG / git_submodules.md
Created December 16, 2019 15:57 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@GregGGregGreG
GregGGregGreG / git --tree-filter
Created December 6, 2019 16:25
git --tree-filter
# Make a fresh clone of YOUR_REPO
git clone YOUR_REPO
cd YOUR_REPO
# Create tracking branches of all branches
for remote in `git branch -r | grep -v /HEAD`; do git checkout --track $remote ; done
# Show count objects in repository
git count-objects -vH
@GregGGregGreG
GregGGregGreG / proc_net_tcp_decode
Created September 12, 2019 18:21 — forked from jkstill/proc_net_tcp_decode
decode entries in /proc/net/tcp
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]
@GregGGregGreG
GregGGregGreG / IntelIJTrialReset.bat
Created September 19, 2018 14:18
How to Reset InteIIiJ IDEA Evaluation Key in Windows
cd "C:%HOMEPATH%\.IntelliJIdea*\config"
rmdir "eval" /s /q
del "options\options.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f
:: It is Highly Advised to Purchase the JetBrain Softwares
:: This is only for the case You just want to Extend the
:: Trial Period and Evaluate the IDE for some more Time
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error