Skip to content

Instantly share code, notes, and snippets.

View SakiiR's full-sized avatar
🎯
Focusing

SakiiR SakiiR

🎯
Focusing
View GitHub Profile
@SakiiR
SakiiR / challenge.c
Created April 29, 2017 10:53
Spanky challenge
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/mman.h>
#include <stdlib.h>
unsigned char buf[40960];
#define TARGET_FILE "/f1"
int main(int argc, char *argv[])
{
unsigned char *code = 0;
@SakiiR
SakiiR / aes.py
Created October 3, 2017 15:57
AES with python from stackoverflow
import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
class AESCipher(object):
def __init__(self, key):
self.bs = 32
self.key = hashlib.sha256(key.encode()).digest()
@SakiiR
SakiiR / parse_ls.py
Last active October 18, 2017 13:31
Parse la sortie d'un ls /s Windows.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
CODEC = "latin-1"
def process(lines):
current_dir = None
filepaths = []
@SakiiR
SakiiR / powerx.cpp
Created November 1, 2017 15:49
C++ Power
double powerx(1.0);
for (int i(0); i <= N; ++i) // ON VA SEPARER LA SOMME EN DEUX PUISQUE CELLE CI CONVERGE
{
if (i%2 != 0) {
cos_x -= powerx / factorielle(2*i); [URL]//SI[/URL] I EST IMPAIR ON SOUSTRAIT
}
else {
cos_x += powerx / factorielle(2*i); // SI I EST PAIR ON ADDITIONNE
}
@SakiiR
SakiiR / demo.md
Last active November 13, 2017 20:56
Démonstration DFA

Demo DFA BACK

Dépot Dev / Prod

  • Un dépot prévu pour le déploiement de toutes les applications (FRONT, DSL et BACK)
  • Fichier de configuration pour tout les dépots (config.py pour les dépots back)

Docker compose production

@SakiiR
SakiiR / mcarlo.c
Created February 13, 2018 09:05
Threads / Mutex -> Monte-Carlo
/**
* Monte Carlo - Threads exercise
*
* Compile with: gcc ./mcarlo.c -o mcarlo -lpthread -lm
*/
#include <unistd.h>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
@SakiiR
SakiiR / autorun.cc
Created August 31, 2018 19:55
Autorun Dayz
// ToggleRun.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
int main()
{
bool activated = true;
@SakiiR
SakiiR / pre-commit
Last active September 14, 2018 13:41
Pre Commit Git Hook - EsLint
#!/bin/bash
CURDIR=$(git rev-parse --show-toplevel)
ESLINT=$CURDIR/node_modules/.bin/eslint
ESLINTRC=$CURDIR/node_modules/eslint-config-airbnb/.eslintrc
STAGED_FILES=$(git diff --name-only | grep "\.js$")
if [[ $STAGED_FILES = "" ]]
then
echo "[PRE-HOOK] No files to lint:("
@SakiiR
SakiiR / firewall.sh
Last active September 28, 2018 10:01
Redirect all traffic from port to ip:port
#!/bin/sh
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -F
iptables -t nat -X
iptables -X
for PORT in 80 22 8080 ; do
@SakiiR
SakiiR / gist:49bb86a4a0b3408d60c3136a19c81d60
Created October 7, 2018 16:37
ESLINT/Prettier vscode config
{
"vim.useSystemClipboard": true,
"window.zoomLevel": 1,
"explorer.confirmDragAndDrop": false,
"javascript.updateImportsOnFileMove.enabled": "never",
"eslint.options": {
"configFile": ".eslintrc.js"
},
"editor.formatOnSave": true,
// Enable/disable default JavaScript formatter (For Prettier)