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 | |
# comment | |
SAVE_DIR="$HOME/.cat-logs-once-store" | |
mkdir -p "${SAVE_DIR}" | |
target_file=$1 | |
session_prefix=$2 |
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 | |
TARGET="mysite.example.net"; | |
RECIPIENT="[email protected]"; | |
DAYS=7; | |
echo "checking if $TARGET expires in less than $DAYS days"; | |
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \ | |
| openssl x509 -text \ | |
| grep 'Not After' \ | |
|awk '{print $4,$5,$7}')" '+%s'); | |
in7days=$(($(date +%s) + (86400*$DAYS))); |
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
// This script was placed in /sc-data/html_text/de/pli/sutta/sn (needs requirements `yarn add natural-sort glob ...`) | |
// Outputs book.html, a file of all merged text - (hopefully) correctly ordered. | |
// Minimal example for creating PDF: pandoc -o book.pdf --pdf-engine=xelatex --toc book.html | |
const nsort = require('natural-sort'); | |
const glob = require('glob'); | |
const fs = require('fs'); | |
const cheerio = require('cheerio'); | |
glob("**/*.html", (er, files) => { |
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 | |
A=$(dmesg) | |
echo "Remove or add your device now." | |
sleep 5 | |
B=$(dmesg) | |
diff <(echo "$A") <(echo "$B") |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <limits.h> | |
int main() { | |
pid_t pid; | |
int fd[2]; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
int main() { | |
pid_t pid; | |
switch ((pid = fork())) { | |
case -1: | |
// error occurred |
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
#include<stdio.h> | |
#include<stdlib.h> | |
#include<unistd.h> | |
int main(int argc, char *argv[]) { | |
int c; | |
while((c = getopt(argc, argv, "ab:c:")) != -1) { | |
switch(c) { | |
case 'a': |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
int main() { | |
pid_t pid; | |
if ((pid = fork()) < 0) { | |
// error occurred | |
printf("Error using fork()"); |
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
#include <stdio.h> | |
int main() { | |
printf("Hello World!"); | |
return 0; | |
} |
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
#include <stdio.h> | |
#include <time.h> | |
#include <stdlib.h> | |
int main() { | |
// salt rnd | |
srand(time(NULL)); | |
printf("%d\n", rand()); | |
printf("%d\n", rand()); |
NewerOlder