Skip to content

Instantly share code, notes, and snippets.

View FabianInostroza's full-sized avatar

FabianInostroza

View GitHub Profile
@adnbr
adnbr / simple-usart-commands.c
Last active September 22, 2022 07:01
Parsing simple USART commands on an AVR
/* Parsing simple USART commands
* -----------------------------
* For more information see
* http://www.adnbr.co.uk/articles/parsing-simple-usart-commands
*
* 996 bytes - ATmega168 - 16MHz
*/
#define F_CPU 16000000UL
#define BAUD 19200
@russdill
russdill / pnp.py
Created July 10, 2012 05:36
Pick and Place helper for gEDA PCB
#!/usr/bin/env python
#
# pnp.py
#
# Copyright (C) 2012 Russ Dill <Russ.Dill@asu.edu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
@mkotsbak
mkotsbak / connect_qmi.sh
Created August 4, 2012 01:02
Connects a modem like Sierra wireless MC7710 using QMI protocol on Debian/Ubuntu using NetCom in Norway
#!/bin/bash
#
# Requires the following line in /etc/network/interfaces:
# iface wwan0 inet dhcp
#
sudo /etc/init.d/network-manager stop
echo AT+CGDCONT=1,"IP","internet.netcom.no" > /dev/ttyUSB2
sudo modprobe qmi_wwan
@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() {
@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",
@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>
@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',
@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;
}
@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
@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: