Skip to content

Instantly share code, notes, and snippets.

View paolobarbolini's full-sized avatar
🦀
Update dependecies and support IPv6

Paolo Barbolini paolobarbolini

🦀
Update dependecies and support IPv6
View GitHub Profile
@paolobarbolini
paolobarbolini / LobbyChatBot.java
Created September 30, 2016 18:10
Ecco cosa mi tocca fare per avere un bot che risponde automaticamente alla maggior parte delle domande sul mio server di minecraft (ip: play.craftworldmc.com)
public static void init() {
ChatProcessor.setChatBot(new LobbyChatBot());
}
private final static String[] CREATE_WORLD = new String[] {
"come creo un mondo",
"come creo un nuovo mondo",
"come creo il mondo",
"come faccio a creare un mondo",
"come faccio a creare un nuovo mondo",
@paolobarbolini
paolobarbolini / README.md
Last active February 3, 2017 21:00
Screencloud s3 upload

Screencloud s3 upload

Bash script to upload screenshots created with the screencloud.net client to an s3 bucket.

This script is specific to my configuration (s3 bucket with static website hosting and cloudflare with https enabled)

If you don't have static website hosting or you aren't using something like cloudflare to get https you may need to modify this script to make it work with your configuration.

Setup:

  1. Download the s3-upload.sh script, place it in a folder and give it permission to execute (chmod +x s3-upload.sh)
@paolobarbolini
paolobarbolini / paolo565.org.conf
Created September 7, 2017 18:52
Nginx configuration for www.paolo565.org
# WARNING: This is the nginx configuration i use for https://www.paolo565.org
# You may have to do some tweaking to make it work for you
# Take a look at this post if you want to know more about my configuration
# https://www.paolo565.org/blog/creating-my-blog/
# How i generate my certificate using certbot
# certbot certonly --webroot -w /var/www/ssl-challenge/ -d paolo565.org,www.paolo565.org --must-staple
# Things i put inside the http block
# server_tokens off;
@paolobarbolini
paolobarbolini / webcam.sh
Last active April 28, 2023 13:40
My Logitech C920 configuration via v4l2-ctl
# v4l2-ctl -d /dev/video2 --list-ctrls-menus
v4l2-ctl -d /dev/video2 --set-ctrl=sharpness=140
v4l2-ctl -d /dev/video2 --set-ctrl=focus_auto=0
v4l2-ctl -d /dev/video2 --set-ctrl=focus_absolute=10
v4l2-ctl -d /dev/video2 --set-ctrl=power_line_frequency=1
v4l2-ctl -d /dev/video2 --set-ctrl=exposure_auto=1
v4l2-ctl -d /dev/video2 --set-ctrl=exposure_absolute=550
v4l2-ctl -d /dev/video2 --set-ctrl=contrast=130
v4l2-ctl -d /dev/video2 --set-ctrl=saturation=120
v4l2-ctl -d /dev/video2 --set-ctrl=white_balance_temperature_auto=0
@paolobarbolini
paolobarbolini / crates.sh
Last active May 14, 2022 06:30
An experiment at an idea of checking crates.io releases against the files on the corresponding git revision
#!/bin/bash
# An experiment at an idea of checking crates.io releases against the files
# on the corresponding git revision (and in the future maybe even complaining
# if there's no tag associated to it, or giving you a diff since the last release IDK)
#
# Depends on curl, jq, tar and diff
#
# I'm not very good at bash, so you'll have to excuse the mess :)
# Still very useless, as it doesn't handle workspaces
@paolobarbolini
paolobarbolini / explain.txt
Last active August 2, 2023 05:52
crates.io `serde` reverse dependencies query EXPLAIN ANALYZE output
Limit (cost=513870.08..534308.54 rows=10 width=99) (actual time=10808.569..12615.884 rows=10 loops=1)
-> Unique (cost=513870.08..3444730.43 rows=1434 width=99) (actual time=10808.566..12615.851 rows=10 loops=1)
-> Nested Loop (cost=513870.08..3444723.26 rows=1434 width=99) (actual time=10808.562..12615.801 rows=13 loops=1)
Join Filter: (versions.crate_id = crates.id)
Rows Removed by Join Filter: 887880
-> Index Scan using idx3 on crates (cost=0.42..54507.51 rows=121264 width=20) (actual time=0.031..0.344 rows=31 loops=1)
-> Materialize (cost=513869.66..781830.70 rows=1434 width=83) (actual time=261.982..373.001 rows=28642 loops=31)
-> Nested Loop (cost=513869.66..781823.53 rows=1434 width=83) (actual time=8121.412..10487.713 rows=29474 loops=1)
-> Subquery Scan on versions (cost=513869.23..740005.96 rows=4002 width=8) (actual time=8121.369..10121.764 rows=29753 loops=1)
@paolobarbolini
paolobarbolini / README.md
Last active August 25, 2023 02:42
Top crates by crates.io reverse dependencies count

Top crates by crates.io reverse dependencies count

As of the database dump from 2023-08-12-020056.

File on GitHub Gist truncated to 2000 to make file rendering smoother.

Exported with query
CREATE MATERIALIZED VIEW all_versions AS (
@paolobarbolini
paolobarbolini / .gitlab-ci.yml
Created November 12, 2023 17:27
Gitlab CI example for MultiArch images
image: docker:latest
variables:
DOCKER_BUILDKIT: 1
services:
- docker:dind
build:
before_script:
@paolobarbolini
paolobarbolini / crates.csv
Last active April 7, 2024 09:25
Notes taken while analyzing the crates.io scraping results for the top 5000 crates by recent downloads
crate notes
inflections Unmaintaned. No apparent repository. May be replaced by heck
str_inflector Same as inflections
convert_case Passively maintained. May be replaced by heck
simple-mutex Repository apparently deleted
varint-rs Repository apparently deleted
json-pointer Broken repository link. Found repository https://github.com/remexre/json-pointer but it doesn't contain the latest releases
osmesa-sys Repository apparently deleted
repng Repository apparently deleted
retain_mut Deprecated - The API is now available in the std
@paolobarbolini
paolobarbolini / repos.txt
Created March 31, 2024 15:28
Repositories from the top 5k crates by recent downloads (some may be missing)
https://bitbucket.org/marshallpierce/line-wrap-rs/src
https://codeberg.org/jssfr/rxml
https://codeberg.org/valpackett/devd-rs
https://codeberg.org/xfix/array-macro
https://codeberg.org/xfix/enum-map
https://fuchsia.googlesource.com/garnet/
https://github.com/01mf02/hifijson.git
https://github.com/06chaynes/http-cache.git
https://github.com/10xGenomics/lz4-rs.git
https://github.com/1aim/rust-regex-cache.git