Skip to content

Instantly share code, notes, and snippets.

@stokito
stokito / README.md
Last active July 20, 2024 01:39
Cryptography GUI tools: OpenSSL GUI, keys management, PKI, PGP/GPG GUI

OS tools and user friendly cryptography GUI tools

Windows Certificate Manager Tool (certmgr.msc) Manage storage for x509 keys. No support for PGP/GPG. Can't sign or encode, can't generate a key. You can use IIS webserver managemnt console to generate a cert.Proprietary

certmgr screenshot

GNOME Seahorse GUI for SSH keys, X509 certs, PGP/GPG. Linux only.

@slorber
slorber / generate-docs-from-js.js
Last active June 14, 2024 20:40 — forked from arinthros/generate-docs-from-js
Generate Docusaurus Docs from JSDoc
/**
* Requires jsdoc and jsdoc-to-markdown
*/
/* eslint-disable no-console */
const fs = require('fs')
const path = require('path')
const glob = require('glob')
const { execSync } = require('child_process')
const jsdoc2md = require('jsdoc-to-markdown')
@sindresorhus
sindresorhus / esm-package.md
Last active July 23, 2024 07:23
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.

Create Windows Terminal shortcut in Windows + X context menu

Windows Terminal shortcut in WinX context menu

In Windows PowerShell do the following:

$folderPath = "$ENV:LOCALAPPDATA\Microsoft\Windows\WinX\Group3"
$adminFilePath = Join-Path $folderPath "00 - Windows Terminal.lnk"
$normalFilePath = Join-Path $folderPath "00a - Windows Terminal.lnk"
@mattmattox
mattmattox / rke_recovery.sh
Last active May 28, 2024 22:09
Recovering cluster.yml and cluster.rkestate from kubeconfig
#!/bin/bash
echo "Building cluster_recovery.yml..."
echo "Working on Nodes..."
echo 'nodes:' > cluster_recovery.yml
kubectl --kubeconfig kube_config_cluster.yml -n kube-system get configmap full-cluster-state -o json | jq -r .data.\"full-cluster-state\" | jq -r .desiredState.rkeConfig.nodes | yq r - | sed 's/^/ /' | \
sed -e 's/internalAddress/internal_address/g' | \
sed -e 's/hostnameOverride/hostname_override/g' | \
sed -e 's/sshKeyPath/ssh_key_path/g' >> cluster_recovery.yml
echo "" >> cluster_recovery.yml
@Mecanik
Mecanik / gist:d2314fbc860b9c68eac4b101127b738e
Created November 4, 2019 11:58
Install and configure PHP 7.3 ev/event PECL extension on Ubuntu Linux 18.04.3
# For phpize
apt install php7.3-dev
# Install extensions
pecl install ev
pecl install event
# Create configurations
sudo echo 'extension=ev.so' > /etc/php/7.3/mods-available/ev.ini
sudo echo 'extension=event.so' > /etc/php/7.3/mods-available/event.ini

Why to Ignore Russian Internet Laws

There is internet censorship in Russia. VPNs and internet providers are required to install into their networks Revizor, a device that checks that censored sites can't be accessed from their network. They are also required to install SORM (wiki/SORM, another wiki) to help Russian special services to analyse traffic and track users.

If you have or are going to have internet business in Russia I call you to ignore all the demands to install SORM and Revizor into your network. Also don't move personal data to Russia. If you can't avoid complying to these demands then just don't have your business in Russia at all.

Please, don't invest in Cheburnet (autonomous Russian internet that can be easily isolated and abusively censored without any collateral damage). Cheburnet is built to help the Kremlin in power usurpation.

The Reasons

#!/bin/bash
# This stupid script can convert slack json exports
# (created with https://solawivuml.slack.com/apps/A19P6G35Y-export?next_id=0)
# to rocket.chat csv imports.
# The zip file can be directelly imported into rocket.chat.
test -z $1 && echo "usage: $0 slack_export_json_file.json channel_name" && exit 1
# format users (needed for import)
cat $1 | jq '.[] | {name,real_name} | @json' | awk -F '"' '{print $5","$5"@dummy.import,"$9}' | sed 's#\\##g' | sort -n | uniq >users.csv
@jsdevtom
jsdevtom / frontend-ws-connection.ts
Last active July 17, 2024 17:37
kubernetes-ingress websockets with nodejs
export const ws = webSocket<WebsocketMessage>(`wss://${location.hostname}:${location.protocol === 'https:' ? 443 : 80}/ws/`);
export const wsObserver = ws
.pipe(
retryWhen(errors =>
errors.pipe(
delay(1000)
)
)
);
@ruohki
ruohki / 1-rbac.yaml
Last active January 5, 2019 22:01 — forked from carloscarnero/1-rbac.yaml
Traefik on Rancher
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
rules:
- apiGroups:
- ""
resources:
- services