Skip to content

Instantly share code, notes, and snippets.

View syzdek's full-sized avatar

David M. Syzdek syzdek

  • Alaska Communications
  • Anchorage, Alaska
  • 10:49 (UTC -09:00)
View GitHub Profile
@syzdek
syzdek / ipv6-regex-test.sh
Last active October 5, 2024 06:10
Simple script to test my IPv6 regular expression.
#!/bin/sh
#
# Use posixregex CLI tool from: https://github.com/syzdek/dmstools/blob/master/src/posixregex.c
RE_IPV4="((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])"
posixregex -r "^(${RE_IPV4})$" \
127.0.0.1 \
10.0.0.1 \
192.168.1.1 \
@syzdek
syzdek / ldapsearch-sync.c
Created December 11, 2011 07:10
an example of an LDAP synchronous search using an LDAP API
/*
* Simple Programming Examples And References
* Copyright (C) 2011 David M. Syzdek <david@syzdek.net>.
*
* @SYZDEK_BSD_LICENSE_START@
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
@syzdek
syzdek / books.sql
Created May 5, 2011 07:26
SQLite3 Example DB and queries
--
-- Simple SQLite3 Example
-- Copyright (C) 2011 David M. Syzdek <david@syzdek.net>
--
-- Run:
-- cat hello.sql | sqlite3 hello.db
--
-- creates tables
#
# Instructions for making hybrid GPT/MBR boot USB thumb drive.
# The Slackware Linux installer will be added to the image as an example,
# however the syslinux configuration can be modified to include any desired
# image.
#
# A USB thumb drive formatted with these instructions was able to
# boot the Slackware Installer on a:
#
# Dell Latitude E6430 in Legacy BIOS mode
/*
* TOTP: Time-Based One-Time Password Algorithm
* Copyright (c) 2015, David M. Syzdek <david@syzdek.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
@syzdek
syzdek / cli-nsrunloop.m
Created July 31, 2012 21:36
Creating an NSRunLoop for a command line utility.
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSRunLoop * runLoop;
CLIMain * main; // replace with desired class
@autoreleasepool
{
// create run loop
@syzdek
syzdek / ldapsearch-async.c
Created December 13, 2011 02:41
an example of an LDAP asynchronous search using an LDAP API
/*
* Simple Programming Examples And References
* Copyright (C) 2011 David M. Syzdek <david@syzdek.net>.
*
* @SYZDEK_BSD_LICENSE_START@
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
@syzdek
syzdek / keybase.md
Created April 14, 2020 23:22
keybase.md

Keybase proof

I hereby claim:

  • I am syzdek on github.
  • I am syzdek (https://keybase.io/syzdek) on keybase.
  • I have a public key ASAGpvnIp42DL04AiqXD3ppMpNOXC2cs0e9BQfbBykTHSAo

To claim this, I am signing this object:

/*
* Example of getaddrinfo() and inet_ntop()
* Copyright (C) 2020 David M. Syzdek <david@syzdek.net>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@syzdek
syzdek / encrypt-sshpass.sh
Created July 9, 2012 20:25
Script to encrypt a string using an SSH user's public RSA ssh key.
#!/bin/sh
#
# Convience script for encrypting a SSH user's password
# using the user's public SSH RSA key.
#
# encrypt-sshpass.sh
#
PROGRAM_NAME=`basename ${0}`