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
/* | |
* File....... IRanalyzer.pde | |
* Purpose.... Records up to 128 signal changes | |
* Author..... Walter Anderson | |
* E-mail..... wandrson@walteranderson.us | |
* Started.... 18 May 2007 | |
* Updated.... 18 May 2007 | |
* | |
* | |
*/ |
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 <stdlib.h> | |
#include <stddef.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <unistd.h> //close() | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <sys/types.h>// select(), fd_set, FD_* macros |
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
/* | |
* Example on how to work with a non-blocking connect. Uses fixed input and | |
* should show all 3 situations we care about - a successful connect, a refused | |
* connect, and a timeout. | |
* | |
* (c) jp@devnull.cz, vlada@devnull.cz | |
*/ | |
#include <sys/types.h> | |
#include <sys/socket.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
#!/bin/bash | |
#thanks to https://winaero.com/blog/how-to-set-the-bios-date-in-virtualbox/ | |
if [[ -z ${1} || -z ${2} ]] | |
then | |
echo ${0} " Usage:" | |
echo " ${0} <vm-name> <time-offset>" | |
echo " Example: ${0} projectVM -36000000" | |
exit | |
fi |
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 | |
if [[ -z $1 ]] | |
then | |
echo $0 " Usage:" | |
echo " ${0} <date>" | |
echo " Example: ${0} 1990-09-21" | |
exit | |
fi | |
past_secs=$(date --date ${1} +%s) |
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 ruby | |
File.open("your_file.md", 'r') do |f| | |
f.each_line do |line| | |
forbidden_words = ['Table of contents', 'define', 'pragma'] | |
next if !line.start_with?("#") || forbidden_words.any? { |w| line =~ /#{w}/ } | |
title = line.gsub("#", "").strip | |
href = title.gsub(" ", "-").downcase | |
puts " " * (line.count("#")-1) + "* [#{title}](\##{href})" |
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
/** | |
* Snippet from https://www.binarytides.com/multiple-socket-connections-fdset-select-linux/ | |
*/ | |
#include <stdio.h> | |
#include <string.h> //strlen | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <unistd.h> //close | |
#include <arpa/inet.h> //close | |
#include <sys/types.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
#include <ares.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
#include <stdarg.h> | |
#include <string.h> | |
#include <ctype.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
#!/bin/bash | |
# This script parses file info generated by ffmpeg and, if the first stream is an audio stream, moves to file to from | |
# $1 to $2 | |
# https://www.computerhope.com/unix/bash/read.htm | |
find $1 -maxdepth 1 -type f -print0 | | |
while IFS= read -r -d '' line | |
do | |
ffmpeg -i "${line}" 2>&1 | grep --color=always "Stream #0:0[()a-z]*: Audio" > /dev/null |
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 | |
# Sign a file with a private key using OpenSSL | |
# Encode the signature in Base64 format | |
# | |
# Usage: sign <file> <private_key> | |
# | |
# NOTE: to generate a public/private key use the following commands: | |
# | |
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048 | |
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem |