Skip to content

Instantly share code, notes, and snippets.

View senid231's full-sized avatar
🇺🇦
Все буде Україна

Denis Talakevich senid231

🇺🇦
Все буде Україна
View GitHub Profile
@senid231
senid231 / ssl_puma.sh
Created September 27, 2022 10:14 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@senid231
senid231 / nari_ultimate_testing.py
Created September 5, 2022 12:13 — forked from pieromarini/nari_ultimate_testing.py
Razer Nari Ultimate Testing
import usb.core
import usb.util
import usb.control
import time
import decimal
INTERFACE_NUMBER = 5
TIMEOUT = 2000
@senid231
senid231 / links.textile
Created December 5, 2021 10:07 — forked from lucashungaro/links.textile
Links de referência utilizados em minha palestra
@senid231
senid231 / postgres_queries_and_commands.sql
Last active November 23, 2021 15:48 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '' AND query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- kill running query
SELECT pg_cancel_backend(procpid);
-- kill idle query
@senid231
senid231 / aes-gcm.js
Created September 25, 2020 11:20 — forked from themikefuller/aes-gcm.js
AES-GCM Encryption and Decryption Examples using Web Crypto (subtle.crypto) JavaScript API
async function generateKey() {
return await crypto.subtle.generateKey({
"name":"AES-GCM",
"length":256
},true,['encrypt','decrypt']);
}
async function exportKey(key) {
return await crypto.subtle.exportKey('jwk', key);
}
@senid231
senid231 / ID.js
Created December 16, 2018 10:06
ID - a unique ID/name generator for JavaScript
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
//
// The goals of this function are twofold:
//
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`
@senid231
senid231 / ruby-pkg.sh
Created July 18, 2018 12:04 — forked from barcus/ruby-pkg.sh
Building Ruby package for Debian Wheezy
#!/usr/bin/env bash
#VERSION='2.0.0-p353'
VERSION='2.1.0'
PKGNAME='ruby2.1'
CONFIGURE_OPTS='--disable-install-rdoc'
apt-get install ruby rubygems -y
gem install fpm --no-ri --no-rdoc
# Run this in your shell to install a set of atom-plugins
# for working with rust projects and git
# Rust essentials
apm install language-rust racer linter linter-rust build build-cargo cargo-test-runner rust-api-docs-helper
# Other
apm install keyboard-localization autoupdate-packages project-manager atom-terminal minimap docblockr theme-switcher
# Git
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build
rbenv install 1.9.3-p392