Skip to content

Instantly share code, notes, and snippets.

View matthiasdebernardini's full-sized avatar
💭
building trident vault

Matthias Debernardini matthiasdebernardini

💭
building trident vault
  • USA
View GitHub Profile
@matthiasdebernardini
matthiasdebernardini / rocketguide.md
Created September 29, 2023 19:55 — forked from belst/rocketguide.md
Deploy Rocket in production

Deploy Rocket using Letsencrypt and nginx

Information

This guide uses the domain your-domain.tld and its www. prefixed version. It starts the rocket application on 127.0.0.1:1337 and as the user www-data. The proxy listens on port 80 and 443 though.
If you need other values, update them accordingly in your nginx and systemd configs.

Prerequisites

You need to have nginx, certbot and rust installed.

@matthiasdebernardini
matthiasdebernardini / Cargo.toml
Created March 27, 2023 21:20
files for devenv framework not found error
[package]
name = "testing_compiler_error"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sqlx = { version = "0.6", features = [ "runtime-tokio-native-tls" , "postgres" ] }
@matthiasdebernardini
matthiasdebernardini / flake.nix
Created March 23, 2023 23:57
python and rust dev shell
{
description = "Example Rust development environment for Zero to Nix";
# Flake inputs
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs"; # also valid: "nixpkgs"
rust-overlay.url = "github:oxalica/rust-overlay"; # A helper for Rust + Nix
};
# Flake outputs
@matthiasdebernardini
matthiasdebernardini / init.lua
Created January 13, 2023 19:43
starter nvim config with rust
-- Install packer
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
local is_bootstrap = false
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
is_bootstrap = true
vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }
vim.cmd [[packadd packer.nvim]]
end
require('packer').startup(function(use)
@matthiasdebernardini
matthiasdebernardini / comb.rs
Created October 16, 2022 22:25
get all possible combinations of size m in rust
fn comb<T>(slice: &[T], k: usize) -> Vec<Vec<T>>
where
T: Copy,
{
// If k == 1, return a vector containing a vector for each element of the slice.
if k == 1 {
return slice.iter().map(|x| vec![*x]).collect::<Vec<Vec<T>>>();
}
// If k is exactly the slice length, return the slice inside a vector.
if k == slice.len() {
@matthiasdebernardini
matthiasdebernardini / finalcheck.sh outupt
Last active August 25, 2022 18:52
final check linker cc nix issue
ubuntu@fedimintss:~/fedimint$ echo $IN_NIX_SHELL
impure
ubuntu@fedimintss:~/fedimint$ mv /home/ubuntu/.cargo/bin/cargo-clippy /usr/local/bin
mv: cannot move '/home/ubuntu/.cargo/bin/cargo-clippy' to '/usr/local/bin/cargo-clippy': Permission denied
ubuntu@fedimintss:~/fedimint$ sudo !!
sudo mv /home/ubuntu/.cargo/bin/cargo-clippy /usr/local/bin
ubuntu@fedimintss:~/fedimint$ echo $! >> $FM_PID_FILE^C
ubuntu@fedimintss:~/fedimint$ cargo clean
+ command cargo clean
ubuntu@fedimintss:~/fedimint$ cargo cleanc^C
@matthiasdebernardini
matthiasdebernardini / cargo output
Created August 25, 2022 18:18
final-checks.sh error output
ubuntu@fedimintss:~/fedimint$ cargo clean
+ command cargo clean
ubuntu@fedimintss:~/fedimint$ ./scripts/final-checks.sh
Compiling libc v0.2.127
Compiling autocfg v1.1.0
Compiling proc-macro2 v1.0.43
Compiling quote v1.0.21
Compiling unicode-ident v1.0.3
Compiling syn v1.0.99
Checking cfg-if v1.0.0
@matthiasdebernardini
matthiasdebernardini / cargo output
Created August 25, 2022 18:09
error from final-check.sh
ubuntu@fedimintss:~/fedimint$ ./scripts/final-checks.sh
Compiling libc v0.2.127
Compiling autocfg v1.1.0
Compiling proc-macro2 v1.0.43
Compiling quote v1.0.21
Compiling unicode-ident v1.0.3
Compiling syn v1.0.99
Checking cfg-if v1.0.0
Compiling memchr v2.5.0
Checking once_cell v1.13.0
@matthiasdebernardini
matthiasdebernardini / btcdev-coldstart.sh
Last active June 21, 2022 02:17
install bitcoin on ubuntu
#!/bin/bash
# DISCLAIMER: It is not a good idea to store large amounts of Bitcoin on a VPS,
# ideally you should use this as a watch-only wallet. This script is expiramental
# and has not been widely tested. The creators are not responsible for loss of
# funds. If you are not familiar with running a node or how Bitcoin works then we
# urge you to use this in testnet so that you can use it as a learning tool.
# This script installs the latest stable version of Tor, Bitcoin Core,
# Uncomplicated Firewall (UFW), debian updates, enables automatic updates for
@matthiasdebernardini
matthiasdebernardini / sampleREADME.md
Created September 14, 2020 16:07 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here