This file contains hidden or 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 | |
| # File: svnsettle | |
| # Author: Sophie Eccles | |
| # Date: 2019-08-14T07:42R | |
| # Description: This script takes any unknown files in an SVN repo (not counting | |
| # ignored ones, obviously) and adds them. If there are any missing files, it | |
| # will remove them from SVN. Note that this is not necessarily a perfect | |
| # solution, but it does what I wanted it to. It's definitely not the cleanest |
This file contains hidden or 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
| /* Compile with -DUSE_READLINE and -lreadline to use readline for input. */ | |
| #include <arpa/inet.h> | |
| #include <errno.h> | |
| #include <poll.h> | |
| #include <signal.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <sys/socket.h> |
This file contains hidden or 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
| /* | |
| * Input is from stdin. The first line should be the width of the grid. | |
| * The second line should be the height. | |
| * The third line should be the length of a generation in microseconds. | |
| * The rest of the file is assumed to be the grid itself | |
| * Anything out of bounds will be cut off. | |
| * A space is a "dead" cell; anything else is assumed to be a "living" cell. | |
| * | |
| * This implementation doesn't allow cells to wrap around. Edges are solid | |
| * and block cells. |
This file contains hidden or 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 -e | |
| if ! command -v fbgrab &>/dev/null; then | |
| echo "Please install fbgrab before running this." | |
| exit 1 | |
| fi | |
| fontpath="${FONTPATH:-/usr/share/consolefonts}" | |
| cd "$fontpath" |
This file contains hidden or 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 -e | |
| if [[ $# < 2 ]]; then | |
| echo "Example usage: $0 1 27" | |
| echo "This would get the details of GPIO1_27 if it's exported." | |
| exit 1 | |
| fi | |
| DEVNUM=$(( 32 * $1 + $2 )) |
This file contains hidden or 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
| // note there is no check for excessive recursion so if something has already been copied it will be tried again | |
| int cpfile(const char* src, const char* dst) { | |
| char* b = basename(src); | |
| if (b != NULL && (0 == strcmp(b, ".") || 0 == strcmp(b, ".."))) { | |
| return 0; | |
| } | |
| struct stat srcstat, dststat; | |
| bool dstexist = false; | |
| int s = 0; |
This file contains hidden or 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
| /* | |
| * File: sockets.h | |
| * Author: Sophie Eccles | |
| * Date: 2020-03-12 | |
| * | |
| * 1. Description | |
| * | |
| * This header attempts to make it easy to use sockets across platforms, | |
| * for both Windows and POSIX systems. While Winsock is often somewhat | |
| * compatible with Berkeley sockets, it is not strictly compatible, |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <getopt.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| static enum MODE { | |
| INFO, | |
| EXPORT, |
This file contains hidden or 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
| #include <stdio.h> | |
| #define $x ,x | |
| #define $i ,i | |
| #define eval int | |
| #define read scanf | |
| #define $scanfpat "%d", & | |
| #define $(x) ,(x) | |
| #define $open ( | |
| #define $close ) | |
| #define do { |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <stdint.h> | |
| #include <errno.h> | |
| #include <ctype.h> | |
| #include <stdbool.h> | |
| #define SWAP(a,b) ((a)^=(b),(b)^=(a),(a)^=(b)) |