Skip to content

Instantly share code, notes, and snippets.

View FabianInostroza's full-sized avatar

FabianInostroza

View GitHub Profile
@mysiar
mysiar / garmin-iq-sdk-ubuntu-18.04.md
Last active March 26, 2022 11:11
Garmin IQ SDK on Ubuntu 18.04
@tpai
tpai / solution.md
Last active February 24, 2023 06:03
facebook plugin init error: init not called with valid version

Solution

js.src = "//connect.facebook.net/zh_TW/all.js";

instead of

js.src = "//connect.facebook.net/zh_TW/sdk.js";

Causing

@egirault
egirault / Syscan2015Badge.md
Last active February 17, 2024 15:02
Dumping the flash memory of the Syscan 2015 badge

Dumping the flash of the Syscan 2015 badge

The badge of the Syscan 2015 conference included an ARM-based STM32F030R8 processor running some challenges. Although SWD pins are accessible on the badge, some have noted that the STM32 is readout-protected, meaning that it will refuse to dump its flash memory.

Fortunately, two researchers (Johannes Obermaier and Stefan Tatschner) recently published a paper at the WOOT '17 conference, in which they reveal a vulnerability allowing to bypass the readout protection. Their technique allows to dump the flash one DWORD at a time, rebooting the CPU between each access.

I implemented this attack using a BusPirate and the PySWD module. Here is a quick'n dirty PoC to

@JPvRiel
JPvRiel / journalctl_enable_persistent_storage.md
Last active June 20, 2024 09:29
Enable persistent storage for the systemd journal log

Enable persistent storage for the systemd journal log

Overview

The assumed default setting in /etc/systemd/journald.conf is Storage=auto which implies that systemd journaling will only persist the journal if the expected storage location is available. Otherwise, the journal data is stored in memory and lost between reboots. On Ubuntu 16.04, /var/log/journal does not exist by default. Create it to keep and query events from previous boots.

Considerations:

  • Syslog still provides the persistant log records for Ubuntu 16.04, so enabling persistant systemd journal logging does cause a level of duplicaiton.
  • There are sane defaults:
@pwuertz
pwuertz / kicad_picknplace_assistant.py
Last active November 27, 2023 07:04
KiCad PCB pick and place assistant
Moved to:
https://github.com/pwuertz/kicad_picknplace_assistant
@umpirsky
umpirsky / userContent.css
Last active November 2, 2023 17:19
Firefox dark theme workaround (https://bugzilla.mozilla.org/show_bug.cgi?id=519763) Inspired by https://wiki.archlinux.org/index.php/Firefox#Unreadable_input_fields_with_dark_GTK.2B_themes. Add it to ~/.mozilla/firefox/xxxxxxxx.default/chrome/userContent.css or using https://addons.mozilla.org/en-US/firefox/addon/stylish/ add-on. add-on.
input:not(.tactile-searchbox-input):not(.urlbar-input):not(.textbox-input):not(.form-control):not([type='checkbox']) {
-moz-appearance: none !important;
background-color: white;
color: black;
}
#downloads-indicator-counter {
color: white;
}
@yrps
yrps / clean_ru.py
Created December 31, 2015 05:34
remove non-existent files from user's recently-used.xbel (XFCE4)
#!/usr/bin/env python3
def parseArgs():
from sys import stderr
import argparse
from os.path import expanduser, isfile
parser = argparse.ArgumentParser()
parser.add_argument(
'-f', '--file', help='file to be cleaned',
@lethean
lethean / ethcom.c
Created February 10, 2015 03:33
Send / Receive raw Ethernet frames with custom EtherType in Linux
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
vim: set autoindent expandtab shiftwidth=2 softtabstop=2 tabstop=2: */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/types.h>
#include <sys/socket.h>
@CamDavidsonPilon
CamDavidsonPilon / 538.json
Last active November 28, 2021 07:37
Use the two files below to mimic graphs on 538. www.dataorigami.net/blogs/fivethirtyeight-mpl
{
"lines.linewidth": 2.0,
"examples.download": true,
"patch.linewidth": 0.5,
"legend.fancybox": true,
"axes.color_cycle": [
"#30a2da",
"#fc4f30",
"#e5ae38",
"#6d904f",
@nraynaud
nraynaud / tim4.c
Last active December 24, 2019 14:51
Connect a rotary encoder to STM32F4. Needs time base initialization on TIM4 but not on TIM8, no idea why
#include "stm32f4_discovery.h"
#include "arm_math.h"
/*
- TIM4_CH1 pin (PB.06)
- TIM4_CH2 pin (PB.07)
*/
void configureEncoder() {