This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"crypto/sha256" | |
"fmt" | |
"golang.org/x/crypto/bcrypt" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SPI_INSTANCE 1 /**< SPI instance index. */ | |
#define BUFF_LENGTH 2 /**< Transfer length. */ | |
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */ | |
static uint8_t m_tx_buf[BUFF_LENGTH]; /**< TX buffer. */ | |
static uint8_t m_rx_buf[BUFF_LENGTH]; /**< RX buffer. */ | |
static volatile bool burst_completed = false; | |
static volatile bool spi_xfer_done = false; /**< Flag used to indicate that SPI instance completed the transfer. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SPI_INSTANCE 1 /**< SPI instance index. */ | |
#define BUFF_LENGTH 2 /**< Transfer length. */ | |
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */ | |
static uint8_t m_tx_buf[BUFF_LENGTH]; /**< TX buffer. */ | |
static uint8_t m_rx_buf[BUFF_LENGTH]; /**< RX buffer. */ | |
static volatile bool burst_completed = false; | |
static volatile bool spi_xfer_done = false; /**< Flag used to indicate that SPI instance completed the transfer. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OpenOcd < Formula | |
desc "On-chip debugging, in-system programming and boundary-scan testing" | |
homepage "https://sourceforge.net/projects/openocd/" | |
url "https://downloads.sourceforge.net/project/openocd/openocd/0.10.0/openocd-0.10.0.tar.bz2" | |
sha256 "7312e7d680752ac088b8b8f2b5ba3ff0d30e0a78139531847be4b75c101316ae" | |
bottle do | |
rebuild 1 | |
sha256 "eab0153f54c97d4922386996d7517b6dc22c8e418b620ba42dd6f190fc0c48f7" => :high_sierra | |
sha256 "281978e21362ed00dd198715825d77f0f2aeb64ad99954714a34ce128e1a0df8" => :sierra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put in ~/.config/systemd/user/redshift.service | |
[Unit] | |
Description=Redshift display colour temperature adjustment | |
Documentation=http://jonls.dk/redshift/ | |
After=display-manager.service | |
[Service] | |
Environment=DISPLAY=:0 | |
ExecStart=/usr/bin/redshift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
$ AFL_USE_ASAN=1 afl-clang-fast fuzzer.c -o fuzzer | |
$ afl-launch -i in_dir -o out_dir -m none -n $(nproc --all) -- ./fuzzer @@ | |
$ afl-whatsup -s out_dir | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define BUF_SIZE 1024*1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import struct | |
import binascii | |
# See https://github.com/f4exb/sdrangel/tree/master/plugins/samplesource/filesource | |
data = open(sys.argv[1], "rb").read() | |
out = open(sys.argv[2], "wb") | |
w = bytearray() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[NetDev] | |
Name=bond1 | |
Kind=bond | |
[Bond] | |
Mode=802.3ad | |
MIIMonitorSec=1s | |
LACPTransmitRate=fast | |
UpDelaySec=2s | |
DownDelaySec=8s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import psutil | |
import multiprocessing as mp | |
from multiprocessing import Process | |
def f(thread, duty, freq, q): | |
p = psutil.Process() | |
p.cpu_affinity([thread]) | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nmigen import * | |
from nmigen.build import * | |
import itertools | |
from nmigen_boards.tang_nano import TangNanoPlatform | |
class Blinky(Elaboratable): | |
def elaborate(self, platform): | |
m = Module() |
OlderNewer