Skip to content

Instantly share code, notes, and snippets.

View Dzordzu's full-sized avatar
🐢
I may be slow to respond.

Tomasz Durda Dzordzu

🐢
I may be slow to respond.
  • Wrocław University of Science and Technology
View GitHub Profile
@Nemo157
Nemo157 / _Publishing crates to IPFS.md
Last active March 26, 2024 20:46
Publishing crates to IPFS

Publishing crates to IPFS

This was an experiment in seeing how feasible it would be to distribute crates on IPFS using the alternative registries feature combined with a local IPFS web gateway.

There was very little plan for this originally, and I wish I had kept more of the intermediate states as I went through multiple major design changes. My original goal was to publish my CLI utility [bs58-cli][] and its dependency tree.

@languitar
languitar / PKGBUILD
Created December 23, 2019 13:29
Archlinux PKGBUILD for mopidy-spotify updated for mopidy 3
# Maintainer: Alexandre Petitjean <alpetitjean at gmail dot com>
pkgname=mopidy-spotify
pkgver=4.0.0
pkgrel=1
pkgdesc="Mopidy extension for playing music from Spotify"
arch=('any')
url="http://www.mopidy.com"
license=('APACHE')
depends=(
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active October 14, 2024 11:22
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@Leny1996
Leny1996 / sredniaWazonaPwr.js
Last active August 30, 2019 19:09 — forked from zablotski/sredniaWazonaPwr.js
Skrypt obliczjący średnią ważoną w systemie https://jsos.pwr.edu.pl. Skrypt automatycznie usuwa wpisy z oceną 2.0. Aby obliczyć należy wcisnąć F12 w przeglądarce, otworzyć wkładkę Console i wstawić skrypt. Następnie wcisnąć Enter.
$('td:contains("2.0")').parent().remove(); //usunięcie wpisów z oceną 2
$('td:contains("k.cz.")').parent().remove(); //usunięcie wpisów z ocen cząstkowych
$('td:contains("---")').parent().remove(); //usunięcie wpisów bez ocen
var sum=0; //suma ECTS
var mulSum=0; // suma ECTS * ocena
$('td[title="ocena"]').each(function(){
mulSum += parseFloat($(this).text()) * parseFloat($(this).next().next().text());
sum += parseFloat($(this).next().next().text());
console.log(parseFloat($(this).text()), parseFloat($(this).next().next().text()));
});
@samoshkin
samoshkin / toggle_keybindings.tmux.conf
Last active November 12, 2024 11:21
tmux.conf excerpt to toggle on/off session keybindings and prefix handling
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
@BretFisher
BretFisher / docker-swarm-ports.md
Last active August 12, 2024 16:10
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

@kn9ts
kn9ts / GPLv3.md
Last active November 6, 2024 08:39
GPLv3 explained

GPL3 LICENSE SYNOPSIS

TL;DR* Here's what the license entails:

1. Anyone can copy, modify and distribute this software.
2. You have to include the license and copyright notice with each and every distribution.
3. You can use this software privately.
4. You can use this software for commercial purposes.
5. If you dare build your business solely from this code, you risk open-sourcing the whole code base.
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@SmartFinn
SmartFinn / dhcp-leases-to-dns.rsc
Last active October 17, 2024 06:14
MikroTik (RouterOS) script for automatically setting DNS records for clients when they obtain a DHCP lease
# MikroTik (RouterOS) script for automatically setting DNS records
# for clients when they obtain a DHCP lease.
#
# author SmartFinn <https://gist.github.com/SmartFinn>
:local dnsTTL "00:15:00";
:local token "$leaseServerName-$leaseActMAC";
# Normalize hostname (e.g. "-= My Phone =-" -> "My-Phone")
# - truncate length to 63 chars
@imneme
imneme / randutils.hpp
Last active September 25, 2024 13:41
Addresses common issues with C++11 random number generation; makes good seeding easier, and makes using RNGs easy while retaining all the power.
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Melissa E. O'Neill
*