Skip to content

Instantly share code, notes, and snippets.

View Scrappers-glitch's full-sized avatar
🤖
Electrostat Lab.

pavl_g Scrappers-glitch

🤖
Electrostat Lab.
View GitHub Profile
@Scrappers-glitch
Scrappers-glitch / error.log
Created June 6, 2024 20:00
Error due to `n-tuple` duplicates when putting an object definition in headers and including the headers in multiple compilation units, resulting in `n-tuple` duplicate definitions during the linking procedure.
[100%] Linking C executable hello_comm.c-a.elf
/usr/bin/ld: /home/runner/work/Electrostatic-Sandbox/Electrostatic-Sandbox/electrostatic-sandbox-framework/electrostatic-core//build/x86/libelectrostatic-a.a(init_protocol.c.o):(.bss+0x70): multiple definition of `serial'; CMakeFiles/hello_comm.c-a.elf.dir/src/hello_comm.c.o:(.bss+0x70): first defined here
/usr/bin/ld: /home/runner/work/Electrostatic-Sandbox/Electrostatic-Sandbox/electrostatic-sandbox-framework/electrostatic-core//build/x86/libelectrostatic-a.a(init_protocol.c.o):(.bss+0x54): multiple definition of `parallel'; CMakeFiles/hello_comm.c-a.elf.dir/src/hello_comm.c.o:(.bss+0x54): first defined here
/usr/bin/ld: /home/runner/work/Electrostatic-Sandbox/Electrostatic-Sandbox/electrostatic-sandbox-framework/electrostatic-core//build/x86/libelectrostatic-a.a(init_protocol.c.o):(.bss+0x0): multiple definition of `usbfs'; CMakeFiles/hello_comm.c-a.elf.dir/src/hello_comm.c.o:(.bss+0x0): first defined here
/usr/bin/ld: /home/runner/work/Electrostatic-Sandbox/E
@Scrappers-glitch
Scrappers-glitch / error.txt
Created June 5, 2024 23:02
Unusual position independent error
electrostat-lab@electrostat-workstation:~/Sandbox/Electrostatic-Sandbox/electrostatic-sandbox-framework$ ./helper-scripts/ci-cd/compile-e4j.sh
Compiling and Assembling e4j-core
BUILD SUCCESSFUL in 1s
7 actionable tasks: 2 executed, 5 up-to-date
Compiling e4j-native
> Task :electrostatic4j-native:compileX86
-- GCC: /usr/bin/gcc
-- GPP: /usr/bin/g++
@Scrappers-glitch
Scrappers-glitch / wget_google_drive_download.md
Created June 2, 2024 03:51 — forked from emxsys/wget_google_drive_download.md
Download Google Drive files with WGET

How to download files from Google Drive with WGET

Step 1. Get the ID of the file to download

  1. Get a shareable link from Google Drive by right-clicking the file and selecting Get Shareable Link.

  2. Examine the link to get the file's ID. Example:

    https://docs.google.com/open?id=[ID]

Step 2. Download the file with WGET

  1. Build the download URL using the ID obtained in Step 1. Example:
@Scrappers-glitch
Scrappers-glitch / cdrom.h
Created May 31, 2024 09:37
IOCTL Magic encodings for CDROM operation @ `/usr/include/linux/cdrom.h`.
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* -- <linux/cdrom.h>
* General header file for linux CD-ROM drivers
* Copyright (C) 1992 David Giller, rafetmad@oxy.edu
* 1994, 1995 Eberhard Mönkeberg, emoenke@gwdg.de
* 1996 David van Leeuwen, david@tm.tno.nl
* 1997, 1998 Erik Andersen, andersee@debian.org
* 1998-2002 Jens Axboe, axboe@suse.de
*/
@Scrappers-glitch
Scrappers-glitch / ioctl.h
Created May 31, 2024 09:35
Generic IOCTL Macro Functions for all IOCTL routing controls @ `/usr/include/asm-generic/ioctl.h`.
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_GENERIC_IOCTL_H
#define _ASM_GENERIC_IOCTL_H
/* ioctl command encoding: 32 bits total, command in lower 16 bits,
* size of the parameter structure in the lower 14 bits of the
* upper 16 bits.
* Encoding the size of the parameter structure in the ioctl request
* is useful for catching programs compiled with old versions
* and to avoid overwriting user space outside the user buffer area.
@Scrappers-glitch
Scrappers-glitch / termios.h
Created May 31, 2024 09:31
/usr/include/asm-generic/termios.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_GENERIC_TERMIOS_H
#define _ASM_GENERIC_TERMIOS_H
/*
* Most architectures have straight copies of the x86 code, with
* varying levels of bug fixes on top. Usually it's a good idea
* to use this generic version instead, but be careful to avoid
* ABI changes.
* New architectures should not provide their own version.
*/
@Scrappers-glitch
Scrappers-glitch / parport.h
Created May 31, 2024 09:09
Linux `parport.h` IOCTL Magic Macros
/*
* Any part of this program may be used in documents licensed under
* the GNU Free Documentation License, Version 1.1 or any later version
* published by the Free Software Foundation.
*/
#ifndef _PARPORT_H_
#define _PARPORT_H_
/* Start off with user-visible constants */
@Scrappers-glitch
Scrappers-glitch / free_buffer_cells.c
Created September 19, 2023 22:24
Example for freeing buffer cells of a pointer to a pointer
// Online C compiler to run C program online
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static inline void freeBufferCells(void** buffer, int count) {
for (int i = 0; i < count; i++) {
free(buffer[i]);
buffer[i] = NULL;
}
git rm -r --cached .
git add .
git commit -m "fixing .gitignore"
@Scrappers-glitch
Scrappers-glitch / Disassemble.as
Created April 24, 2023 19:29
Disassemble code
└──╼ $./avr-objdump -S '/home/twisted/GradleProjects/ShiftAvr/shiftavr-examples/build/atmega328p/hello_gpio_write.c.elf'
/home/twisted/GradleProjects/ShiftAvr/shiftavr-examples/build/atmega328p/hello_gpio_write.c.elf: file format elf32-avr
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 34 00 jmp 0x68 ; 0x68 <__ctors_end>
4: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>