Skip to content

Instantly share code, notes, and snippets.

var fs = require('graceful-fs');
var path = require('path');
var pmx = require('pmx');
var pm2 = require('pm2');
var moment = require('moment-timezone');
var scheduler = require('node-schedule');
var zlib = require('zlib');
var conf = pmx.initModule({
widget : {
@piotrkochan
piotrkochan / cleanup_docker.sh
Created October 8, 2020 06:43 — forked from ralphtheninja/cleanup_docker.sh
Cleanup and reset docker on Jenkins workers / slaves
#!/bin/bash
# This script should be located on each Jenkins slave, and the jenkins user should have permission to run it with sudo
# Attempts to cleanly stop and remove all containers, volumes and images.
docker ps -q | xargs --no-run-if-empty docker stop
docker ps -q -a | xargs --no-run-if-empty docker rm --force --volumes
docker volume ls -q | xargs --no-run-if-empty docker volume rm
docker images -a -q | xargs --no-run-if-empty docker rmi -f
# Stops the docker service, unmounts all docker-related mounts, removes the entire docker directory, and starts docker again.
@piotrkochan
piotrkochan / Win10KeyFinder.vbs
Created May 29, 2020 19:35
Find Windows 10 Key with ease
' got from https://www.techspot.com/articles-info/1760/images/Win10KeyFinder.txt
Option Explicit
Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
@piotrkochan
piotrkochan / Makefile
Last active August 21, 2019 19:37
Simple Makefile which builds Symfony 4 App and make it easier to deploy via FTP or similar method.
DIST = dist
clean:
rm -rf $(DIST)/
mkdir $(DIST)/
copy:
cp -r assets bin config src templates tests translations $(DIST)/
cp composer.json composer.lock package.json symfony.lock yarn.lock $(DIST)/
cp webpack.config.js $(DIST)/