Skip to content

Instantly share code, notes, and snippets.

View ajaymahto's full-sized avatar
🎯
Focusing

Ajay Kumar Mahto ajaymahto

🎯
Focusing
  • Gurgaon, Haryana, India
View GitHub Profile
@ajaymahto
ajaymahto / default nginx configuration file
Created November 11, 2019 02:00 — forked from skbr1234/default nginx configuration file
The default nginx configuration file inside /etc/nginx/sites-available/default
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@ajaymahto
ajaymahto / ansible_local_playbooks.md
Created November 3, 2019 18:54 — forked from alces/ansible_local_playbooks.md
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@ajaymahto
ajaymahto / iterm2.md
Created May 9, 2019 07:25 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@ajaymahto
ajaymahto / README-linode-create.md
Created September 13, 2018 13:25 — forked from stewartadam/README-linode-create.md
A quick Python script that uses the Linode API to create, boot and delete Linodes. Supports an interactive mode that sends emails to users with their Linode credentials, great for providing temporary Linodes for a tutorial.

This is a little automation script I wrote to configure, boot and/or destroy Linodes using the Linode API. This script requires the Requires the linode-python module to wrap the API.

I had written this with the intent of providing users with a temporary Linode that would be destroyed after an hour or two, but the functions are pretty generic and could be repurposed. The interactive mode lets users enter their e-mail address, and upon confirmation sends them a message with their Linode's IP & password.

If you'd like to use this script as-is, you'll need to substitute in your Linode API key, SMTP server details and you will also likely have use the avail_foo() commands to grab the current IDs (e.g. for kernel release, distrubution, etc) and change the variables at the start of the script.