Skip to content

Instantly share code, notes, and snippets.

View kolosovpetro's full-sized avatar

Petro Kolosov kolosovpetro

View GitHub Profile
@kolosovpetro
kolosovpetro / win_restore.ps1
Last active October 11, 2023 16:35
To restore windows
sfc /scannow
chkdsk C: /f /r /x
chkdsk D: /f /r /x
DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth
DISM /Online /Cleanup-Image /RestoreHealth /Source:F:\Sources\install.wim
@1eedaegon
1eedaegon / install-vmware-player-with-vagrant.ps1
Last active August 4, 2025 13:22
Install vagrant with vmware for windows 11
# 1. Download and install go
https://golang.org/doc/install
# 2. Download and install VMware workstation player
https://www.vmware.com/products/workstation-player.html
# 3. Download and install vagrant
https://www.vagrantup.com/downloads
# 4. Download vagrant vmware utility
@artyomsveshnikov
artyomsveshnikov / server.js
Created August 22, 2021 09:22
Simple server.js for Angular static site
//Install express server
const express = require('express');
const path = require('path');
const app = express();
// Serve only the static files form the dist directory
app.use(express.static(__dirname + '/dist/<appName>'));
app.get('/*', function(req,res) {
@zubair1024
zubair1024 / ecosystem.json
Created December 8, 2019 14:06
Running PM2 as a window service
{
"apps": [
{
"name": "web",
"script": "C:\\ws\\engineer\\titan-web\\app.js",
"args": [],
"cwd": "C:\\ws\\engineer\\titan-web",
"merge_logs": true,
"instances": 1,
"exec_mode": "cluster_mode",
@mauron85
mauron85 / README.md
Last active July 6, 2024 02:49 — forked from maxfierke/README.md
PM2 as a Windows Service under Local Service

PM2 as a Windows Service under Local Service

This is a PoC for running PM2 as a Windows Service under the Local Service account instead of the Local System account.

Prerequsites

  • Neither pm2 or pm2-windows-service installed yet. (The Powershell script will run npm i)
    • At the very least, you should run pm2-service-uninstall before running this script
  • npm and npm-cache global folders should be somewhere accessible to NT AUTHORITY\LocalService.
@joatmon08
joatmon08 / app.tf
Last active November 23, 2024 21:40
Terraform Example for Azure App Gateway & App Service
locals {
app_services = [
{
kind = "Linux"
sku = {
tier = "Standard"
size = "S1"
}
},
{
@marcostolosa
marcostolosa / CloudFlare-API.md
Last active July 3, 2025 12:57
Cloudflare API - Using Cloudflare’s API, you can do just about anything you can do on cloudflare.com via the customer dashboard.

Cloudflare's API Cheat-Sheet

VARIABLE VALUE
EMAIL The email address associated with your Cloudflare account.
KEY The global API key associated with your Cloudflare account.
DOMAIN The name of the domain to create a zone record for.
JUMP_START If true, automatically attempts to fetch existing DNS records when creating a domain’s zone record
ZONE_ID The unique ID of the domain’s zone record. Assigned by Cloudflare. Required when managing an existing zone record and its DNS records.
<#
.SYNOPSIS
Uses Win32_Fan class to return information about fans in a system.
.DESCRIPTION
This script first defines some functions to decode various
WMI attributed from binary to text. Then the script calls
Get-WmiObject to retrieve fan details, then formats that
information (using the functions defined at the top of the script.
.NOTES
@mosquito
mosquito / README.md
Last active August 23, 2025 02:11
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/[email protected]. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@zmts
zmts / tokens.md
Last active August 19, 2025 15:47
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов