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
# View current Origin | |
cd /path/to/my/repo | |
git remote -v | |
git remote rm origin | |
# Add new Origin | |
$ cd /path/to/my/repo | |
$ git remote add origin ssh://[email protected]/username/myproject.git | |
$ git push -u origin master # to push changes for the first time |
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
# Note: This is for the Ubunutu 10.04 x64 image available on Digital Ocean | |
# and may not work for other images / OS versions. | |
# Warning: This script directy edits some configuration files that may | |
# render your OS unusable if there is an error. Use at your own risk. | |
useradd deploy | |
mkdir /home/deploy | |
mkdir /home/deploy/.ssh | |
chmod 700 /home/deploy/.ssh |
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
// Get config loader | |
$loader = $this->app['config']->getLoader(); | |
// Get environment name | |
$env = $this->app['config']->getEnvironment(); | |
// Add package namespace with path set base on your requirement | |
$loader->addNamespace('basset',__DIR__.'/../config/basset'); | |
// Load package override config 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
Route::filter('role', function() | |
{ | |
if(Auth::user()->role != 'admin') { | |
return Redirect::to('home'); | |
} | |
}); | |
Route::get('protectedPage1', array('before'=>'role', function() { | |
// do your job | |
})); |
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
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' |
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
#Git - force a pull to overwrite everything, on every pull | |
git fetch origin master | |
git reset --hard FETCH_HEAD | |
git clean -df |
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
cd /path_to_drupal_installation | |
chown -R www-data:www-data . | |
find . -type d -exec chmod u=rwx,g=rx,o=rx {} \; | |
find . -type f -exec chmod u=rw,g=r,o=r {} \; |
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
backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql | |
restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql |
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
# Disable | |
defaults write com.apple.dashboard mcx-disabled -boolean YES | |
killall Dock | |
# Enable | |
defaults write com.apple.dashboard mcx-disabled -boolean NO | |
killall Dock |
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
:1,$d |