Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import os
import sys
def runtests():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.test_settings")
try:
from django import setup
setup()
@matwey
matwey / main.c
Last active September 5, 2020 08:21
Apacer microSD diagnostic readout.
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <linux/mmc/ioctl.h>
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <linux/types.h>
//#include <linux/compiler.h>
#include <linux/videodev2.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#!/usr/bin/env python3
import sys
import os
mapping = {
"А": "\\CYRA",
"Б": "\\CYRB",
"В": "\\CYRV",
"Г": "\\CYRG",
@matwey
matwey / main.c
Last active November 8, 2016 10:20
tty_test
#include <stdlib.h>
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/poll.h>
@matwey
matwey / main.c
Last active September 24, 2019 08:59
ieee1394 iicd
#include <stdlib.h>
#include <stdio.h>
#include <dc1394/dc1394.h>
#include <inttypes.h>
int main(int argc, char** argv) {
dc1394_t * d;
dc1394camera_list_t * list;
dc1394error_t err;
dc1394camera_t *camera;
@matwey
matwey / main.c
Last active January 29, 2020 23:04
read /dev/port
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
int main(int argc, char** argv) {
int fd;
off_t ret;
#!/usr/bin/env python3
import sys
from astropy.io import fits
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
_, infile, outfile = sys.argv
hdulist = fits.open(infile, uint=True)
#!/usr/bin/env python3
from html.parser import HTMLParser
import urllib.request
import sys
class Repo(object):
def __init__(self, path, commit):
self.commit = commit
self.path = path
@matwey
matwey / e3.cpp
Last active October 30, 2020 08:39
EGL openGL B-spline
#include <EGL/egl.h>
#define GL_GLEXT_PROTOTYPES 1
#include <GL/gl.h>
#include <GL/glext.h>
#include <cstring>
#include <cmath>
#include <chrono>
#include <iostream>