Skip to content

Instantly share code, notes, and snippets.

View suryasr007's full-sized avatar
🏠
Remote

Surya Teja suryasr007

🏠
Remote
  • Hyderabad, India
View GitHub Profile
@suryasr007
suryasr007 / multiple-ssh-keys-git.adoc
Created April 10, 2024 03:46 — forked from alejandro-martin/multiple-ssh-keys-git.adoc
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer <GITHUB PERSONAL ACCESS TOKEN>" \
https://api.github.com/repos/octocat/hello-world/dispatches \
-d '{"event_type":"event_type"}'
@suryasr007
suryasr007 / txt
Created March 6, 2019 18:14
DOCKER commands
FROM : Base docker image (Ubuntu, Nginx, python3)
CMD : to run commands
RUN : to run commands (can also be used to build docker images) (RUN apt-get install -y python)
ENTRYPOINT : Commands mentioned in ENTRYPOINT are executed as soon as image is built. It overwrites the CMD commands
ADD : To copy files from host to container
ENV : For ENVIRONMENT variables
WORKDIR : To set where the command in CMD is to be executed
EXPOSE : To associate a port number to enable networking between the running process
MAINTAINER :
USER : To specify the user to run the container.(USER UID)
@suryasr007
suryasr007 / tmux-cheatsheet.markdown
Created January 31, 2019 11:39 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@suryasr007
suryasr007 / The Technical Interview Cheat Sheet.md
Created November 26, 2018 20:55 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@suryasr007
suryasr007 / docker-help.md
Created August 15, 2018 16:01 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

def operations(operator, x, y):
return {
'add': lambda: x + y,
'sub': lambda: x - y,
'mul': lambda: x * y,
'div': lambda: x / y,
}.get(operator, lambda: None)()
>>> operations('mul', 2, 8)
16
# Looping can be done using dict.keys(), dict.values() and dict.items()
>>> knights = {'gallahad': 'the pure', 'robin': 'the brave'}
# Using items(), we can retrieve key as well as value for each item
>>> for k, v in knights.items():
print(k, v)
gallahad the pure
robin the brave
# Defining a dictionary
>>> tel = {'jack': 4098, 'sape': 4139}
# If dict keys are only string, we can define as below
>>> dict(sape=4139, guido=4127, jack=4098)
{'sape': 4139, 'jack': 4098, 'guido': 4127}
# Appending a new key value pair to the `tel` dict
>>> tel['guido'] = 4127
@suryasr007
suryasr007 / 0_reuse_code.js
Created March 11, 2017 03:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console