This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARCHFLAGS='-arch i386 -arch x86_64' | |
rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes | |
curl -L -o ~/Downloads/RubyCocoa-1.0.5.tar.gz http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.5/RubyCocoa-1.0.5.tar.gz/download | |
cd ~/Downloads && tar xzf RubyCocoa-1.0.5.tar.gz && rm RubyCocoa-1.0.5.tar.gz && cd RubyCocoa-1.0.5 | |
rvm use 1.8.7 | |
ruby install.rb config --target-archs="x86_64" | |
ruby install.rb setup | |
sudo ruby install.rb install | |
rvm 1.8.7 do ruby -e 'require "osx/cocoa";OSX::NSLog "Cocoa should work now!"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# if someone is logged in | |
if who | grep -q console; then | |
# get the logged in user's uid | |
LOGGED_IN_UID=`ls -ln /dev/console | awk '{ print $3 }'` | |
# use the uid and pgrep to find the Finder process id | |
FINDER_PID=`pgrep -U ${LOGGED_IN_UID} Finder` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
account=`dsconfigad -show | awk '/Computer *Account/ { print $4 }'` \ | |
&& printf "Account: ${account}\nPassword: \ | |
`sudo security find-generic-password -a ${account} -w /Library/Keychains/System.keychain`\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works | |
package main | |
import ( | |
"fmt" | |
"golang.org/x/crypto/ssh" | |
) | |
const privateKey = `content of id_rsa` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -C -s | |
#pragma D option quiet | |
proc::posix_spawn:exec-success,proc::__mac_execve:exec-success | |
{ | |
this->isx64=(curproc->p_flag & P_LP64)!=0; | |
#define SELECT_64_86(x64, x86) (this->isx64 ? (x64) : (x86)) | |
#define GET_POINTER(base, offset) (user_addr_t)SELECT_64_86(*(uint64_t*)((base)+sizeof(uint64_t)*(offset)), *(uint32_t*)((base)+sizeof(uint32_t)*(offset))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Carbon | |
//guard let url = Bundle.main.url(forResource: "SendFinderMessage", withExtension: "scpt") else { | |
// exit(0) | |
//} | |
//guard let script = NSAppleScript(contentsOf: url, error: &errors) else { | |
// exit(0) | |
//} | |