Download an entire AWS S3 bucket or file

Writing by on Tuesday, 24 of March , 2015 at 5:32 am

AWS CLI to the rescue. It’s really quick and easy. Install AWS CLI, add your keys to the credentials and then fire away.

Here are some of mine

alias s3ls=’function _s3ls(){ aws s3 ls s3://”$@” ; }; _s3ls’
alias s3get=’function _s3get(){ aws s3 cp s3://”$@” . ; }; _s3get’
alias s3getdir=’function _s3getdir(){ aws s3 cp s3://”$@” . –recursive ; }; _s3getdir’

Leave a comment

Category: Tips and Tricks

Connect to a Linux Samba Share from your Mac

Writing by on Friday, 13 of March , 2015 at 7:48 pm

Pretty straightforward. If you don’t have a samba share here’s How to Create a Network Share Via Samba Via CLI (Command-line interface/Linux Terminal). So now you have a Samba Share on Linux.

Here’s a snippet of my /etc/samba/smb.conf that contains the Linux folder on my VM that I would like to access from the Mac. (In your Mac: it will show up under /Volumes/vm_codebase).
Of course you can ssh into your Linux env, but this is more like mounting onto your Mac.

[vm_codebase]
path = /home/shivdev/codebase
available = yes
valid users = shivdev
read only = no
browseable = yes
public = yes
writable = yes

From your Mac. Open Finder : Go –> Connect to Server… –> smb://vm –> Chose vm_codebase

Now you will see it under /Volumes/vm_codebase and is accessible like a regular folder.

Leave a comment

Category: Linux,Mac

sed: 1: “/etc/hosts”: extra characters at the end of h command

Writing by on Wednesday, 11 of March , 2015 at 4:11 am

I was trying a simple sed -i on my Mac and was running into

# Does NOT work on Mac
$ sed -i ‘s/^192.168.*vm/192.168.1.12 vm/’ /etc/hosts
sed: 1: “/etc/hosts”: extra characters at the end of h command

A quick google search resulted in stackoverflow getting sed error which has the solution. Apparently, Mac uses BSD sed and Linux uses GNU sed which have different set of arguments. So provide the extra argument in Mac as shown below.

# Adding the extra argument will work on your Mac
$ sed -i ” ‘s/^192.168.*vm/192.168.1.12 vm/’ /etc/hosts

Leave a comment

Category: Linux,Mac

Shivdev Kalambi's Blog

Shivdev Kalambi is a Software Development Manager, previously a Principal Software Engineer at ArcSight/HP. With over 16 years' experience in software development, he's worked on several technologies and played different roles and contributed to all phases of projects. Non-tech activies include Ping-pong, Rock Climbing and Yoga at PG, Golf, Skiing, Swimming & a beer enthusiast.