Skip to content

Instantly share code, notes, and snippets.

@iMerica
iMerica / identify_focus_issue.py
Created February 11, 2014 02:59
Identify which app or process is stealing focus on OSX
#!/usr/bin/python
from AppKit import NSWorkspace
import time
t = range(1,100)
for i in t:
time.sleep(3)
activeAppName = NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName']
print activeAppName
@schmurfy
schmurfy / gist:3199254
Created July 29, 2012 14:33
Install pandoc Mac OS X 10.8
# Install MacTex: http://mirror.ctan.org/systems/mac/mactex/mactex-basic.pkg
$ sudo chown -R `whoami` /usr/local/texlive
$ tlmgr update --self
$ tlmgr install ucs
$ tlmgr install etoolbox
# Install pandoc view homebrew
@vjo
vjo / send_mail.py
Created November 20, 2012 16:48
[Python] Send email with embedded image and application attachment
#! /usr/bin/python
import smtplib
from optparse import OptionParser
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.application import MIMEApplication
@songzhou21
songzhou21 / gist:f08ae73f917d2d81f835
Last active April 1, 2022 07:13 — forked from gereon/gist:3150445
Spotlight search source files

Mac OSX Spotlight Enhancement

Add this to Info.plist in /System/Library/Spotlight/RichText.mdimporter/Contents/ and Spotlight will search for source code files.

<string>public.c-header</string>
<string>public.c-plus-plus-header</string>
<string>public.c-source</string>
<string>public.objective-c-source</string>
public.c-plus-plus-source
@JensRantil
JensRantil / make_iap_request.py
Last active June 4, 2022 01:46
Make IAP requests from credentials JSON file.
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@opragel
opragel / forcefully_remove_mdm_1015.sh
Last active August 2, 2022 19:39
forcefully_remove_mdm_1015.sh
#!/bin/bash
# Seriously there still apparently aren't enough warning labels
# If you don't understand the consequences don't do it
REMOVE_PATHS=( # "/var/db/ConfigurationProfiles/.passcodePolicesAreInstalled"
# "/var/db/ConfigurationProfiles/.cloudConfigHasActivationRecord"
# "/var/db/ConfigurationProfiles/.cloudConfigNoActivationRecord"
# "/var/db/ConfigurationProfiles/.cloudConfigProfileObtained"
# "/var/db/ConfigurationProfiles/.cloudConfigRecordFound"
# "/var/db/ConfigurationProfiles/.profilesAreInstalled"
@godrm
godrm / EchoServer.swift
Last active November 9, 2022 22:25
EchoServer with Network.Framework
//
// EchoServer.swift
// CS16
//
// Created by JK on 2020/01/14.
// Copyright © 2020 codesquad. All rights reserved.
//
import Foundation
import Network
@bneg
bneg / SharpPick.cs
Last active November 27, 2022 20:56
/*
* SharpPick aka InexorablePoSH
* Description: Application to load and run powershell code via the .NET assemblies
* License: 3-Clause BSD License. See Veil PowerTools Project
*
* This application is part of Veil PowerTools, a collection of offensive PowerShell
* capabilities. Hope they help!
*
* This is part of a sub-repo of PowerPick, a toolkit used to run PowerShell code without the use of Powershell.exe
*/
@toolness
toolness / gencert.py
Last active June 22, 2023 11:52
Python script to create server SSL certs and sign them with a custom CA.
#! /usr/bin/python
"""
This simple script makes it easy to create server certificates
that are signed by your own Certificate Authority.
Mostly, this script just automates the workflow explained
in http://www.tc.umn.edu/~brams006/selfsign.html.
Before using this script, you'll need to create a private
@SukkoPera
SukkoPera / amiromsplit.py
Last active July 19, 2023 14:55
Split an Amiga ROM file into even/odd words
#!/usr/bin/env python
import os
import sys
import re
REGEXP = "AMIGA"
BUFSIZE = 4096
ODD_SUFFIX = "_odd_hi_uXa"
EVEN_SUFFIX = "_even_low_uXb"