Skip to content

Instantly share code, notes, and snippets.

View gggauravgandhi's full-sized avatar
🤓
Something can always be better, nothing is ever complete 🚀

Gaurav gggauravgandhi

🤓
Something can always be better, nothing is ever complete 🚀
View GitHub Profile
@gggauravgandhi
gggauravgandhi / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Created February 23, 2018 12:03 — forked from whizzzkid/XPS-15 9560 Getting Nvidia To Work on KDE Neon
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev
@gggauravgandhi
gggauravgandhi / nginxproxy.md
Created April 11, 2018 08:14 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

#!/bin/bash
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me
PID=$(pgrep -u USER gnome-session-b)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
/usr/bin/gsettings set org.gnome.shell.extensions.user-theme name 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://WALLPAPER-PATH'
/usr/bin/gsettings --schemadir ~/.local/share/gnome-shell/extensions/drop-down-terminal@gs-extensions.zzrough.org set org.zzrough.gs-extensions.drop-down-terminal background-color 'rgb(69,90,100)'
@gggauravgandhi
gggauravgandhi / disp_multiple_images.py
Created December 19, 2018 14:27 — forked from soply/disp_multiple_images.py
Plot multiple images with matplotlib in a single figure. Titles can be given optionally as second argument.
import matplotlib.pyplot as plt
import numpy as np
def show_images(images, cols = 1, titles = None):
"""Display a list of images in a single figure with matplotlib.
Parameters
---------
images: List of np.arrays compatible with plt.imshow.
@gggauravgandhi
gggauravgandhi / knick-knack-bot.js
Last active August 14, 2019 09:28 — forked from jabczyk/knick-knack-bot.js
Consumes all knick-knacks in Your steam inventory
/**
* Knick Knack Steam Bot
*
* Consumes all knick-knacks in Your steam inventory
*
* - Go to https://steamcommunity.com/my/inventory#753_6
* - Wait for inventory to load
* - Press F12
* - Paste the code in console tab
*
@gggauravgandhi
gggauravgandhi / knick-knack-bot.js
Created January 2, 2019 16:22 — forked from TarasDev/knick-knack-bot.js
Consumes all knick-knacks in Your steam inventory
/**
* Knick Knack Steam Bot
*
* Consumes all knick-knacks in Your steam inventory
*
* - Go to https://steamcommunity.com/my/inventory#753_6
* - Wait for inventory to load
* - Press F12
* - Paste the code in console tab
*

Tips for a #WINNING Github Profile

The basics

As a new developer some potential employers are going to review your Github profile as part of the interview process. This doc covers some tips that should help you make a good impression. What this doc won't do is polish a turd.

README

Think of your experiences reviewing a Gem or other JS library on Github. Where do you look first? The README of course. What makes for a frustrating repo? One that doesn't:

  • include a README.
  • include install instructions (if applicable)
@gggauravgandhi
gggauravgandhi / express-jwt.js
Created February 19, 2021 08:13 — forked from vesse/express-jwt.js
Two Passport + JWT (JSON Web Token) examples
//
// Implementation using express-jwt middle
//
var express = require('express'),
ejwt = require('express-jwt'),
jwt = require('jsonwebtoken'),
passport = require('passport'),
bodyParser = require('body-parser'),
LocalStrategy = require('passport-local').Strategy,
BearerStrategy = require('passport-http-bearer').Strategy;
@gggauravgandhi
gggauravgandhi / reset-trial-navicat.sh
Created September 10, 2023 13:55 — forked from nakamuraos/reset-trial-navicat.sh
Reset trial Navicat 15, Navicat 16 on Linux
#!/bin/bash
# Author: NakamuraOS
# https://github.com/nakamuraos
# Latest update: 30/03/2022
# Tested on Navicat 15.x, 16.x on Linux
RED="\e[1;31m"
ENDCOLOR="\e[0m"
@gggauravgandhi
gggauravgandhi / navicat_reset_trial.sh
Created September 10, 2023 13:55 — forked from tuxity/navicat_premium_reset_trial.sh
Reset Navicat Premium 15/16 remaining trial days
#!/bin/bash
set -e
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
regex="CFBundleShortVersionString = \"([^\.]+)"
[[ $file =~ $regex ]]
version=${BASH_REMATCH[1]}