Skip to content

Instantly share code, notes, and snippets.

@duzun
duzun / watch-n-run.sh
Last active September 14, 2024 22:04
Watch the filesystem for changes and run the modified file, compiling if necessary.
#!/bin/bash
# Watch the filesystem for changes and run the modified file, compiling if necessary.
# Requires inotify-tools.
#
# @src https://gist.github.com/duzun/447498b3dbe7967bc91d549f45920d58
# @run https://repl.it/@duzun/watch-n-run
# See also watchnsync() at https://github.com/duzun/dotfiles/blob/7abdde9abcbc558c8c29d418c7cf1dd3ee0cac93/~/.aliasrc#L339
if ! command -v inotifywait >/dev/null; then
@duzun
duzun / check_free_disk_space.sh
Last active September 6, 2024 06:57
Check disk space usage on all mounted partitions and email when over the thresholds.
#!/bin/bash
#
# Check disk space usage on all mounted partitions
# and email when over the thresholds.
#
# @author Dumitru Uzun (contact@duzun.me)
# @version 1.0.0
# @src https://gist.github.com/duzun/bb9378b38f6b18b1b725ae4260ca726b
#
@duzun
duzun / init.d srv1cv83
Created August 26, 2024 22:20
1Cv8.3 service init script
#!/bin/bash
### BEGIN INIT INFO
# Provides: srv1cv83
# Required-Start: $remote_fs $network $syslog $named
# Required-Stop: $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: 1C:Enterprise 83 server.
### END INIT INFO
@duzun
duzun / cgroup-info
Created January 17, 2022 11:37
Show cgroup info for a given group (memory & cpu)
#!/bin/bash
#########################################
# Show cgroup info for a given group #
# #
# @author Dumitru Uzun (DUzun.Me) #
#########################################
# https://gist.github.com/duzun/1246c850fb858ba2fdc1350e747ee87a
@duzun
duzun / get_flag.js
Created May 13, 2021 09:48
get-country-flag
function getFlag(country_code) {
// just some unicode magic
return String.fromCodePoint(...Array.from(country_code||"")
.map(c => 127397 + c.codePointAt()));
}
@duzun
duzun / T-cell & B-cell vs antibodies.md
Last active August 30, 2021 19:12
De ce nu trebuie să ne vaccinăm cu mRNA

Aflăm de persoane care au făcut ambele doze de vaccin, au dezvoltat titruri de mii de anticorpi, dar cu toate acestea au făcut forme grave sau chiar au decedat de Covid, la 1-2 luni după rapel... Dar de ce ne mirăm?!? Din păcate nu suntem toți imunologi. Și din păcate imunologii tac! Am avut zilele trecute niște cursuri la telefon cu un medic inițiat în acest domeniu. Mi-a explicat de-a fira păr... El dorește să rămână anonim, așa că nu îmi rămâne decât să fiu eu vocea lui.

👉 Asadar, dacă ai avut Covid și cineva te îndeamnă să te vaccinezi, nu știe ce vorbește. De ce?! Iată pe scurt mecanismele imunologice care se declanșează atunci când treci prin boală: În momentul în care virusul s-a fixat la nivelul mucoasei orotraheale, primul care apare este mecanismul imun imediat. Adică se activează celule locoregionale care încearcă să delimiteze și să anihileze virusul la acel nivel. În multe cazuri acest răspuns imun imediat reușește să-l anihileze, dovadă sunt formele asimptomatice sau cele ușoare de boală

#!/usr/bin/env node
/*jshint node: true, esversion: 10 */
/**
* Hide container filesystems in ~/.local/share/user-places.xbel
*
* @url https://gist.github.com/duzun/e583e1634ed6f6765dbaba0ac846e5cc
* @author Dumitru Uzun
* @version 0.0.1
*/
@duzun
duzun / mysqli__multi_query.php
Last active April 1, 2020 20:14
Run Multi Query using mysqli in PHP
if ($mysqli->multi_query("START TRANSACTION;$query--\nCOMMIT;")) {
$idx = 0;
$ret = 0;
if($output = $mysqli->error) {
echo $output, PHP_EOL;
die(-4);
}
else {
do {
@duzun
duzun / undetect-console.js
Created March 20, 2020 12:41
Try to make console undetectable (and broken)
console.log =
console.clear =
console.profile =
console.profileEnd =
eval = function(){};
@duzun
duzun / ca duzun_root_CA.crt
Last active August 26, 2024 22:28
Create a SSL certificate signed by your CA root certificate.
-----BEGIN CERTIFICATE-----
MIIEGTCCAwGgAwIBAgIUZyZoolDHKeOs73wadSEAe5AbuS8wDQYJKoZIhvcNAQEL
BQAwgYQxFjAUBgNVBAMMDXJvb3QuRFV6dW4uTWUxCzAJBgNVBAYTAlVTMRMwEQYD
VQQIDApDYWxpZm9ybmlhMRQwEgYDVQQHDAtMb3MgQW5nZWxlczERMA8GA1UECgwI
RFV6dW4uTWUxHzAdBgkqhkiG9w0BCQEWEGNvbnRhY3RAZHV6dW4ubWUwHhcNMjMw
OTA3MjMyODA1WhcNMzMwOTA3MjMyODA1WjCBhDEWMBQGA1UEAwwNcm9vdC5EVXp1
bi5NZTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFDASBgNVBAcM
C0xvcyBBbmdlbGVzMREwDwYDVQQKDAhEVXp1bi5NZTEfMB0GCSqGSIb3DQEJARYQ
Y29udGFjdEBkdXp1bi5tZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
AKOL2/MGGodYoyp2AUKhuwjDoQrDii4qZnwGZkx5AD/QajGLhhAKp1fwTmo43xED