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 / init.vim
Last active November 24, 2019 12:02 — forked from benawad/init.vim
droplet neovim installation with coc from ben awad
" Left Blank as-per linode tutorial
call plug#begin()
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@matthiasdebernardini
matthiasdebernardini / dotstrapper.sh
Last active November 28, 2021 21:40
ubuntu config
#!bin/bash
set -x
# git clone --bare https://github.com/matthiasdebernardini/dots $HOME/.dots
# cp .bashrc .bashrc_backup
# rm .bashrc
# /usr/bin/git --git-dir=$HOME/.dots/ --work-tree=$HOME checkout
@matthiasdebernardini
matthiasdebernardini / tmux.md
Created September 13, 2020 12:52 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@matthiasdebernardini
matthiasdebernardini / tmux-cheatsheet.markdown
Created September 13, 2020 12:54 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@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

@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 / 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 / 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 / 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 / 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() {