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) | |
//} | |
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
// 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
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!"' |