Skip to content

Instantly share code, notes, and snippets.

View pyautogui--move_mouse.py
#!/usr/bin/env python3
import pyautogui
import time
for i in range(3):
print(i)
pyautogui.moveTo(100, 100, duration=0.25)
pyautogui.moveTo(200, 100, duration=0.25)
View pyautogui--screen_shot.py
#!/usr/bin/env python3
import pyautogui
import time
###################################################################
# MacOS
def main():
@jftuga
jftuga / Test-is64bit.ps1
Created Feb 5, 2018
PowerShell Test-is64bit
View Test-is64bit.ps1
function Test-is64Bit {
param($FilePath)
[int32]$MACHINE_OFFSET = 4
[int32]$PE_POINTER_OFFSET = 60
[byte[]]$data = New-Object -TypeName System.Byte[] -ArgumentList 4096
$stream = New-Object -TypeName System.IO.FileStream -ArgumentList ($FilePath, 'Open', 'Read')
$stream.Read($data, 0, 4096) | Out-Null
@jftuga
jftuga / split.bat
Created Feb 14, 2018
Split a Windows Path into separate lines
View split.bat
@echo off
rem see also freq at: https://github.com/jftuga/universe/blob/master/freq.cs
rem see also mawk at: https://www.klabaster.com/freeware.htm
rem eample: dir ... | mawk .. | freq | less
dir "%1" /s/b | mawk "BEGIN{FS='\\';OFS='\n'} {$1=$1}1"
@jftuga
jftuga / lexar-improved.go
Last active Aug 21, 2018
Allow single quotes in goawk's printf family of functions
View lexar-improved.go
// Windows binary: https://github.com/jftuga/universe/tree/master/bin
//
// Package lexer is an AWK lexer (tokenizer).
//
// The lexer turns a string of AWK source code into a stream of
// tokens for parsing.
//
// To tokenize some source, create a new lexer with NewLexer(src) and
// then call Scan() until the token type is EOF or ILLEGAL.
//
@jftuga
jftuga / mping.cs
Last active Nov 30, 2018
multiping without admin privileges
View mping.cs
/*
* Mulithreaded ping that does not require admin privileges
* Give IPs and/or hostnames on command-line
* The ping timeout is hard-coded to 100 ms, but can be changed by updating: pingTimeOut
*/
using System;
using System.Net;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
@jftuga
jftuga / sherlock_sort.py
Last active Dec 25, 2018
Sort entries in Sherlock data.json file
View sherlock_sort.py
#!/usr/bin/env python3
# sort entries listed in https://github.com/sdushantha/sherlock/blob/master/data.json
import re
fname = "data.json"
site_re = re.compile('(".*?\},)',re.M|re.S)
name_re = re.compile('"(.*?)": \{')
@jftuga
jftuga / check_memory.ps1
Last active Mar 3, 2019
PowerShell check systems for processes using over 1 GB of memory
View check_memory.ps1
<#
check_memory.ps1
-John Taylor
Mar-3-2019
Interrogate all Windows systems listed in $disk_space_servers array for processes using over 1 GB
of 'WorkingSet64' memory and save the results to the file listed in $output
You can exclude "known processes" that will use more than 1 GB of memory by editing lines 32-35:
$over_mem_limit += ...
@jftuga
jftuga / vm_os.ps1
Created Mar 7, 2019
Get all VM Operating Systems with PowerCLI
View vm_os.ps1
$all | % { $_.Name + "`t" + $_.ExtensionData.Guest.GuestFullName } > vm.tsv
@jftuga
jftuga / tools.md
Created Mar 8, 2019
A few of my favorite things
View tools.md

I'd like to share with you some of my command-line tools that I have written to make my job easier. These are cross-platform (Windows, Linux, MacOS). I have also provided Windows binaries (usually found in a releases section). Most of my programs are either written in Python 3.5 or Go. My over-arching goal is to provide a self-contained, single binary or single .py file to maximize usability.


tcpscan

  • TCP Scan
  • A fast, simple, multi-threaded, cross-platform, IPv4 TCP port scanner

This is similar to nmap, but not nearly as feature rich. What I like about it is that it is just one file that I can use on any OS. It has a few features that nmap does not. If I want to scan all ports, I can use -p all instead of -p 1-65535. The -lo option will continually scan a port every second until it is open. Once opened, it will ring an audible bell and stop scanning. This is nice if I have to reboot a device and want to know when the service is back up and running.