This file contains hidden or 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 argparse | |
| import re | |
| from fractions import Fraction | |
| SPEED_OF_LIGHT = 300000000 # meters/second | |
| class Frequency: | |
| """ | |
| Converts given frequency to Hertz (Hz) |
This file contains hidden or 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
| SDK_VERSION=$1 | |
| SDK_NAME="MacOSX${SDK_VERSION}.sdk" | |
| TAR_FILE_NAME="${SDK_NAME}.tar.xz" | |
| DOWNLOAD_URL="https://github.com/phracker/MacOSX-SDKs/releases/download/MacOSX10.11.sdk/${TAR_FILE_NAME}" | |
| TAR_FILE_DEST="/tmp/${TAR_FILE_NAME}" | |
| SDK_MIN_VERSION_FILE="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist" | |
| SDK_DIR="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/" | |
| echo Downloading $SDK_NAME | |
| curl -L $DOWNLOAD_URL -o $TAR_FILE_DEST --progress-bar |
This file contains hidden or 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
| DESTINATION_FILE="/Users/$(id -un)/Library/Application Support/Wineskin/Wrapper/Wineskin-2.6.2.app/Wineskin.app/Contents/Resources/winetricks" | |
| curl https://raw.githubusercontent.com/Winetricks/winetricks/master/files/LATEST \ | |
| -o $DESTINATION_FILE \ | |
| && chmod +x $DESTINATION_FILE |
This file contains hidden or 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
| # W2.5.5v1EngineBase | |
| 1) put sdk 10.8 into the /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs | |
| 2) change MinimumSDKVersion at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist to 10.8 | |
| 3) update WineskinEngineBuilder's dependencies at /Users/<username>/Library/Application Support/Wineskin/EngineBase/W2.5.5v1EngineBase | |
| libxml2 -> libxml2 | |
| libpng14 -> libpng16 |
This file contains hidden or 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
| derkey = Popen(['openssl', 'rsa', '-pubout', '-outform', 'DER', '-inform', | |
| 'PEM', '-in', path_to_pem_key], stdout=PIPE).stdout.read() | |
| signature = Popen(['openssl', 'sha1', '-sha1', '-sign', path_to_pem_key, | |
| zip_file.filename], stdout=PIPE).stdout.read() | |
| with open('extension.crx', 'w') as crx: | |
| crx.writelines(['Cr24', | |
| struct.pack("<I", 2), # crx version | |
| struct.pack("<I", len(derkey)), | |
| struct.pack("<I", len(signature)), | |
| derkey, |
This file contains hidden or 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
| show () { | |
| if [ $(defaults read com.apple.finder AppleShowAllFiles) == NO ]; then | |
| SHOW=YES | |
| else | |
| SHOW=NO | |
| fi | |
| defaults write com.apple.finder AppleShowAllFiles $SHOW | |
| kill -1 `ps aucx | grep Finder | awk '{print $2}'` | |
| } |