After watching Bryan Cantrill's presentation on [Running Aground: Debugging Docker in Production][aground] I got all excited (and strangely nostalgic) about the possibility of core-dumping server-side Python apps whenever they go awry. This would theoretically allow me to fully inspect the state of the program at the point it exploded, rather than relying solely on the information of a stack trace.
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 bash | |
COMMAND=$1 | |
pushd `dirname $0` > /dev/null | |
DIR=`pwd -P` | |
popd > /dev/null | |
cd $DIR |
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
#----------------------------------------- | |
# NXP lpc1114fn23 Cortex-M0 32k flash, 4k ram | |
set CHIPNAME lpc1114 | |
set CPUTAPID 0x0BB11477 | |
set CPUROMSIZE 0x8000 | |
set CPURAMSIZE 0x1000 | |
# After reset the chip is clocked by the ~12MHz internal RC oscillator. | |
# When board-specific code (reset-init handler or device firmware) |
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 | |
# Create a complete OS .dmg file (it needs the Apple Developers Tools installed) | |
# usage: | |
# pkg-create.sh <contents-root-folder> <package-name> <package-version> <vendor-string> | |
# | |
CONTENTS=$1 | |
shift | |
NAME=$1 | |
shift |
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 sh | |
/usr/bin/screen -S reverse-ssh-tunnel -d -m /usr/bin/autossh -M 65500 -o "ServerAliveInterval 20" -R 2222:localhost:22 server |
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
version: "3" | |
services: | |
cron: | |
image: alpine | |
command: sh -c "echo '* * * * * task > /proc/1/fd/1 2> /proc/1/fd/2' | crontab - && crond -f" | |
volumes: | |
- ./task.sh:/usr/local/bin/task:ro |
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
// A round-robin priority arbiter for valid/ready signaling using carry chain logic. | |
module arbiter#(parameter N = 2) | |
( | |
input wire clk, | |
input wire [N-1:0] s_valid, | |
output wire [N-1:0] s_ready, | |
output wire m_valid, | |
input wire m_ready | |
); |
From this paper: http://fpgacpu.ca/fpga/hdl/Tumbush%20DVCon%2005.pdf
- If any operand in an operation is unsigned the entire operation is unsigned.
- Investigate fully all "signed to unsigned conversion occurs" synthesis warnings. These point to incorrect functionality.
- All signed operands will be sign-extended to match the size of the largest signed operand.
- Type casting using $unsigned will make the operation unsigned. The operand will be extended with 0’s if necessary.
- Type casting using $signed makes the operand signed. The operand will be sign-extended with 1's if necessary. Pad the operand with a single 0 bit before the cast if this is not desired.
- Expression type depends only on the operands or operation; it does not depend on the LHS of the expression.
Additional points based on feedback from Owen Shepherd:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 bash | |
DIR=`dirname $0` | |
TARGET_APK="target.apk" | |
TARGET_DIR="target" | |
if [[ ! "$1" =~ ^(unpack|pack)$ ]]; then | |
echo "Choose 'unpack' or 'pack'" | |
exit 1 | |
fi |
NewerOlder