Skip to content

Instantly share code, notes, and snippets.

View trupples's full-sized avatar
🚀
filtering kalmans

Ioan Dragomir trupples

🚀
filtering kalmans
View GitHub Profile
@trupples
trupples / beam.py
Last active November 15, 2015 23:04 — forked from anonymous/beam.py
Beam.py - An utility script I use to send files wirelessly from my pc to my mobile phone via HTTP while I'm developing stuff
#!/usr/bin/env python
from sys import argv
from time import sleep
import socket
############## COMMAND-LINE ARGUMENTS #################
# Check if there is a correct number of arguments
import discord
import sys
from subprocess import Popen, PIPE, TimeoutExpired
import time
lastTime = time.clock()
active = True
myName = ""
myId = ""
" Basic stuff
syntax on
set number
set encoding=utf-8
" TABS
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
@trupples
trupples / Makefile
Last active April 2, 2016 10:56
My i3bar timer setup
copy: ldtimer
cp ./ldtimer ~/.i3/ldtimer
ldtimer: ldtimer.cpp
gcc -Wall -O2 ldtimer.cpp -o ldtimer
#include<iostream> // IO
using namespace std;
/*!
*
* Radix-sort
* ===
*
*/
<html><body><script>/*
* Acesta este un editor de JavaScript.
*
* Introduceți niște cod JavaScript, apoi clic dreapta sau alegeți din meniul Executare:
* 1. Rulează pentru a evalua textul selectat (Ctrl+R),
* 2. Inspectează pentru a deschide inspectorul de obiect pe rezultat (Ctrl+I), sau
* 3. Afișează pentru a insera rezultatul într-un comentariu după selecție. (Ctrl+L)
*/
clearInterval(interval);
<html>
<head>
<script>
var db = {
citizens:
[
{
phoneNumber:"40749254162",
lastName:"Bootan",
firstName:"Lee View",

Studiu structura tablourilor de tip bool

Atat la concursuri si olimpiade cat si in aplicatii practice, de multe ori se intalneste problema eficientei spatiului, cel mai grav caz al acesteia fiind stocarea unui tablou care contine valori de tip bool. Toate seturile de instructiuni moderne (x86, x64, ARM) pot adresa memorie doar la nivel de octet. Din aceasta cauza, aplicatii care necesita granularitate mai mare pentru elemente ce nu necesita ocuparea unui intreg octet trebuie ori sa sacrifice timp de executie pentru a combina mai multe elemente intr-un singur octet, ori sa sacrifice memorie, punand un singur element per octet si ignorand spatiul ramas neutilizat.

Exista un zvon ca tablourile din C sunt optimizate automat de compilator pe sisteme Linux in cadrul Olimpiadei de Informatica.

Deoarece mediul incurajat in cadrul Olimpiadei este Code::Blocks cu compilatoarele gcc/g++ MinGW, e natural ca si comisia de evaluare sa foloseasca aceleasi compilatoare pe Windows si variantele lor de linux pentru eva

@trupples
trupples / _breakingin-1.md
Last active June 9, 2023 00:07
https://youtu.be/yEbAQXDKRKY | breakingin - reverse engineering a custom VM - WPICTF 2019 | python scripts

breakingin 1

Reverse engineering a custom VM architecture

This gist contains all the scripts written in the first video of the series.

  • breakingin-add.py sends the first program we wrote: a simple addition.
  • breakingin-good-bf.py implements the more efficient opcode search.
  • breakingin-syscall-search.py tries all syscall numbers.
  • breakingin-write.py demonstrates syscall call convention with the write (1) syscall.
@trupples
trupples / _breakingin-1.5.md
Last active April 22, 2019 08:20
https://youtu.be/zcbIycJ5q1E | breakingin - automating program assembly - WPICTF 2019

breakingin 1.5

Automating assembly with FASM macros

This gist contains all the scripts written in the intermediary mini-video of the series.

  • macros.inc contains all the macros.
  • breakingin-add-2.fasm is the add program we wrote to test this workflow works.
  • assemble.py contains both the assemble function as well as a test program.