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
/* | |
* sig.c - examining the return value of the signal function | |
* | |
* The signal function returns the pointer to the previous | |
* handler for the signal. | |
*/ | |
#include <stdio.h> /* for printf */ | |
#include <signal.h> /* for signal */ | |
#include <stdlib.h> /* for exit */ |
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
/* | |
* determine a file's size with stat | |
*/ | |
#include <sys/stat.h> /* for stat */ | |
#include <stdio.h> /* for printf */ | |
int main(int ac, char *av[]) | |
{ | |
if ( ac < 2 ) 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
# ============================================ | |
# | |
# netyet.sh - Announce, in English, when your | |
# Internet connection is working | |
# | |
# You could also use: | |
# | |
# ping -i 60 -a 8.8.8.8 | |
# | |
# which will just ring the terminal bell once |
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
# usage: ./appicon-resize.sh ORIGINAL_PNG.png | |
ORIG=$1 | |
function resize { | |
convert $ORIG -resize $1 $(echo $ORIG | sed -e "s/.png/-$1.png/g") | |
} | |
resize 1024 | |
resize 167 |
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
# | |
# get unemployment rates for CT and US | |
# Jake Kara, December 2017 | |
# | |
# get unemployment rate CSV because these excel links: | |
# http://www1.ctdol.state.ct.us/lmi/unemploymentrate.asp | |
# seem to work in non-IE browsers or pandas/requests lib | |
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
/******************************************************** | |
* ipclass.c | |
* | |
* Demonstrate that the first significant bits | |
* can be used to determine the address class | |
* | |
* | |
* https://en.wikipedia.org/wiki/Classful_network | |
*******************************************************/ | |
#include <stdio.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
// Unix File Permissions - List all possible file permissions | |
// Written to teach myself structs and enums in Swift | |
// Jake Kara, September 2017 | |
enum Permission:Int{ | |
case None = 0 | |
case Execute, // 1 | |
Write, // 2 | |
ExecuteWrite, // 1 + 2 = 3 |
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
""" | |
usage: python mine_demo.py ZEROES VALUE_TO_HASH | |
Find a nonce that, when concatenated with VALUE_TO_HASH, results in an | |
SHA256 hexdigest that starts with ZEROES number of zeroes. | |
output: NONCE HASH | |
Where NONCE is the solution that resulted in a HASH that the required | |
number of zeroes at the start. |
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 | |
# nagsite.sh - ping a site until it comes back online | |
RET_VAL=1; | |
# | |
# checksite - Check if a site is online | |
# args - url to ping | |
# returns - no returns, but modifies RET_VAL |
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 | |
# | |
# clean-mess.sh - Convert a SQL text output to CSV, for when | |
# someone sends you SQL text output of a table instead of a CSV... | |
# | |
# Beware, this will not properly handle double spaces in a column | |
# because that wasn't an issue for the data I received. | |
# | |
# In this case, it just does every .mess file in a folder called data |