Skip to content

Instantly share code, notes, and snippets.

View s-lyn's full-sized avatar
🇺🇦
I feel good

Serhii Lynnyk s-lyn

🇺🇦
I feel good
  • Kyiv, Ukraine
View GitHub Profile
@s-lyn
s-lyn / INSTALL.md
Last active October 30, 2024 12:48
Configure Kubernetes Dashboard Web UI hosted with Nginx Ingress Controller
@s-lyn
s-lyn / CI_EXAMPLE_NPM_GITLAB_CI.md
Created January 31, 2020 05:00
Continuous Deployment example to npm using GitLab CI

Got from here

1. Create .gitlab-ci.yml:

image: node:alpine

before_script:
  - npm install
@s-lyn
s-lyn / PROTECTED_REACT_GITLAB_RSYNC_NGINX.md
Last active December 22, 2021 09:51
Deploy react app with gitlab.com and RSYNC

Deploy react app with gitlab.com and RSYNC

This is tutorial is about simple client-server file updating. This is not blue-green deploy!

Protocol: RSYNC through SSH. Tested on target server: Ubuntu 16.04 x64. (suitable for Ubuntu 14.x).

@s-lyn
s-lyn / MANUAL.md
Created September 15, 2017 10:27
Deploy nodejs app with gitlab.com and pm2

Deploy nodejs app with gitlab.com and pm2

This manual is about setting up an automatic deploy workflow using nodejs, PM2, nginx and GitLab CI. It is tested on:

  • Target server: Ubuntu 16.04 x64. This is suitable for Ubuntu 14.x.
  • Windows 10 on my PC to work.
@s-lyn
s-lyn / shortenTo.js
Last active June 9, 2017 09:18
Function to shorten the string to the specified length
/**
* Shorten the string to the specified length.
* Example: shortenTo("Lorem ipsum dolor", 10); // "Lorem i..."
* @param {string} str
* @param {number} len
*/
function shortenTo(str, len) {
const strLen = str.length;
return strLen < len ? str : str.substr(0, len - 3) + '...';
}
@s-lyn
s-lyn / randomString.js
Created June 8, 2017 08:21
Generate random string/characters in JavaScript
/**
* Generate random string
* @param {number} len Length of string
* @param {string} charSet Allowable characters
* @return {string}
*/
function randomString(len = 10, charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {
let randomString = '';
for (let i = 0; i < len; i++) {
let randomPoz = Math.floor(Math.random() * charSet.length);
@s-lyn
s-lyn / openssl_aes256.sh
Last active April 27, 2017 08:46
Simple File Encryption with OpenSSL
# Create file
echo My_super_secret > secrets.txt
# Encrypt with password
openssl aes-256-cbc -a -salt -in secrets.txt -out secrets.txt.enc
# Decrypt with password input
openssl aes-256-cbc -d -a -in secrets.txt.enc -out secrets1.txt
# Decrypt with password as option
openssl aes-256-cbc -d -a -k qwerty -in secrets.txt.enc -out secrets2.txt
# Link: http://tombuntu.com/index.php/2007/12/12/simple-file-encryption-with-openssl/