zsh
terminal
Add these lines in your ~/.bash_profile
file
# Show current git branch name
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
#!/bin/bash | |
if [ "$(whoami)" != "root" ] | |
then | |
echo "Sorry, you are not root." | |
exit 1 | |
fi | |
echo "Downloading the latest PhpStorm to /tmp" | |
cd /tmp |
{ | |
"name": "sikofitt/guzzle-example", | |
"description": "Guzzle Example", | |
"type": "project", | |
"require": { | |
"php":">=5.6", | |
"guzzlehttp/guzzle": "^6.2" | |
}, | |
"require-dev": { | |
"symfony/var-dumper": "^3.2", |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
desc "create empty parameters" | |
task :parameters_empty do | |
on roles(:all) do | |
if not test("[ -f #{shared_path}/app/config/parameters.yml ]") | |
upload! StringIO.new('---'), "#{shared_path}/app/config/parameters.yml" | |
end | |
end | |
end | |
desc "configure parameters with dist values if not defined" |
<?php | |
$url = 'http://www.example.com/a-large-file.zip'; | |
$path = '/path/to/a-large-file.zip'; | |
$fp = fopen($path, 'w'); | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_FILE, $fp); | |
$data = curl_exec($ch); |
# This crontab is automatically generated on deploy | |
SHELL=/bin/bash | |
[email protected] | |
RAILS_ENV=<%= stage %> | |
RAKE_CMD="<%= "#{bundle_path} rake --rakefile #{current_path}/Rakefile --trace" %>" | |
LOG_FILE="<%= "#{current_path}/log/cron.log" %>" | |
# Note: times are in the user's local time | |
<% if stage == :production && primary_server -%> |