Skip to content

Instantly share code, notes, and snippets.

View nicdoye's full-sized avatar
🚲
All shall be well, and all shall be well, and all manner of thing shall be well

Nic Doye nicdoye

🚲
All shall be well, and all shall be well, and all manner of thing shall be well
View GitHub Profile
Verifying that +nicdoye is my blockchain ID. https://onename.com/nicdoye
@nicdoye
nicdoye / Reboot.xml
Created September 21, 2016 13:50
Reboot scheduled task for Windows 2008r2. For those with finer grained security, you could use a lower-privileged account than Administrator.
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2016-09-20T11:25:05.3204</Date>
<Author>SOMESERVER\Administrator</Author>
<Description>Simple reboot task</Description>
</RegistrationInfo>
<Triggers>
<TimeTrigger>
<StartBoundary>2016-09-21T06:00:00</StartBoundary>
@nicdoye
nicdoye / lgrep.sh
Created October 11, 2016 14:47
Find a string in any file (note may include binaries) in the current folder, but exclude anything under a .git folder
function lgrep {
local str=$1
find . -type f -not -path '*/.git/*' -exec grep -l ${str} {} \;
}
# A quick alias for those of us without such a command
tiff2png ()
{
local ifile=$1
local ofile=$(dirname "${ifile}")/$(basename "${ifile}" .tiff).png
tifftopnm < "${ifile}"| pnmtopng > "${ofile}"
}
@nicdoye
nicdoye / google-dmarc-parser.rb
Created January 4, 2017 15:27
Parse GSuite DMARC Reports
#!/usr/bin/env ruby
require 'nokogiri'
require 'optparse'
require 'resolv'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: google-dmarc-parser.rb [options]"
@nicdoye
nicdoye / jira-regex.md
Created January 18, 2017 10:56
Replace JIRA project-numbers with Markdown Links in VS Code/regex

Replace JIRA Project numbers with links

Assuming

  1. your project prefix is EXAMPLE
  2. your JIRA installation is at https://example.com/jira then regex to match is
(EXAMPLE-(\d)*)
@nicdoye
nicdoye / gotcha.sh
Created February 8, 2017 17:30
bash gotcha
# This is what you'd expect - prints 1
declare var
var=$(false)
echo $?
# This does not do what you'd expect - prints 0
declare var2=$(false)
echo $?
@nicdoye
nicdoye / shrink-png.sh
Created February 14, 2017 10:41
Shrink a PNG file so you can make a custom emoji in Slack, using NetPBM
pngtopam -alphapam < filename.png | pamscale -xyfit 128 128 | pamtopng > filename-shrunk.png
@nicdoye
nicdoye / keybase.md
Created February 20, 2017 11:00
Ignore.

Keybase proof

I hereby claim:

  • I am nicdoye on github.
  • I am nicdoye (https://keybase.io/nicdoye) on keybase.
  • I have a public key ASB0JEma1L_Ga1DDnc5C5PjOQeUqdd-te4Byt53qpDDzFAo

To claim this, I am signing this object:

@nicdoye
nicdoye / config
Created March 4, 2017 17:48
A sample ssh config for bastions/gateways
# Your bastion host
Host bastion bastion.example.com
IdentityFile ~/.ssh/bastion-example-com.pem
Port 12345
User bastion-user
# Inside the VPC
Host host0.internal host1.internal