Skip to content

Instantly share code, notes, and snippets.

View Shivanshu-Gupta's full-sized avatar

Shivanshu Gupta Shivanshu-Gupta

View GitHub Profile
@Shivanshu-Gupta
Shivanshu-Gupta / track.py
Last active December 13, 2021 05:23
rich-progress-bar
# Usage:
# for _ in track(range(10), "Doing stuff..."):
# pass
from typing import Callable, Iterable, List, Optional, Sequence, Union
from rich.progress import ProgressType, Progress, TextColumn, ProgressColumn, BarColumn, TimeElapsedColumn, TimeRemainingColumn
from rich.style import StyleType
from rich.console import Console
def track(
@Shivanshu-Gupta
Shivanshu-Gupta / slideslive-downloader.py
Created December 12, 2021 08:26
slideslive-downloader
import os
import requests
# import selenium.webdriver as webdriver
import seleniumwire.webdriver as webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
URL = 'https://slideslive.com/embed/presentation/38969236?embed_parent_url=https%3A%2F%2Fnips.cc%2Fvirtual%2F2021%2Ftutorial%2F21891&embed_container_origin=https%3A%2F%2Fnips.cc'
DOWNLOADS_DIR = '/Users/shivanshu/Downloads/neurips/tut-structural-priors/'

How to Negotiate Industry Offers in AI by Rora - ICML 2021

Ways Offer Negotiations are Complex

Choosing the right job offer is a complex decision

  • Career growth requires choosing the right company, team, and manager in addition to your own effort. Every candidate should have an answer for:
    • How do you know
      • This company is on a growth trajectory?
  • This team within the company is influential/important?
# ---------------------------------------------------------------------------- #
# Python #
# ---------------------------------------------------------------------------- #
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
@Shivanshu-Gupta
Shivanshu-Gupta / gdrive_download
Created May 16, 2021 09:24 — forked from darencard/gdrive_download
Script to download files from Google Drive using Bash
#!/usr/bin/env bash
# gdrive_download
#
# script to download Google Drive files from command line
# not guaranteed to work indefinitely
# taken from Stack Overflow answer:
# http://stackoverflow.com/a/38937732/7002068
gURL=$1
@Shivanshu-Gupta
Shivanshu-Gupta / cloudSettings
Last active October 1, 2020 08:56
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-10-01T08:42:47.138Z","extensionVersion":"v3.4.3"}

X11 Forwarding using an SSH Reverse Tunnel

X11 Forwarding is very useful when you want to run GUI based applications on a remote machine. I needed it to run IntelliJ IDE on HPC. But while X11 forwarding can be easily enabled using the -X (or -Y) option of ssh, it doesn't work if xauth is not installed on the remote server - in my case the HPC compute nodes. In this case, ssh can be used to create a reverse tunnel from the remote server to the local machine. X11Forwarding can then be done by setting the display on the remote server as the entry port of the tunnel and making the X-server listen on the exit port of the tunnel in the local machine.

Here I'll describe how I went about creating a SSH reverse tunnel from HPC compute nodes to my local machine and used that to enable X11 Forwarding. As a prerequisite, I assume that a Display Manager that launches the X-server is installed on the local machine. Popular ones are XQuartz for macOS and XMing for Windows.

  1. Enable X11 forwarding on local machine.
@Shivanshu-Gupta
Shivanshu-Gupta / GitHub-Forking.md
Created January 7, 2018 15:28 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j