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
""" | |
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
""" Hash a file supplied by argv[1] """ | |
from sys import argv | |
from hashlib import sha256 | |
# Construct an sha256 algorith | |
h256 = sha256() | |
# Get the name of the file we want to hash | |
fname = argv[1] |
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
# | |
# 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
# 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
// 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
# ============================================ | |
# | |
# 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
/* | |
* determine a file's size with lseek | |
*/ | |
#include <unistd.h> /* for lseek */ | |
#include <stdio.h> /* for printf */ | |
#include <fcntl.h> /* for open */ | |
int main(int ac, char *av[]) | |
{ |
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; |