Skip to content

Instantly share code, notes, and snippets.

View jsnjack's full-sized avatar

Yauhen Shulitski jsnjack

View GitHub Profile
@jsnjack
jsnjack / init_project_venv.sh
Last active March 28, 2024 13:23
Install all python dependencies in folder
#!/bin/bash
sudo dnf install python3-xmlsec xmlsec1-devel libtool-ltdl-devel cmake dbus-devel glib2-devel
find . -name '.venv' -prune -o -name '*requirements*.txt' -print0 | xargs -0 cat | grep -oE '^[^~=]+' | grep -vE '^dnf|^functools32|^gpg|^libdnf|^psycopg|^systemd-python' | sort | uniq > /tmp/combined_requirements.txt
invenv init -r /tmp/combined_requirements.txt -d
rm -f /tmp/combined_requirements.txt
@jsnjack
jsnjack / self-signed-certificate-with-custom-ca.md
Created June 28, 2019 14:04 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@jsnjack
jsnjack / get_unique_selector.js
Last active November 11, 2016 14:30
Return unique selector of the element
/*globals document*/
var element = document.querySelector('a');
function positionInNodeList(element, nodeList) {
for (var i = 0; i < nodeList.length; i++) {
if (element === nodeList[i]) {
return i;
}
}