Skip to content

Instantly share code, notes, and snippets.

View zmts's full-sized avatar
🇺🇦
russian warship go f*uck yourself

Sasha Zmts zmts

🇺🇦
russian warship go f*uck yourself
View GitHub Profile
@zmts
zmts / permissions.md
Last active July 24, 2020 15:31
Permissions for ssh/id_rsa

Permissions for ssh/id_rsa

Case 1

git clone git@gitlab.com:....git

fails with:

Permissions 0644 for '/root/.ssh/id_rsa' are too open.
@zmts
zmts / pm2.md
Last active July 20, 2020 18:33
pm2
@zmts
zmts / debian_nodejs.md
Last active June 29, 2022 18:11
How To Install Node.js on Debian 10
@zmts
zmts / MANUAL.md
Created July 18, 2020 14:08 — forked from s-lyn/MANUAL.md
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.
@zmts
zmts / dockerToLocalhost.md
Created June 30, 2020 09:49
Get access to localhost database from docker container

Get access to localhost database from docker container

  • Run containerized application on 0.0.0.0 address
  • Use host.docker.internal as database hostname
@zmts
zmts / calc.md
Created June 7, 2020 09:19
Tiny Library for Basic but Precise Arithemetic
@zmts
zmts / imageSize.md
Created June 6, 2020 16:48
Get image width and height with JavaScript

Get image width and height with JavaScript

function imageSize (image) {
  return new Promise((resolve, reject) => {
    try {
      const fileReader = new FileReader()

      fileReader.onload = () => {
 const img = new Image()
@zmts
zmts / cmd.sh
Last active May 14, 2020 15:21 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 "http://example.com/api/v1/locations/"
@zmts
zmts / File_descriptor.md
Last active February 27, 2023 15:50
Lack of of file descriptors; Too many open files; Mac OS;

Lack of of file descriptors; Too many open files; Mac OS;

Mac OS X Catalina

Issue:

ab -c 300 -n 1000 https://super.com/api
@zmts
zmts / update-build.md
Last active April 21, 2022 23:58
Auto update application build version. Husky pre-commit hook.

Auto update application build version. Husky pre-commit hook.

package.json

"husky": {
    "hooks": {
      "pre-commit": "npm run build && node ./update-build.js"
    }
  }