Skip to content

Instantly share code, notes, and snippets.

Working from home

Avinash Dalvi aviboy2006

Working from home
View GitHub Profile
alexdebrie /
Created Feb 1, 2019
Using boto3 generate_presigned_post()

Using an S3 presigned POST url.

  1. Copy the script to your machine.

  2. Update the BUCKET_NAME and KEY_NAME values in the script as needed.

  3. Run python It will spit some output like the following:

    $ python3

Upload images to GitHub

  1. Create a new issue on GitHub.

  2. Drag-and-drop an image onto the comment field.

  3. Wait for the upload process to finish.

  4. Copy the URL and use it in your Markdown files on GitHub.


Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
mandiwise / Count lines in Git repo
Last active Apr 20, 2021
A command to calculate lines of code in all tracked files in a Git repo
View Count lines in Git repo
// Reference:
$ git ls-files | xargs wc -l
yorkxin /
Last active Oct 27, 2020
Amazon S3 Redirect Rules Generator

Amazon S3 Redirect Rules Generator

A Ruby script to generate simple Amazon S3 Redirection Rules XML file.

Update: There is an app for that now! Use Amazon S3 Redirector (Web app) and you can generate the XML without any knowledge about Ruby. Thanks to @rainforestapp. BTW, It's open source too.


  • Nokogiri
adamawolf / Apple_mobile_device_types.txt
Last active Apr 21, 2021
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
View Apple_mobile_device_types.txt
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S