Skip to content

Instantly share code, notes, and snippets.

View Vinetos's full-sized avatar
⌨️
I don't code... I think ?

Valentin Vinetos

⌨️
I don't code... I think ?
View GitHub Profile
# 0. ON WINDOWS :
# On windows, to check which WSL you use, type ` wsl --list --verbose ` in admin cmd.
# If you are not in WSL2, reinstall the machine with WSL2 : https://docs.microsoft.com/fr-fr/windows/wsl/install-win10
# 1. Make sure you are running with systemd
# sudo systemctl must not say "Failed to connect to bus"
# If so, I recommand you to reinstall the VM. You can try this repo too : https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
# 2. On WSL2 machine
# /!\ Create an user with A PASSWORD and with sudo access
@Vinetos
Vinetos / tp2.py
Last active November 27, 2023 14:22
custom_lock = "SELECT pg_advisory_xact_lock(%s);"
def lock(conn, lock_key):
cur = conn.cursor()
try:
# Acquire the custom lock outside of the transaction
cur.execute(custom_lock, (lock_key,))
conn.commit()
except Exception as e:
# Handle exceptions
package fr.vinetos.util.scoreboard;
import fr.krilouja.game.team.Team;
import net.minecraft.server.v1_8_R3.IScoreboardCriteria;
import net.minecraft.server.v1_8_R3.PacketPlayOutScoreboardScore;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;
import java.util.Collections;
@Vinetos
Vinetos / install.sh
Created September 27, 2022 15:12
Install Gitlab EE on Ubuntu 22.04
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.mineofwar.com" apt-get install gitlab-ee
@Vinetos
Vinetos / jupyter.nix
Last active December 17, 2021 10:30
Jupyer NoteBook on NixOS with Numpy and matplotlib
with import <nixpkgs> {};
mkShell {
buildInputs = [
# Defines a python + set of packages.
(python3.withPackages (ps: with ps; with python3Packages; [
jupyter
ipython
# Uncomment the following lines to make them available in the shell.
cmake_minimum_required(VERSION 3.19)
project(malloc C)
set(CMAKE_C_STANDARD 99)
add_executable(malloc src/malloc.c src/struct.c src/struct.h)
# default.nix
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "dev-environment"; # Probably put a more meaningful name here
buildInputs = [
pkg-config
clion
criterion
];
}
@Vinetos
Vinetos / Scoreboard_v1_7_R4.java
Last active July 12, 2021 02:42
An scoreboard api using nms | 1.8.X/1.9.X/1.10.X/1.11.X : https://gist.github.com/Vinetos/69b875e90af55634b3e0591dea59dec4
package fr.vinetos.util.scoreboard;
import fr.vinetos.util.Reflection;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;
import java.util.Collections;
import java.util.UUID;
,%. ,.
.%%%%%, , /////.
.#%%%%%%%%* /(/// (////////,
##%##########///(////((((/(((((((((,
(#################////((((((((((((((((((*
/#####################(((((((((((((((((((((((,
* (##, .((####% .(( /((((/,((*
,#((# //(((((#, #(. %##% .##(((/ ((((###(( ,((*
.(((((((( ((((((((, ((##. %%% .###### ######## ,##*
.(((((((((((( (((. ####, %%% .###### ######( ./ *###(.
@Vinetos
Vinetos / install.sh
Last active November 7, 2020 13:32
Install OASIS for AFIT at EPITA
# First, Install opam as described here : https://opam.ocaml.org/doc/Install.html
# Run in the directory for caml you downloaded
opam init
eval $(opam env)
# Switch changement (if asking or not up to date)
# opam update
# opamn switch create ocaml-base-compiler
opam install oasis