Skip to content

Instantly share code, notes, and snippets.

View HugoPoi's full-sized avatar

Hugo Poissonnet HugoPoi

View GitHub Profile
@HugoPoi
HugoPoi / oplog_estimate_per_collection.js
Created February 1, 2019 17:08
MongoDB get estimate oplog per collection with profiler
// https://docs.mongodb.com/manual/tutorial/manage-the-database-profiler/#enable-and-configure-database-profiling
(() => {
return db.system.profile.aggregate([
{ $match: { $or: [{op: {$in: ['update', 'insert', 'delete']}}, {'command.writeConcern': {$exists: true}}] } },
{ $group: {_id: {op : '$op', ns: '$ns', client: "$client"}, count: {$sum: 1}, start: {$min: "$ts"}, end: {$max: "$ts"} } },
{ $match: { count: { $gt: 50}}},
{ $sort: {count: -1} }
]).map((requestStats) => {
@HugoPoi
HugoPoi / liste_de_noel.md
Last active September 22, 2019 12:01
Liste de noël
@HugoPoi
HugoPoi / Install Mastodon-Twitter Crossposter on Docker.md
Last active April 5, 2020 21:25
Install Mastodon-Twitter Crossposter on Docker

Setup on Docker

Start the stuff

  1. docker-compose up -d --build

Setup the db

  1. docker exec mastodon-twitter-poster_web_1 bundle exec rake db:setup ^ this crash because it assume you have psql localy and direct connection
  2. cat db/structure.sql | docker exec -i mastodon-twitter-poster_db_1 psql --user postgres --db mastodon_twitter_poster_production

Other usefull command

@HugoPoi
HugoPoi / sources.list
Created February 4, 2022 12:06
Default sources list Bullseye
deb http://deb.debian.org/debian bullseye main
deb-src http://deb.debian.org/debian bullseye main
deb http://security.debian.org/debian-security bullseye-security main
deb-src http://security.debian.org/debian-security bullseye-security main
deb http://deb.debian.org/debian bullseye-updates main
deb-src http://deb.debian.org/debian bullseye-updates main
@HugoPoi
HugoPoi / Resize virtual machine partition.md
Last active October 3, 2023 06:55
How to resize virtual machine partition after extend the disk

Resize a VM system disk

Introduction

  • You have a VM with small disk
  • You have GPT partition table
  • You NOT USE LVM (you should)
  • You need to extend a partition on the main drive
  • You use Debian 8.x aka Jessie

Extend the disk