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 | |
| namespace App\Http\Controllers\Auth; | |
| use App\Http\Controllers\Controller; | |
| use Illuminate\Foundation\Auth\ResetsPasswords; | |
| class PasswordController extends Controller | |
| { | |
| /* |
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
| // access the persistent file system | |
| window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) { | |
| // get the file named "config.json" | |
| fs.root.getFile("config.json", { create: false }, function(fileEntry) { | |
| // attempt to remove the file if it exists | |
| fileEntry.remove(function() { | |
| // delete successful | |
| console.info('Config file has been deleted successfully.'); |
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 | |
| // get list of files / directories, returns array | |
| SSH::getGateway()->getConnection()->nlist('.'); | |
| // get current working directory, returns string | |
| SSH::getGateway()->getConnection()->pwd(); | |
| // check for directory, returns boolean | |
| SSH::getGateway()->getConnection()->is_dir("Directory"); |
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 | |
| PIDFILE=/var/www/html/ajc.pid | |
| if [ -f $PIDFILE ] | |
| then | |
| PID=$(cat $PIDFILE) | |
| ps -p $PID > /dev/null 2>&1 | |
| if [ $? -eq 0 ] | |
| then |
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 | |
| # Shell Script to Update AWS EC2 Security Groups | |
| # Note that existing IP rules will be deleted | |
| # CONFIG - Only edit the below lines to setup the script | |
| # =============================== | |
| # AWS Profile Name | |
| profile="name1" |
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 | |
| namespace App\Http; | |
| use Illuminate\Foundation\Http\Kernel as HttpKernel; | |
| class Kernel extends HttpKernel | |
| { | |
| protected $middleware = [ | |
| // .. |
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 | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| class InputTrim | |
| { | |
| /** | |
| * Handle an incoming request. |
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 | |
| # replicate_db.sh (c) by Niraj Shah | |
| # replicate_db.sh is licensed under a | |
| # Creative Commons Attribution-ShareAlike 4.0 International License. | |
| # You should have received a copy of the license along with this | |
| # work. If not, see <http://creativecommons.org/licenses/by-sa/4.0/>. | |
| # https://www.webniraj.com/2017/01/13/replicating-a-remote-mysql-database-to-local-environment-server/ |
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 | |
| return [ | |
| 'default' => 'test', | |
| 'connections' => [ | |
| 'production' => [ | |
| 'host' => '111.111.111.111:22', | |
| 'username' => 'prod', |
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
| // see if file exists on remote | |
| SSH::into($env)->exists( 'path/on/remote/filename.extension' ); | |
| // upload file to remote | |
| SSH::into($env)->put( 'path/to/local/filename', 'path/on/remote/filename' ); | |
| // run a command - only works on SSH connections | |
| SSH::into($env)->run( 'shasum path/on/remote/filename.extension', function( $line ) { | |
| // display output of command, by line | |
| echo $line; |