Skip to content

Instantly share code, notes, and snippets.

View ektor5's full-sized avatar

Ettore Chimenti ektor5

View GitHub Profile
#!/bin/sed
# replace smb_word_op macros
# ek5 @ 2017/08
/define/n
/static int/n
/smb_word_op(/{
:s
s/smb_word_op(.*,.*,\([^,]*\),\([^,]*\),.*SMBUS_WRITE.*,\([^)]*\));/smb_wr16(\1, \2, \3);/
t sy
#!/bin/bash
#
# Antorand - prints 0/1,{2}rand into file
#
# Ek5 @ 2017/07
#
FILE=$1
if [ $FILE == "" ]
00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 78785281-55CA-4D93-AAA1-3BDA85F7D8A0
Device Start End Sectors Size Type
/dev/sda1 2048 534527 532480 260M EFI System
/dev/sda2 534528 796671 262144 128M Microsoft reserved
@ektor5
ektor5 / example_fftw.c
Last active May 12, 2021 16:31
simple fftw example
#include <fftw3.h>
#include <stdio.h>
#include <stdlib.h>
// #include <af_vfs.h>
#include <audiofile.h>
#include <string.h>
#include <error.h>
#include <errno.h>
#!/bin/bash
#
# UDOO X86: Curie Master Reset Script
# Copyright UDOO Team 2017
#
# Author: Ettore Chimenti
# Author: Luca Pisani
#
# Ver 0.1
#!/bin/bash
#
# UDOO X86: Curie Master Reset Script
# Copyright UDOO Team 2017
#
# Author: Ettore Chimenti
# Author: Luca Pisani
#
# Ver 0.1
#!/bin/bash
#
# UDOO X86: Curie Master Reset Script
# Copyright UDOO Team 2017
#
# Author: Ettore Chimenti
# Author: Luca Pisani
#
# Ver 0.1
@ektor5
ektor5 / accmag_serial.ino
Created May 2, 2016 16:30
UDOO Neo Sketch with less Serial.print()
#include <Wire.h>
#include <FXOS8700CQ.h>
FXOS8700CQ sensor = FXOS8700CQ(0x1E);
void setup() {
Serial.begin(9600);
Wire1.begin();
// Initialize the FXOS8700CQ
// Sketch based on http://www.hobbytronics.co.uk/arduino-external-eeprom
// Full check on every EEPROM cell
// Tried on UDOO Neo
//
// Ek5
#include <Wire.h>
#define disk1 0x50 //Address of 24LC256 eeprom chip
int dim = 32768; //Capacity in bytes