Skip to content

Instantly share code, notes, and snippets.

View hemanth22's full-sized avatar

Hemanth B hemanth22

View GitHub Profile

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)
@hemanth22
hemanth22 / gistToken.sh
Created September 13, 2018 10:41 — forked from 0xjjpa/gistToken.sh
Creating a GIST Token (Shell script)
#!/bin/bash
#Usage ./gistToken.sh USERNAME (don't forget to chmod+x it)
#Inspired in http://www.lornajane.net/posts/2012/github-api-access-tokens-via-curl
curl -v -u $1 -X POST https://api.github.com/authorizations --data "{\"scopes\":[\"gist\"]}"
@hemanth22
hemanth22 / README.md
Created October 2, 2018 12:49 — forked from saenzramiro/README.md
CI with Travis, github Releases API, gh-pages and npm publish

CI with Travis, GitHub Releases API and gh-pages

When hosting a project on GitHub, it's likely you'll want to use GitHub Pages to host a public web site with examples, instructions, etc. If you're not using a continuous integration service like Travis, keeping your gh-pages site up to date requires continuous wrangling.

The steps below outline how to use Travis CI with GitHub Releases and GitHub Pages to create a "1-button" deployment workflow. After testing and running a release build, Travis will upload your release assets to GitHub. It will also push a new version of your public facing site to GitHub Pages.

Organize your project

Let's assume you are hosting a JavaScript project that will offer a single JavaScript file as a release asset. It's likely you'll organize your files like this.

@hemanth22
hemanth22 / README-Template.md
Created October 6, 2018 08:07 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@hemanth22
hemanth22 / curl.md
Created October 6, 2018 10:03 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@hemanth22
hemanth22 / Vagrantfile
Created October 9, 2018 06:52 — forked from fsevero/Vagrantfile
Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "django-base"
config.vm.network "forwarded_port", guest: 8000, host: 8080
config.vm.synced_folder "shared", "/home/vagrant/shared"
end
@hemanth22
hemanth22 / vagrant.sh
Created October 9, 2018 06:52 — forked from tamirko/vagrant.sh
vagrant
vagrant plugin install vagrant-vbox-snapshot
...
vagrant up
...
vagrant snapshot take after-bootstrap-snapshot
vagrant ssh
# Once you're in the VM :
$ cd /root
# Do some stuff ...
@hemanth22
hemanth22 / Vagrant, FTP
Created October 9, 2018 06:55 — forked from miguelangelramirez/Vagrant, FTP
Vagrant FTP #vagrant #ftp
Vagrant's sftp to be available on port 2222. So, from Filezilla, I use:
host: 127.0.0.1 //or your projects IP
port: 2222
protocol: sftp
logon type: normal (with the default user and password being "vagrant")
## Vagrantfile
config.vm.provider :virtualbox do |vb|
# start windowed (default is headless)
vb.gui = true
vb.customize [ "modifyvm", :id, "--memory", "512"]
vb.name = "#{NAME}"
@hemanth22
hemanth22 / Vagrantfile
Created October 9, 2018 06:55 — forked from lorn/Vagrantfile
Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
vb.name = "app.intranet"
vb.customize [ 'modifyvm', :id, '--memory', '512' ]
vb.customize [ 'modifyvm', :id, '--cpus', '1' ]
end