Skip to content

Instantly share code, notes, and snippets.

View kinoute's full-sized avatar
🐉
playing with Ghidra

Yann Defretin kinoute

🐉
playing with Ghidra
View GitHub Profile
@kinoute
kinoute / scrap-amazon-reviews.py
Last active September 16, 2019 20:51
Scrap reviews on Amazon.fr (only) with Python, Pandas & BeautifulSoup.
import requests
from bs4 import BeautifulSoup
import time
import pandas as pd
import random
from urllib.parse import urlsplit
headers = requests.utils.default_headers()
headers.update(
#/bin/bash
shopt -s nullglob
downloadFromFile(){
while read -r URL <&3; do
wget --content-disposition $(echo $URL | tr -d '\r') -P "$1/"
done 3<"$2"
}
@kinoute
kinoute / git-add-commit-push.sh
Last active July 22, 2019 19:57
Git add, commit, and push, in a single unix alias command.
function acp() {
git add .
git commit -m "$*"
git push origin master
}
@kinoute
kinoute / push-to-github-gitlab.sh
Last active August 16, 2019 19:30
Push to remote Github and Gitlab at the same time
# https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-urlem
git remote set-url --add --push origin git@github.com:Foo/bar.git
git remote set-url --add --push origin git@gitlab.com:Foo/bar.git
@kinoute
kinoute / get-md-images.sh
Last active June 11, 2023 11:33
Download remote images from markdown/jupyter notebooks files and update paths from remote to local.
#!/bin/bash
###################################################################
# Script Name : get-md-images.sh
# Description : Download all remote images written as markdown
# in our files and replace URLs by local path.
# Author : Yann Defretin
# Email : yann@defret.in
###################################################################
import requests
from bs4 import BeautifulSoup
import time
import pandas as pd
import random
from urllib.parse import urlsplit
stories_cols = ['title', 'story']
csv_stories = pd.DataFrame(columns=stories_cols)
@kinoute
kinoute / .Dockerfile
Last active March 28, 2024 04:44
Example of Ruby on Rails 6 Multi-stage builds with Docker. Development/production environments share the same Dockerfile.
FROM ruby:2.7.1-slim AS base
LABEL maintainer="Yann Defretin <yann@defret.in"
# Common dependencies
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \
--no-install-recommends \
build-essential=12.6 \
gnupg2=2.2.12-1+deb10u1 \
# EditorConfig is awesome: http://EditorConfig.org
# https://github.com/jokeyrhyme/standard-editorconfig
# top-most EditorConfig file
root = true
# defaults
[*]
charset = utf-8
@kinoute
kinoute / substitution.c
Last active June 11, 2020 15:44
Harvard CS50 substitution
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc, string argv[])
{
// the user must provide one and only argument
if (argc != 2)
{
@kinoute
kinoute / plurality.c
Created June 9, 2020 12:42
Harvard CS50 Plurality
#include <cs50.h>
#include <stdio.h>
#include <string.h>
// Max number of candidates
#define MAX 9
// Candidates have name and vote count
typedef struct
{