Skip to content

Instantly share code, notes, and snippets.

Michael Lynn pudquick

Block or report user

Report or block pudquick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pudquick
pudquick / get_serial.py
Created Sep 5, 2018 — forked from pdarragh/get_serial.py
Short PyObjC script to get a Mac's serial number without calling `system_profiler`.
View get_serial.py
#!/usr/bin/python
# (Note that we must use system Python on a Mac.)
####
# Quick script to get the computer's serial number.
#
# Written for @john.e.lamb on the MacAdmins Slack team.
import objc
import CoreFoundation
View tx_unpack.py
from Crypto.Cipher import AES
from Crypto.Util import Counter
import struct
"""
typedef struct boot_dat_hdr
{
unsigned char ident[0x10];
unsigned char sha2_s2[0x20];
unsigned int s2_dst;
@pudquick
pudquick / msqq.rb
Created Jul 31, 2017 — forked from peterc/msqq.rb
Sys V message queues in Ruby on OS X (take one)
View msqq.rb
# Lightweight library to access the System V message queue functionality on Mac OS X (32 and 64 bit)
# Still quite scrappy and needs to be packaged up properly but.. it works!
require 'fiddle'
class MsgQ
LIBC = DL.dlopen('libc.dylib')
IPC_CREAT = 001000
IPC_EXCL = 002000
@pudquick
pudquick / main.m
Created Jun 28, 2017 — forked from steventroughtonsmith/main.m
Load Mach-O executable at runtime and execute its entry point
View main.m
void callEntryPointOfImage(char *path, int argc, char **argv)
{
void *handle;
int (*binary_main)(int binary_argc, char **binary_argv);
char *error;
int err = 0;
printf("Loading %s\n", path);
handle = dlopen (path, RTLD_LAZY);
@pudquick
pudquick / Installation.md
Created Apr 21, 2017 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac
View Installation.md

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@pudquick
pudquick / google_chrome_update_checker.py
Last active Jan 22, 2017 — forked from bruienne/google_chrome_update_checker.py
Basic concept for querying for Google Chrome updates based on current Chrome version/OS/arch
View google_chrome_update_checker.py
#!/usr/bin/python
import xml.etree.ElementTree as ET
import requests
import uuid
params = {'cup2hreq': 'foo', 'cup2key': 'bar'}
platform = 'mac'
os_version = '10.12'
@pudquick
pudquick / flag_to_string.rb
Created Sep 5, 2016 — forked from djberg96/flag_to_string.rb
Trying to stringify filesystem flags
View flag_to_string.rb
require 'ffi'
class Filesystem
extend FFI::Library
ffi_lib FFI::Library::LIBC
attach_function(:strerror, [:int], :string)
attach_function(:getmntinfo64, [:pointer, :int], :int)
class Statfs < FFI::Struct
@pudquick
pudquick / Get-SSLThumbprint.ps1
Created May 22, 2016 — forked from lamw/Get-SSLThumbprint.ps1
Powershell snippet to help extract the SSL Thumbprint (SHA1) of a remote system
View Get-SSLThumbprint.ps1
Function Get-SSLThumbprint {
param(
[Parameter(
Position=0,
Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)
]
[Alias('FullName')]
[String]$URL
View gist:afebd759a1793e376585f4d61b73c333
Quick Instructions for Compiling under OS X
1. Install gcc from Homebrew and set the env variables + aliases:
export CC=/usr/local/bin/gcc-5
export CXX=/usr/local/bin/g++-5
export CPP=/usr/local/bin/cpp-5
export LD=/usr/local/bin/gcc-5
alias c++=/usr/local/bin/c++-5
alias g++=/usr/local/bin/g++-5
@pudquick
pudquick / FileBrowser.py
Created Jan 15, 2016 — forked from steventroughtonsmith/FileBrowser.py
File Browser for Pythonista
View FileBrowser.py
# coding: utf-8
from UIKit import *
from Foundation import *
from ctypes import *
libobjc = CDLL('/usr/lib/libobjc.dylib')
QLPreviewController = ObjCClass('QLPreviewController')
You can’t perform that action at this time.