Skip to content

Instantly share code, notes, and snippets.

@ravibhure
ravibhure / git_rebase.md
Last active June 4, 2024 15:02
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@osule
osule / how-to-python-packages.md
Created July 11, 2016 09:00
How to python packages

Setting up custom python packages

I know of one or more reported cases where python imports failed. Because python packages are arranged with reference to the file system structure, running a module that imports a package that is one-level up in the file hierarchy results in an ImportError.

This error can be resolved in any of the following ways:

  1. Export $PYTHONPATH variable in your terminal

export PYTHONPATH=.

@alces
alces / ansible_local_playbooks.md
Last active June 5, 2024 17:36
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
@nailgun
nailgun / ssh_key.yml
Created March 2, 2016 09:33
Ansible generate SSH key
---
- hosts: all
tasks:
- name: ensure SSH key is generated
command: ssh-keygen -t rsa -f /root/.ssh/id_rsa -N ''
args:
creates: /root/.ssh/id_rsa
@kosyfrances
kosyfrances / uninstall.txt
Created January 15, 2016 10:47
To uninstall what is not in requirements.txt
To uninstall what is not in requirements.txt
pip freeze | grep -v -f requirements.txt - | xargs pip uninstall -y
@gene1wood
gene1wood / 01_get_account_id_for_user_ec2instance_role_or_lambda.py
Last active November 9, 2022 16:40
Method to determine your AWS account ID using boto3 for either a user or an ec2 instance or lambda function
import boto3
print(boto3.client('sts').get_caller_identity()['Account'])
@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active May 25, 2024 20:06
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 8, 2024 05:20
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

@josephspurrier
josephspurrier / values_pointers.go
Last active May 28, 2024 07:30
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value