Skip to content

Instantly share code, notes, and snippets.

View tormath1's full-sized avatar

Mathieu Tortuyaux tormath1

View GitHub Profile
@tormath1
tormath1 / main.py
Created October 21, 2020 07:39
simple tkinter frame with inheritance
import tkinter
class Test(tkinter.Frame):
def __init__(self, parent):
tkinter.Frame.__init__(self, parent)
# create entry class attribute
self.entry = tkinter.Entry(self)
self.entry.grid(row=0, column=1)
@tormath1
tormath1 / otp.py
Created June 10, 2020 08:55
OTP - Encryt / Decrypt example
import sys
import string
import random
# return a key of the size
# of the PT
def generate_key(length):
r = lambda: \
string.ascii_letters[int(random.random() * len(string.ascii_letters))]
key = b''
@tormath1
tormath1 / connect.sh
Created June 3, 2020 18:18
IpV6 - socket connect - assembly 64bits
$ cat > connect.asm << EOF
SECTION .text
global _start
_start:
xor rax, rax ; init 0
xor rdx, rdx ; init 0
xor rsi, rsi ; init 0
@tormath1
tormath1 / validate.log
Created August 6, 2019 12:19
packer validate build.json
PACKER_LOG=1 packer validate build.json
2019/08/06 14:17:59 [INFO] Packer version: 1.4.2
2019/08/06 14:17:59 Packer Target OS/Arch: linux amd64
2019/08/06 14:17:59 Built with Go Version: go1.12.7
2019/08/06 14:17:59 Detected home directory from env var: /home/mathieu
2019/08/06 14:17:59 Using internal plugin for amazon-chroot
2019/08/06 14:17:59 Using internal plugin for azure-arm
2019/08/06 14:17:59 Using internal plugin for alicloud-ecs
2019/08/06 14:17:59 Using internal plugin for lxc
2019/08/06 14:17:59 Using internal plugin for parallels-iso
#!/usr/bin/python
import requests
def get_quote():
return requests.get("https://breaking-bad-quotes.herokuapp.com/v1/quotes").json()[0]
def format_quote(q):
author = q.get("author")
quote = q.get("quote")
return f"'{quote}' - {author}"
@tormath1
tormath1 / script.sh
Created December 10, 2018 13:21
automagically update your archlinux
# /etc/systemd/system/update.timer
[Unit]
Description=Perform a full upgrade once a week (at 12:00pm on Monday)
[Timer]
OnCalendar=Mon *-*-* 12:00:00
Persistent=true
[Install]
WantedBy=timers.target