Skip to content

Instantly share code, notes, and snippets.

View ildyria's full-sized avatar

Benoît Viguier ildyria

View GitHub Profile
{
"openapi": "3.1.0",
"info": {
"title": "Lychee",
"version": "0.0.1"
},
"servers": [
{
"url": "https:\/\/lychee.test\/api"
}
#!/usr/bin/env python3
def load_words():
with open('words_alpha.txt') as word_file:
valid_words = word_file.read().split()
return valid_words
def contains(a:list, b:list):
# print(a)
NO_COLOR="\033[0m"
RED = "\033[38;5;009m"
GREEN = "\033[38;5;010m"
YELLOW = "\033[38;5;011m"
ORANGE = "\033[38;5;214m"
LIGHTPURPLE = "\033[38;5;177m"
PURPLE = "\033[38;5;135m"
CYAN = "\033[38;5;014m"
LIGHTGRAY = "\033[38;5;252m"
DARKGRAY = "\033[38;5;242m"
#!/bin/bash
#
# optpdf file.pdf
# This script will attempt to optimize the given pdf
file="$1"
filebase="$(basename "$file" .pdf)"
optfile="/tmp/$$-${filebase}_opt.pdf"
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile="${optfile}" "${file}"
# -dPDFSETTINGS=/screen (screen-view-only quality, 72 dpi images)
# /bin/sh
echo "
list of commands that you might want to know
git add -A : add all files
git add --all : add all files
git add -u : update modified files
git commit -m <msg> : commit some changes with <msg>
git commit -am <msg> : git add -u + git commit -m
find . -name "*.v" -type f -print0 | xargs -0 sed -i 's/[[:space:]]*$//'
@ildyria
ildyria / details.md
Created January 4, 2018 16:43
Problem with operations between Int and Long on VST.

Compilation

The test.c file can be compiled as follow:

gcc test.c -Wall -Wextra -o test  

or with Compcert (2.7.2)

ccomp test.c -o test
@ildyria
ildyria / simpl.v
Last active November 2, 2017 15:53
initialization of arrays is not convenient.
Require Import VST.floyd.proofauto.
(*
#define FOR(i,n) for (i = 0;i < n;++i)
#define sv static void
typedef long long _Alignas(8) i64;
typedef i64 gf[16];
sv set(gf r, const gf a)
@ildyria
ildyria / Free-start-keccak.py
Created June 14, 2017 13:51
Useless free start collision on SHA-3-256
import binascii
def ROL64(a, n):
return ((a >> (64-(n%64))) + (a << (n%64))) % (1 << 64)
def KeccakF1600onLanes(lanes):
R = 1
for round in range(24):
# θ
C = [lanes[x][0] ^ lanes[x][1] ^ lanes[x][2] ^ lanes[x][3] ^ lanes[x][4] for x in range(5)]
@ildyria
ildyria / iptables.sh
Created May 2, 2017 10:35
iptable config in /etc/init.d
#!/bin/bash
# ---------------------------------------------------------------------
# Linux iptables init script, Copyright (c) 2013 GPL
# --------------------------------------------------------------------
### BEGIN INIT INFO
# Provides: firewall
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6