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
#!/bin/bash | |
set -euo pipefail | |
# change to log output directory | |
#cd /var/log/sys_stats | |
cd sys_stats | |
# wrap stdin with timestamp and newline | |
function wrap() { echo -n "${EPOCHREALTIME},"; cat; echo; } |
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
#!/bin/bash | |
set -euo pipefail | |
# name of the top module(filename must match as well!) | |
TOP_MODULE="mcpu_top" | |
# Generate XML representation | |
echo -e "\e[33m --- Generating XML ---\e[0m" | |
verilator --xml-only --top "${TOP_MODULE}" "${TOP_MODULE}.v" |
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
local debug_print = true | |
-- index into the state array("optimized" for instruction decoding) | |
local STATE_PC = 0 | |
local STATE_ADDR = 1 | |
local STATE_ALU_A = 2 | |
local STATE_IMM = 3 | |
local STATE_ALU_B = 4 | |
local STATE_I = 5 | |
local STATE_J = 6 |
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
local function pretty_print_table(tbl, file, indent, num_fmt, no_ansi, style, seen) | |
-- default parameters | |
file = file or io.stdout | |
indent = indent or 0 | |
num_fmt = tbl.__print_table_number_format or num_fmt or "%.2f" | |
style = tbl.__print_table_colors or style or {} | |
seen = seen or {} | |
-- calculate ANSI color codes | |
local key_code = no_ansi and "" or style.key or "\027[1;36m" |
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
local ffi = require("ffi") | |
ffi.cdef([[ | |
typedef unsigned int mode_t; | |
typedef unsigned int pid_t; | |
typedef unsigned int uid_t; | |
typedef unsigned int gid_t; | |
typedef unsigned int id_t; | |
typedef unsigned int dev_t; | |
/* from Linux/include/uapi/drm/drm.h */ |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<project source="3.8.0" version="1.0"> | |
This file is intended to be loaded by Logisim-evolution v3.8.0(https://github.com/logisim-evolution/). | |
<lib desc="#Wiring" name="0"> | |
<tool name="Pin"> | |
<a name="appearance" val="classic"/> | |
</tool> | |
</lib> | |
<lib desc="#Gates" name="1"> |
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
#!/usr/bin/env lua5.1 | |
--[[ | |
This file provides a simple menu for managing LXC containers | |
by calling the associated lxc-* programms. | |
It uses the dialog util to provide interactive menus. | |
Currently, it supports: | |
* create/start/stop/delete/clone/rename containers | |
* list running/stopped containers | |
* show info/statistics about container |
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
-- small Lua RC4 library. | |
-- Tested in luajit and lua5.3. | |
-- Use for testing purposes only! | |
-- RC4 is broken, and this is not a well-tested implementation. | |
local ok,bit = pcall(require, "bit") | |
if not ok then | |
bit = require("bit32") | |
end | |
assert(bit and (bit.bxor(0xFF,0xF0)==0x0F)) -- test bit library xor |
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
#!/usr/bin/env lua | |
-- return stdout of command as a table containg lines | |
local function stdout_lines(cmd) | |
local proc = io.popen(cmd, "r") | |
local lines = {} | |
for line in proc:lines() do | |
lines[#lines+1] = line | |
end | |
proc:close() | |
return lines |
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
return { | |
-- file extensions that are possibly a downloaded youtube video | |
file_extensions = {"mp3", "opus", "m4a", "ogg"}, | |
-- directorys to scan for youtube id's | |
local_dirs = { | |
"/media/your/music/library/folder/that/contains/youtube_dl/downloaded/videos/" | |
}, | |
-- where to store the downloaded files |
NewerOlder