Skip to content

Instantly share code, notes, and snippets.

uint16_t ax25crc16(unsigned char *data_p, uint16_t lenght) {
uint16_t crc = 0xFFFF;
uint32_t data;
uint16_t crc16_table[] = {
0x0000, 0x1081, 0x2102, 0x3183,
0x4204, 0x5285, 0x6306, 0x7387,
0x8408, 0x9489, 0xa50a, 0xb58b,
0xc60c, 0xd68d, 0xe70e, 0xf78f
};
import sys
import time
import datetime
from math import *
import ephem
# taken from: http://celestrak.com/NORAD/elements/cubesat.txt
ec1_tle = { "name": "ESTCUBE 1", \
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
uint32_t d_shift_register = 0;
uint32_t d_taps[32];
uint32_t d_tap_count;
#!/usr/bin/env python3
import numpy as np
import cv2
eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
def detect(img, cascade):
rects = cascade.detectMultiScale(img, scaleFactor=1.3, minNeighbors=4, minSize=(30, 30),
flags=cv2.CASCADE_SCALE_IMAGE)
@gauravjuvekar
gauravjuvekar / log_config.py
Created July 11, 2017 05:45
logging config with verboselogs and coloredlogs
#!/usr/bin/env python3
"""
Easliy set up a consistent logging configuration for all codes that use this
library.
The main code can be written as:
import logging
import coloredlogs
import argparse
@gauravjuvekar
gauravjuvekar / parse_depends.py
Created December 17, 2017 12:45
ParseDepends SCons tool
"""
Use the C preprocessor to generate include dependencies
The SCons ParseDepends can parse the dependency files output by the
preprocessor, however this requires a rebuild as the dependency files are
updated after the compiler is run once.
See the `-M` flags in `man gcc` for more info.
This implementation was taken from
https://bitbucket.org/scons/scons/wiki/ParseDepends
-- Logs begin at Thu 2018-12-20 02:50:23 UTC, end at Thu 2018-12-20 02:54:13 UTC. --
Dec 20 02:50:23 archlinux kernel: microcode: microcode updated early to revision 0x24, date = 2018-04-02
Dec 20 02:50:23 archlinux kernel: Linux version 4.19.9-arch1-1-ARCH (builduser@heftig-14263) (gcc version 8.2.1 20181127 (GCC)) #1 SMP PREEMPT Fri Dec 14 00:58:26 UTC 2018
Dec 20 02:50:23 archlinux kernel: Command line: BOOT_IMAGE=/vmlinuz-linux root=/dev/mapper/os_VG-arch_root rw rd.luks.name=29330039-8a29-4b44-bc94-0b749e732abd=crypt_PV rd.luks.options=discard root=UUID=6f784280-161b-4866-9eaa-0d8bd2967b0d resume=UUID=878ee225-bd99-4472-b264-8c08c3eb5ab8 sysrq_always_enabled=1 debug
Dec 20 02:50:23 archlinux kernel: KERNEL supported cpus:
Dec 20 02:50:23 archlinux kernel: Intel GenuineIntel
Dec 20 02:50:23 archlinux kernel: AMD AuthenticAMD
Dec 20 02:50:23 archlinux kernel: Centaur CentaurHauls
Dec 20 02:50:23 archlinux kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Dec 20 02:50:23
################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################
# With: reflector --protocol https --latest 100 --number 20 --sort rate --save /etc/pacman.d/mirrorlist
# When: 2019-05-11 04:40:48 UTC
# From: https://www.archlinux.org/mirrors/status/json/
# Retrieved: 2019-05-11 04:40:24 UTC
# Last Check: 2019-05-11 04:34:03 UTC
{
"buildDir": "/home/pkgbuilder/.cache/yay",
"editor": "",
"editorflags": "",
"makepkgbin": "makepkg",
"pacmanbin": "pacman",
"pacmanconf": "/etc/pacman.conf",
"tarbin": "bsdtar",
"redownload": "no",
"rebuild": "no",