Skip to content

Instantly share code, notes, and snippets.

@antonioiksi
antonioiksi / diagrams.md
Created September 2, 2022 11:11 — forked from blackcater/diagrams.md
Markdown Diagrams

Diagrams

Markdown Preview Enhanced supports rendering flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz, Vega & Vega-lite, Ditaa diagrams. You can also render TikZ, Python Matplotlib, Plotly and all sorts of other graphs and diagrams by using Code Chunk.

Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.

Flow Charts

This feature is powered by flowchart.js.

@antonioiksi
antonioiksi / forticlientsslvpn-expect.sh
Created July 22, 2022 18:28 — forked from mgeeky/forticlientsslvpn-expect.sh
Simple script intended to automate Fortinet SSL VPN Client connection on Linux using expect scripting.
#!/bin/bash
# Forticlient SSL VPN Client launching script utilizing expect.
# --------------------------------------------
# CONFIGURATION
# If empty - script will take some simple logic to locate appropriate binary.
FORTICLIENT_PATH=""
@antonioiksi
antonioiksi / Docker_ssh_access.dockerfile
Created February 27, 2021 07:53
Docker file with sshd predefined (user: user, pwd: password) For remote debug dockers
# CLion remote docker environment (How to build docker container, run and stop it)
#
# Build and run:
# docker build -t clion/debian-remote-cpp-env:9 -f Debian-remote-cpp-env.Dockerfile .
# docker run -d --cap-add sys_ptrace -p127.0.0.1:2222:22 --name clion_remote_env clion/debian-remote-cpp-env:9
# ssh-keygen -f "$HOME/.ssh/known_hosts" -R "[localhost]:2222"
#
# stop:
# docker stop clion_remote_env
#
@antonioiksi
antonioiksi / while_for_syntax_bash.sh
Created September 15, 2020 18:15 — forked from bench/while_for_syntax_bash.sh
while and for loop syntax in bash
# While loop
while [ $i -lt 10 ];
do
[...]
done
# C style for loop
for (( c=1; c<=$MAX_VAL; c++ ))
do
[...]
@antonioiksi
antonioiksi / condition_syntax_bash.sh
Created September 15, 2020 18:15 — forked from megamcloud/condition_syntax_bash.sh
conditions syntax in bash
## check the return of a command
if command; then
[...]
fi
## check by string comparison / numerical / file existence / or more
if [[ CHECK ]]; then
[...]
fi
@antonioiksi
antonioiksi / js
Created May 12, 2020 21:11
create_dir_recursively
var fs = require('fs');
/**
* Splits whole path into segments and checks each segment for existence and recreates directory tree from the bottom.
* If since some segment tree doesn't exist it will be created in series.
* Existing directories will be skipped.
* @param {String} directory
*/
function mkdirSyncRecursive(directory) {
var path = directory.replace(/\/$/, '').split('/');
@antonioiksi
antonioiksi / tsconfig.json
Created April 29, 2020 16:29
Typescript tsc tsconfig.jspn
{
"compilerOptions": {
/* Basic Options */
"target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
@antonioiksi
antonioiksi / clean_py.sh
Created December 18, 2018 17:42
remove pycache in python projects
#!/bin/sh
# recursively removes all .pyc files and __pycache__ directories in the current
# directory
find . | \
grep -E "(__pycache__|\.pyc$)" | \
xargs rm -rf
# or, for copy-pasting:
find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf
@antonioiksi
antonioiksi / vscode-nodemon-debug.md
Created December 12, 2018 11:23
vscode nodaemon babel-node debug

Type into package.json

"scripts": {
    "start": "nodemon --delay 5 --inspect=0.0.0.0:9229 ./server.js --exec babel-node -e js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

type into launch.json