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
| #!/bin/bash | |
| sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
| sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport |
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
| # Let us consider the following typical mysql backup script: | |
| mysqldump --routines --no-data -h $mysqlHost -P $mysqlPort -u $mysqlUser -p$mysqlPassword $database | |
| # It succeeds but stderr will get: | |
| # Warning: Using a password on the command line interface can be insecure. | |
| # You can fix this with the below hack: | |
| credentialsFile=/mysql-credentials.cnf | |
| echo "[client]" > $credentialsFile | |
| echo "user=$mysqlUser" >> $credentialsFile | |
| echo "password=$mysqlPassword" >> $credentialsFile |
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
| <?php | |
| private function set_password($raw_password) { | |
| /* | |
| Sets the password to a string of random sha1 salt | |
| and encrypted password. | |
| Separated by '$' | |
| */ | |
| $salt = substr(sha1(genRandomString().genRandomString()), 0, 5); | |
| $hash = sha1($salt.$raw_password); |