Skip to content

Instantly share code, notes, and snippets.

View penso's full-sized avatar

Fabien Penso penso

View GitHub Profile
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@dhh
dhh / linux-setup.sh
Last active May 7, 2024 20:14
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@X1ting
X1ting / telegram_check_auth.rb
Created February 26, 2023 23:49
Check telegram auth token
data = {
auth_date: DATE,
first_name: "NAME",
hash: "HASH",
id: ID,
last_name: "SURNAME",
photo_url: "PHOTO",
username: "USERNAME"
}
@MilesTEG1
MilesTEG1 / volume_sur_ssd_mvne_dans_NAS_Synology.md
Last active January 4, 2024 08:27
Utiliser un SSD MVNe dans un NAS Synology en tant que volume et pas en tant que cache

Utiliser un SSD MVNe dans un NAS Synology en tant que volume et pas en tant que cache

Objectif final :
Déplacer le dossier docker, et le paquet Docker sur le volume SSD NVMe pour gagner en fluidité. Voir §-III. à la fin de ce GIST.

Note :
Les commandes suivantes sont pour la plupart à lancer en root dans un terminal, pensez à faire un : sudo -i


@shqld
shqld / cargo_x86_64-unknown-linux-gnu-on-m1-mac.sh
Created March 15, 2022 14:19
cargo build for the target x86_64-unknown-linux-gnu on M1 Mac
# https://github.com/messense/homebrew-macos-cross-toolchains
brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-gnu
export CC_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-gcc
export CXX_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-g++
export AR_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-ar
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc
@fxn
fxn / 01 main.rs
Last active August 23, 2021 15:13
Mandelbrot set generator from "Programming Rust", with ports to Crystal and Ruby.
// Mandelbrot set generator from "Programming Rust", with I/O removed (the
// original code writes a PNG file).
use std::env;
use std::str::FromStr;
use num::Complex;
fn main() {
let args: Vec<String> = env::args().collect();
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@chrisdiana
chrisdiana / mosh-macos.md
Last active April 29, 2024 05:50
Getting mosh server running on macOS Catalina

Running into this error message when trying to run a mosh server on macOS Catalina? The steps below should solve the problem which is most likely either a $PATH and/or firewall issues.

command not found: mosh-server
Connection to X.X.X.X closed.
/usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

1. Install Mosh

@rtyler
rtyler / 0.log
Created June 6, 2020 22:01
Playing around with syntax sugar around handling websocket messages
INFO otto_eventbus > Listening for WebSocket connections on 127.0.0.1:9311
DEBUG tungstenite::handshake::server > Server handshake done.
DEBUG otto_eventbus > Received: Ok(Text("{\"type\":\"ping\", \"value\" : {\"msg\":\"hi\"}}"))
INFO otto_eventbus > deser: Meow { ttype: "ping", value: Object({"msg": String("hi")}) }
DEBUG otto_eventbus > Handling: Ping { msg: "hi" }
DEBUG otto_eventbus > Received: Ok(Text("{\"type\":\"hello\",\"value\": null}"))
INFO otto_eventbus > deser: Meow { ttype: "hello", value: Null }
DEBUG otto_eventbus > Handling hello: Hello