- Local dir to remote bucket sync
- Local dir to remote bucket copy with gzip content encoding header
- Remote to remote bucket copy
$ aws s3 sync \
# [RAILS_ROOT]/lib/tasks/sample.rake | |
desc "print hello world!" # description. | |
task "hello_world" do # rake task name. | |
p "hello world!" # print "hello world!" | |
end | |
namespace :myapp do | |
desc "import data from somewhere" | |
# load rails environment |
ffmpeg -f gif -i infile.gif outfile.mp4 |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
<?php | |
function get_private_key_for_public_key($public_key) { | |
// extract private key from database or cache store | |
return 'private_key_user_id_9999'; | |
} | |
// Data submitted | |
$data = $_GET['data']; | |
$data = json_decode(stripslashes($data), TRUE); |
# Connect to a server | |
redis-cli server | |
# Make an insert | |
set key value | |
# Make multiple insert |
public function add_business_days($datetime, $duedays) | |
{ | |
$i = 1; | |
while ($i <= $duedays) | |
{ | |
$next_day = date('N', strtotime('+1 day', $datetime)); | |
if ($next_day == 6 || $next_day == 7) | |
{ | |
$datetime = strtotime('+1 day', $datetime); | |
continue; |
<?php | |
namespace Acme\DemoBundle\Form\DataTransformer; | |
use Doctrine\ORM\EntityManager; | |
use Doctrine\ORM\PersistentCollection; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Symfony\Component\Form\DataTransformerInterface; | |
use Symfony\Component\Form\Exception\TransformationFailedException; |
# www.fduran.com | |
# sync (copy) local to remote server directory | |
# take out dry-run after test | |
rsync --dry-run -azvrh -e 'ssh -p 2022' --exclude 'donotcopy' /var/www/ [email protected]:/var/www/ | |
# options: | |
a: archive, preserve metadata | |
z: compression | |
v: verbose |