Skip to content

Instantly share code, notes, and snippets.

View marklap's full-sized avatar

Mark LaPerriere marklap

View GitHub Profile
@marklap
marklap / windows_promiscuous_mode.go
Last active March 17, 2017 21:22
Putting windows network adapter in to promiscuous mode
////////////////////////////////////////////////////////////////////////////////
// The MIT License (MIT)
//
// Copyright (c) 2017 Mark LaPerriere
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@marklap
marklap / upgradewithciscovpn.sh
Created February 8, 2017 17:36
Wraps a complete upgrade in Cisco VPN uninstall/reinstall to avoid all the problems that that annoying software causes with upgrades.
#!/bin/bash
################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2016 Mark LaPerriere
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@marklap
marklap / init-git-config-hook.sh
Last active September 27, 2016 19:07
A post-commit git hook to be run once. I use it to remove the core.filemode setting in a skel local git config.
#!/bin/bash
################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2016 Mark LaPerriere
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@marklap
marklap / guess_number.go
Created August 25, 2016 19:46
Go number guessing game to help the kids learn programming
////////////////////////////////////////////////////////////////////////////////
// The MIT License (MIT)
//
// Copyright (c) 2016 Mark LaPerriere
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@marklap
marklap / ipconv.go
Last active September 6, 2023 15:20
Messing around turning IP addresses into integers
// //////////////////////////////////////////////////////////////////////////////
// The MIT License (MIT)
//
// # Copyright (c) 2016 Mark LaPerriere
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@marklap
marklap / README.md
Last active January 31, 2018 18:39
Client IP auth handler for Go builtin HTTP server

Is this a secure method of protecting content without a username/password?

No. Nope. No. The intention is that it will be used on a private network (i.e. less potential for bad actors) and will be one of the layers of defense implemented. But most likely additional layers of defense will be added using a similar method of middleware.

@marklap
marklap / bitwise_test.go
Created May 5, 2016 00:50
Some interesting benchmarks in Go that show the performance characteristics of bitwise math for some particular problems
////////////////////////////////////////////////////////////////////////////////
// The MIT License (MIT)
//
// Copyright (c) 2016 Mark LaPerriere
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@marklap
marklap / binarytable.go
Last active April 3, 2017 19:00
Takes a byte array and returns a string representation in a binary tabular format (N number of octet rows).
////////////////////////////////////////////////////////////////////////////////
// The MIT License (MIT)
//
// Copyright (c) 2017 Mark LaPerriere
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@marklap
marklap / httpfileserv.go
Created October 12, 2015 23:31
A very simple HTTP file server - no security, customize directory to serve and customize listening IP:port via envvars (that's it)
////////////////////////////////////////////////////////////////////////////////
// The MIT License (MIT)
//
// Copyright (c) 2015 Mark LaPerriere
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@marklap
marklap / syslogtest.go
Last active August 29, 2015 14:26
Very simple syslog test program
////////////////////////////////////////////////////////////////////////////////
// The MIT License (MIT)
//
// Copyright (c) 2015 Mark LaPerriere
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is