Editing /etc/passwd won't work in iOS, so in order to change default shell in iOS you need to edit /etc/master.passwd. You can change root's default shell to bash like this -- root:/smx7MYTQIi2M:0:0::0:0:System Administrator:/var/root:/bin/bash.
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
| // For details, see | |
| // http://stackoverflow.com/questions/40261857/remove-nested-key-from-dictionary | |
| import Foundation | |
| extension Dictionary { | |
| subscript(keyPath keyPath: String) -> Any? { | |
| get { | |
| guard let keyPath = Dictionary.keyPathKeys(forKeyPath: keyPath) | |
| else { return nil } | |
| return getValue(forKeyPath: keyPath) |
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 Foundation | |
| import CFNetwork | |
| public class FTPUpload { | |
| fileprivate let ftpBaseUrl: String | |
| fileprivate let directoryPath: String | |
| fileprivate let username: String | |
| fileprivate let password: String | |
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
| func doGetWithBasicAuthCredential() -> Void { | |
| let username = "myUsername" | |
| let password = "myPassword" | |
| let credential = NSURLCredential(user: username, password: password, persistence: NSURLCredentialPersistence.ForSession) | |
| Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(username)/\(password)") | |
| .authenticate(usingCredential: credential) | |
| .responseString { _, _, result in | |
| if let receivedString = result.value |
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
| sudo apt-get update | |
| sudo apt-get install lua5.1 alsa-utils triggerhappy curl libcurl3 | |
| wget http://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20160322_all.deb | |
| wget http://archive.raspberrypi.org/debian/pool/main/r/rpi-update/rpi-update_20140705_all.deb | |
| dpkg -i raspi-config_20160322_all.deb | |
| dpkg -i rpi-update_20140705_all.deb |
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
| language: objective-c | |
| osx_image: xcode7.2 | |
| xcode_sdk: iphonesimulator9.2 | |
| env: | |
| global: | |
| - LANG=en_US.UTF-8 | |
| - WORKSPACE="YOUR_APP_WORKSPACE/YOUR_APP_PROJECT.xcworkspace" | |
| - SCHEME="YOUR_BUILDSCHEME" | |
| - APP_NAME="YOUR_APP_NAME" |
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
| // To check if a number is between a range, don't do | |
| if number >=0 && number <= 100 { | |
| } | |
| // Use range and news operators instead : | |
| if 0...100 ~= number { | |
| } |
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 Cocoa | |
| import Foundation | |
| var str = "Hello, playground" | |
| var task:NSTask = NSTask() | |
| var pipe:NSPipe = NSPipe() | |
| task.launchPath = "/bin/ls" | |
| task.arguments = ["-la"] |
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
| # You must first install apktool (https://github.com/iBotPeaches/Apktool) and android SDK | |
| # and decompile apk using it | |
| # apktool d -rf my-app.apk | |
| # then generate a key for sign in: | |
| # keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 | |
| rm signed-app.apk | |
| apktool b -f -d com.myapp | |
| jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore com.myapp/dist/com.myapp.apk alias_name | |
| zipalign -v 4 com.myapp/dist/com.myapp.apk signed-app.apk |