Skip to content

Instantly share code, notes, and snippets.

@japm48
japm48 / pspdet.c
Created September 25, 2017 00:00
PSPDET - Simple Proper Detacher
//pspdet: PSPDET Simple Proper Detacher
//References:
// - http://stackoverflow.com/a/8888612
// - Unix Network programming 3rd Ed., Vol. 1
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
@japm48
japm48 / 1_synth_runme.log
Last active February 11, 2020 19:19
Murax arty_a7 Vivado 2018.3
*** Running vivado
with args -log toplevel.vds -m64 -product Vivado -mode batch -messageDb vivado.pb -notrace -source toplevel.tcl
****** Vivado v2018.3 (64-bit)
**** SW Build 2405991 on Thu Dec 6 23:36:41 MST 2018
**** IP Build 2404404 on Fri Dec 7 01:43:56 MST 2018
** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.
@japm48
japm48 / build.log
Created April 11, 2020 15:31
GR build log
user@host:/tmp/gnuradio-build$ cmake \
-DCMAKE_INSTALL_PREFIX=$GNURADIO_INSTALL \
-DENABLE_NATIVE=ON \
-DQWT_LIBRARIES=/usr/lib/libqwt.so \
-DENABLE_DOXYGEN=OFF \
-DENABLE_CTRLPORT_THRIFT=OFF \
-DENABLE_INTERNAL_VOLK=OFF \
-G Ninja ~/cloned_repos/gnuradio/ \
> cmake_log.txt
@japm48
japm48 / search.txt
Last active April 14, 2020 15:35
gr printf
~/cloned_repos/gnuradio$ rg 'fprintf\(stderr'
\CHANGELOG.md
16:- Logging: removed all `std::cerr` and `fprintf(stderr,…)` by GNU Radio logging
gnuradio-runtime/lib/vmcircbuf_createfilemapping.cc
193: // fprintf(stderr,"win32 AllocationGranularity
gnuradio-runtime/lib/realtime_impl.cc
104: // fprintf(stderr, "pthread_setschedparam: policy = %d, pri = %d\n", policy, pri);
146: // fprintf(stderr, "sched_setscheduler: policy = %d, pri = %d\n", policy, pri);
@japm48
japm48 / README.md
Created January 17, 2016 11:45
CoreOS: enable UTF8 with a provisional (ugly) workaround
  1. First, you need a Linux distro with a functional UTF-8 locale (i.e. NOT CoreOS).

    Execute my_gen_locale.sh to generate a valid locale-archive by copying a locale from the system. It will use en_US.UTF-8, but can be changed if deemed necessary (the list of locales can be found in glibc sources: https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/SUPPORTED ).

  2. Now the /usr partition must be edited to install it.

Apparently this is quite discouraged by the devs, but I still don't know how to create a new CoreOS image

# Requires fd: https://github.com/sharkdp/fd
gr_update_hash()
{
git status 2>/dev/null >/dev/null || { echo 'not in git repo' ; return; }
[ "$#" -ne 0 ] || { echo 'need list of args (base filenames)'; return; }
root=$(git rev-parse --show-toplevel)
fd_cmd='fd --type f --color never --max-results=1'
for f in "$@"
do
(
@japm48
japm48 / rx_ofdm_example.grc
Last active October 26, 2020 05:11
eq pr example
options:
parameters:
author: ''
catch_exceptions: 'True'
category: Custom
cmake_opt: ''
comment: ''
copyright: ''
description: Example of an OFDM receiver
gen_cmake: 'On'
python ./qa_ofdm_frame_equalizer_vcvc.py
DEPRECATED: Using filename with gr_unittest does no longer have any effect.
.....F.
======================================================================
FAIL: test_002_static (__main__.qa_ofdm_frame_equalizer_vcvc)
- Add a simple channel
----------------------------------------------------------------------
Traceback (most recent call last):
File "./qa_ofdm_frame_equalizer_vcvc.py", line 232, in test_002_static
self.assertEqual(tag_dict, expected_dict)
@japm48
japm48 / euclidean_gcd.v
Created August 28, 2021 19:07
Euclidean GCD in hardware
`default_nettype none
module euclidean_gcd(
input wire clk,
input wire start,
input wire [31:0] A,
input wire [31:0] B,
output reg [31:0] R,
output wire valid_out
);
@japm48
japm48 / euclidean_gcd.py
Created August 28, 2021 19:21
Eclidean GCD in python
def euclidean_gcd(a, b):
while a != b:
if a > b:
a -= b
else:
b -= a
return a