Skip to content

Instantly share code, notes, and snippets.

View rkujawa's full-sized avatar

Radosław Kujawa rkujawa

View GitHub Profile
@rkujawa
rkujawa / main.vhd
Created August 15, 2014 10:55
FSM in VHDL
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
--use IEEE.NUMERIC_STD.ALL;
--library UNISIM;
--use UNISIM.VComponents.all;
ENTITY main IS
PORT( clk, reset, btn: IN STD_LOGIC;
led: OUT STD_LOGIC_VECTOR(7 downto 0)
@rkujawa
rkujawa / oatvr.groovy
Last active August 29, 2015 14:07
Download anime torrents via RSS
#!/usr/bin/env /opt/groovy/bin/groovy
import gstorm.*
/**
* ObtainAnimuTorrentViaRss
* @version 0.1
* @author rkujawa
*/
/* $NetBSD$ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Radoslaw Kujawa.
*
* Redistribution and use in source and binary forms, with or without
#include <stdio.h>
#include <stdlib.h>
#include <proto/exec.h>
#include <exec/types.h>
#include <exec/memory.h>
#include <exec/interrupts.h>
#include <hardware/intbits.h>
.macro fcall fname, arg1, arg2, arg3, arg4, arg5
ldy #0
.ifnb \arg1
ldx #\arg1
stx FARGS_ARG,Y
iny
.endif
.ifnb \arg2
ldx #\arg2
stx FARGS_ARG,Y
#include <stdio.h>
#include <stdint.h>
struct code_data {
uint8_t len;
char *name;
};
struct code_data commands[] = {
{0, "noop"}, /* 0 */

Keybase proof

I hereby claim:

  • I am rkujawa on github.
  • I am rkujawa (https://keybase.io/rkujawa) on keybase.
  • I have a public key whose fingerprint is B86D EF7A EC86 3837 E705 B978 3013 7C07 1B07 18AF

To claim this, I am signing this object:

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/file.h>
static const char *filename = "/tmp/lockme";
int
@rkujawa
rkujawa / HL-L2360DW.md
Created March 9, 2017 20:12
Using Brother HL-L2360DW on NetBSD
$ cat /etc/printcap | grep '^[^#]'
ps|Brother:\
        :lp=:lf=/var/log/lpd-errs:mx#0:sh:\
        :sd=/var/spool/output/lpd/ps:\
        :rm=BRWxxxxxxxxxxxx.local:\
        :rp=pcl_p1:\
        :if=/opt/printing/filter-ps2pcl.sh:
$ cat /opt/printing/filter-ps2pcl.sh
#!/bin/sh
@rkujawa
rkujawa / compiling.sh
Created May 1, 2017 21:59
Compiling GPU accelerated things on Fedora 26
# using plain CUDA (requires cuda-devel)
nvcc --compiler-options "-std=c++98" -I /usr/include/cuda/ -o executable source.cu
# using OpenACC with NVPTX (requires gcc-offload-nvptx and cuda-devel)
gcc source.c -fopenacc -foffload=nvptx-none -foffload="-O3" -O3 -o executable
# using OpenCL with CUDA backend (requires cuda-devel, opencl-headers, ocl-icd, ocl-icd-devel)
gcc -Wall -W -O3 -I /usr/include/cuda -o executable source.cpp -L/usr/lib64 -Wl,-R,/usr/lib64 -lOpenCL