Create simple arg parse in python

argparse is a module to make user-friendly command-line interfaces. It’s probably the one of the most frequently used module when I create a script in python that needs to parse some arguments. Check this out. $ vim test.py #!/usr/bin/python import argparse def init_args(): parser = argparse. ArgumentParser(description=”This is the description”) parser.add_argument(“–arg1”, required=True, type=str, help=”This is … Read more

Setup SSH key passphrase only ask once

Sometimes it’s annoying when you’re trying to work with your project and whenever you need to enter your key passphrase. So I wanna make this passphrase prompt ask only once. vim ~/.bash_profile and put this at the bottom of the file : eval $(ssh-agent) ssh-add Or if you don’t want to be asked for passphrase … Read more

Traceroute command line in ubuntu

This is how to install traceroute in ubuntu machine apt-get install traceroute And how to use it : $ traceroute google.com traceroute to google.com (74.125.68.100), 30 hops max, 60 byte packets 1 192.168.100.1 (192.168.100.1) 2.281 ms 2.378 ms 2.398 ms 2 61.5.80.1 (61.5.80.1) 9.254 ms 9.357 ms 9.378 ms 3 121.subnet125-160-11.speedy.telkom.net.id (125.160.11.121) 8.980 ms 8.966 … Read more

Mount samba share with command line

When you work with vagrant, you might want your project folder to be mounted on some directory on your local. You can do that easily with file manager, but here’s my favorite way to mount my samba share in vagrant to my directory on my local. So I can work on that. Before you do … Read more

Setup nginx, php, wordpress in ubuntu

So after all these years I’ve had using apache for run something that runs with php, but since I know about nginx, I’ve been using this webserver instead of apache. This wordpress blog is running with nginx and php-fpm, because not like apache that you can run anything about php without install the additional package. With … Read more