Skip to content

Instantly share code, notes, and snippets.

@olivierlemoal
olivierlemoal / idadif.py
Last active February 16, 2016 10:54
Small IDA .dif patcher with PEP 8 improvment. Original Source: https://stalkr.net/files/ida/idadif.py
#!/usr/bin/env python
# Small IDA .dif patcher
import re
from sys import argv, exit
def patch(file, dif, revert=False):
code = open(file, 'rb').read()
dif = open(dif, 'r').read()
m = re.findall('([0-9a-fA-F]+): ([0-9a-fA-F]+) ([0-9a-fA-F]+)', dif)

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@olivierlemoal
olivierlemoal / boursorama2ynab.py
Last active November 16, 2015 20:46
Convert Boursorama csv export -> YNAB csv
#! /usr/bin/env python3
import sys
import csv
from collections import defaultdict
def parse_input(inputFile):
lines = defaultdict(list)
with open(inputFile, newline='', encoding='iso8859-15') as csvfile:
inputReader = csv.reader(csvfile, delimiter=';', quotechar='"')
@olivierlemoal
olivierlemoal / apparmor_quickstart.sh
Last active November 14, 2015 11:48
AppArmor quick start
# Gen empty profile :
aa-autodep /usr/sbin/squid3
# Set complain mode
aa-complain /usr/sbin/squid3
# Start
sudo /etc/init.d/squid3 start
# Fill it after a while :
aa-logprof /usr/sbin/squid3
# Set enforce mode
aa-enforce /usr/sbin/squid3
@olivierlemoal
olivierlemoal / pipe_reader.sh
Last active April 14, 2020 17:10
Pipe reader
#!/bin/bash
# Quick n dirty pipe reader
pipe=/tmp/p
trap "rm -f $pipe" EXIT
if [[ ! -p $pipe ]]; then
mkfifo $pipe
fi
@olivierlemoal
olivierlemoal / .tmux.conf
Last active May 17, 2017 17:35
tmux config
# Use zsh
set-option -g default-shell /bin/zsh
# Highlight active window
setw -g window-status-current-bg blue
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
/* findeggaddr.c */
#include <stdio.h>
int main(void)
{
printf("EGG address: 0x%lx\n", getenv("EGG"));
return 0;
}
@olivierlemoal
olivierlemoal / gist:fc8834972c1a25d75461
Created September 5, 2015 16:19
patch savegame Neko Atsume
# Sardine
printf '\xd9' | dd conv=notrunc of=/data/data/jp.co.hit_point.nekoatsume/files/savedata_system.sav bs=1 seek=$((0x0000017))
# Gold sardine
printf '\xd9' | dd conv=notrunc of=/data/data/jp.co.hit_point.nekoatsume/files/savedata_system.sav bs=1 seek=$((0x000001B))
@olivierlemoal
olivierlemoal / config.base
Last active January 28, 2024 18:04
i3 config for bépo
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
section .text
global _start
_start:
call obfuscate
str1:
msg db 'Hello World!',0xa
len equ $ - msg