Skip to content

Instantly share code, notes, and snippets.

View SaqibHussain44's full-sized avatar

Saqib Hussain SaqibHussain44

View GitHub Profile
@SaqibHussain44
SaqibHussain44 / openshift-cheatsheet.md
Created September 25, 2022 08:26 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Openshift Secrets

"There are different secret types which can be used to enforce usernames and keys in the secret object: service-account-token, basic-auth, ssh-auth, tls and opaque. The default type is opaque. The opaque type does not perform any validation, and allows unstructured key:value pairs that can contain arbitrary values.

Data is stored inside a secret resource using base64 encoding. When data from a secret is injected into a container, the data is decoded and either mounted as a file, or injected as environment variables inside the container."

  • To create ssh secret:
@SaqibHussain44
SaqibHussain44 / NodeSDKSamples.js
Created July 2, 2021 18:13 — forked from DSDevCenter/NodeSDKSamples.js
DocuSign NODE SDK Examples - DocuSign eSignature REST API
const express = require('express');
const passport = require('passport');
var session = require('express-session');
var docusign = require('./src/index');
const app = express();
const port = process.env.PORT || 3000;
const host = process.env.HOST || 'localhost';
app.use(session({
@SaqibHussain44
SaqibHussain44 / vscode_shortcuts.md
Created April 28, 2021 17:28 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@SaqibHussain44
SaqibHussain44 / nginx.conf
Created August 22, 2020 08:29 — forked from micho/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
@SaqibHussain44
SaqibHussain44 / oc-install.md
Last active November 28, 2019 14:32
Openshift Installation Guide

Openshift cluster setup

Create Machines

For the purpose of this guide lets take these 5 machines

  • 1 master node
  • 1 infra node
  • 3 Compute nodes

Once machines are created, ensure that they're in the same subnet network and can talk to each other using hostnames

@SaqibHussain44
SaqibHussain44 / Dockerfile
Created November 16, 2019 10:57 — forked from alkrauss48/Dockerfile
Running a docker container as a non-root user
# By default, Docker containers run as the root user. This is bad because:
# 1) You're more likely to modify up settings that you shouldn't be
# 2) If an attacker gets access to your container - well, that's bad if they're root.
# Here's how you can run change a Docker container to run as a non-root user
## CREATE APP USER ##
# Create the home directory for the new app user.
RUN mkdir -p /home/app
@SaqibHussain44
SaqibHussain44 / vm-resize-hard-disk.md
Created October 30, 2019 05:39 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@SaqibHussain44
SaqibHussain44 / Vagrantfile
Last active July 18, 2019 06:26
Vagrant conda
Vagrant.configure("2") do |config|
config.vm.box = "continuumio/anaconda3"
config.vm.define "conda" do|conda|
conda.vm.hostname = "conda"
conda.vm.network "private_network", ip: "10.0.0.1"
end
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end

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)

Say I have 5 files: (file1, file2, ... file5).

All have been commited.

Say now all 5 files have been changed.

When you issue git status, all 5 files should be shown as (red) unstaged status.

Say I am happy with the changes in file1 to file4, but not file5 (i.e. I'd like to revert file5 to the last committed stage).