Skip to content

Instantly share code, notes, and snippets.

View hemenkapadia's full-sized avatar

Hemen Kapadia hemenkapadia

View GitHub Profile
@hemenkapadia
hemenkapadia / bootstrap.sh
Created September 30, 2019 20:16
[Ubuntu Bootstrap]
#!/bin/bash
# Check sudo.
# If credentials not already cached, ask for password and cache credentials.
# If already cached, increase sudo timeout by 5 min
sudo -v && exit 1 'Sudo access needed to execute this script'
# First update
echo "Updating apt list ...."
@hemenkapadia
hemenkapadia / pycharm_shortcuts_cheatsheet.md
Last active March 21, 2019 20:29
[Pycharm Cheatsheet] A cheatsheet for pycharm shortcuts an tricks #cheatsheet

Pycharm Shortcuts Cheatsheet

List of important shortcuts for pycharm

Navigation

Ctrl + B                        Navigate to the definition to the term under the cursor
Ctrl + Alt + left arrow         Navigate back to last location in code
@hemenkapadia
hemenkapadia / dotfiles_getting_started.md
Last active January 16, 2020 07:39
[Starting with dotfiles] Explains how to start with dotfiles

Dotfiles

Setting up dotfile from scratch

  • From Github UI console create a new repository called dotfiles and initialize it with a README.md and LICENSE (optional)
  • Install Git, Git SSH Keys and dotdrop using the setup install script.
  • Update PATH export PATH=${PATH}:${HOME}/.local/bin
  • Create a new repository dotfiles on github and initialize with readme
  • With Git available and ssh-agent populated with the github key, we clone the dotfiles repository git clone [email protected]:hemenkapadia/dotfiles.git in $HOME directory. This would only have your README and LICENSE (if selected) for now.
@hemenkapadia
hemenkapadia / 01. Build Process.md
Last active August 4, 2018 00:33
[Understanding conda build process] My notes at understanding how to use conda build for complicated projects #conda

@hemenkapadia
hemenkapadia / Linux Commands cheatsheet.sh
Last active May 17, 2019 16:59
[Linux Commands cheatsheet] A cheatsheet for Linux commands #linux #bash #cheatsheet
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@hemenkapadia
hemenkapadia / Shell Scripting Cheatsheet.md
Last active August 10, 2018 22:56 — forked from LeCoupa/bash-cheatsheet.sh
[Shell Scripting Cheatsheet] A collection of best practices and conventions to follow for shell scripts #bash #shell #shellscript #cheatsheet
@hemenkapadia
hemenkapadia / Ubuntu 18.04 with Nvidia+CUDA on Optimus Laptop.md
Last active January 13, 2022 07:15
[Ubuntu 18.04 with Nvidia+CUDA on Optimus Laptop] Setting up Ubuntu 18.04 with nvidia drivers and CUDA for data science on Dell 7559 Optimus laptop #Ubuntu #Nvidia #CUDA #setup

Kernel settings for installation

Use a live usb to try Ubuntu before installing. Boot from the live usb. On the GRUB screen highlight the "Try Ubuntu ...." option and press e. Update kernel parameters by adding options before quiet splash such that the line should read as below

nogpumanager nomodeset i915.modeset=1 quiet splash

Note: On HighDPI screen machines there is a known issue whereby Ubiquity (ubuntu installer) craashes at the copying files step i.e. immediatly after the user setup screen. The cause and workaround are discussed in other gist post

Persist GRUB configuration

Post installation, to avoid updating the above mentioned kernel options each time the system is booted, edit GRUB configuration file sudo vi /etc/default/grub and make th

@hemenkapadia
hemenkapadia / gist:f8731c75a2cacdd76386c9e1e9a6a13b
Last active May 16, 2018 03:51
Ubuntu 18.04 Installer (Ubiquity) crashes while copying files
While installing Ubuntu LTS on a laptop with HighDPI screen (and potentiall selecting Something Else option for the Installation type, ubuquity used to crash with the below error while copying files. This happens post the initial user creation details are provided.
The way to resolve this was to before starting the installation, we should Try ubuntu and in that modift the diaplay setting as shown below
@hemenkapadia
hemenkapadia / GRUB_Windows_Recovery.txt
Created May 7, 2018 08:11
Ubuntu - Recovering Windows boot when GRUB fails loading
Installing Ubuntu 18.04 resulted in an error with the Ubiquity process crashing while copying files. As a result files possibly were not copied on the drives as intended.
I tried following the GRUB recovery process mentioned at https://www.linux.com/learn/how-rescue-non-booting-grub-2-linux%20 but the /boot partition did not include the vmlinuz files hence this approach had to be abandoned
Had to revert to the process mentioned at https://www.easeus.com/partition-manager-software/fix-uefi-boot-in-windows-10-8-7.html and used the Windows recovery drive created earlier.
Followed the below process
2.1 Use diskpart to repair Windows 10/8 UEFI
@hemenkapadia
hemenkapadia / Qimo over lubuntu
Created February 24, 2018 23:30
Qimo over lubuntu
1 sudo apt-get update
2 sudo dpkg --configure -a
3 sudo apt-get update
4 sudo apt-get upgrade
5 clear
6 sudo -lshw -class network
7 sudo lshw -class network
8 lshw
9 sudo lshw
10 lshw -calss network