Skip to content

Instantly share code, notes, and snippets.

View neilpanchal's full-sized avatar

Neil Panchal neilpanchal

View GitHub Profile
@neilpanchal
neilpanchal / .vimrc
Created January 19, 2021 06:14
RIP vim. I did try.
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" Neil's .vimrc file.
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set nocompatible " NEVER change this! Use Vim mode, not vi mode.
filetype plugin indent on " Enable automatic settings based on file type
syntax on " Enable colour syntax highlighting
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" Options
@neilpanchal
neilpanchal / sql_query_log_formatter.py
Created March 31, 2020 20:29
SQL Query Log Formatter
import logging
import sqlparse
class SQLFileHandler(logging.FileHandler):
def emit(self, record):
try:
record.msg = sqlparse.format(record.msg, reindent=True, keyword_case='upper')
except Exception:
pass
@neilpanchal
neilpanchal / ATSHA204.cpp
Created December 4, 2017 13:57 — forked from ghedo/ATSHA204.cpp
Arduino library for the ATSHA204 authentication chip
/*
* Arduino library for the ATSHA204 authentication chip.
*
* The ATSHA204 is a tiny and low-power authentication chip. This library
* implements a simple interface to access most of the chip functionality from
* an Arduino.
*
* Note that only the Single-Wire Interface (SWI) is currently supported.
*
* FEATURES:
@neilpanchal
neilpanchal / 7zip_auto_extract.ps1
Created August 4, 2017 22:17
7zip Double Click Extract Files
$7zInstallationFolder = 'C:\Program Files\7-Zip'
$reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::ClassesRoot, [Microsoft.Win32.RegistryView]::Default)
$subKeys = $reg.GetSubKeyNames() | where { $_ -match '7-Zip.' }
foreach ($keyName in $subKeys) {
$key = $reg.OpenSubKey($keyName + '\shell\open\command', $true)
$key.SetValue('', '"' + $7zInstallationFolder + '\7zG.exe" x "%1" -o*')
}
@neilpanchal
neilpanchal / nobloat.sh
Created August 3, 2017 02:16
Ubuntu 16.04 LTS Remove Bloatware Script
sudo apt-get remove account-plugin-aim account-plugin-facebook account-plugin-flickr account-plugin-jabber account-plugin-salut account-plugin-twitter account-plugin-windows-live account-plugin-yahoo aisleriot brltty colord deja-dup deja-dup-backend-gvfs duplicity empathy empathy-common evolution-data-server-online-accounts example-content firefox gnome-accessibility-themes gnome-contacts gnome-mahjongg gnome-mines gnome-orca gnome-screensaver gnome-sudoku gnome-video-effects gnomine landscape-common libreoffice-avmedia-backend-gstreamer libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk libreoffice-impress libreoffice-math libreoffice-ogltrans libreoffice-pdfimport libreoffice-presentation-minimizer libreoffice-style-galaxy libreoffice-style-human libreoffice-writer libsane libsane-common mcp-account-manager-uoa python3-uno rhythmbox rhythmbox-plugins rhythmbox-plugin-zeitgeist sane-utils shotwell shotwell-common telepathy-gabble tele
@neilpanchal
neilpanchal / gcloud-gpu-setup.sh
Created June 18, 2017 04:00 — forked from brookisme/gcloud-gpu-setup.sh
Google Cloud GPU Setup: Instructions & bash-script
#!/bin/bash
cd ~/
### CUDA
echo "\n\nChecking for CUDA and installing."
if ! dpkg-query -W cuda; then
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
sudo dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda -y
@neilpanchal
neilpanchal / setup_gcp.sh
Created June 17, 2017 05:52
GPU Setup on Google Cloud
# ensure system is updated and has basic build tools
sudo apt-get update
sudo apt-get --assume-yes upgrade
sudo apt-get --assume-yes install tmux build-essential gcc g++ make binutils
sudo apt-get --assume-yes install software-properties-common
# download and install GPU drivers
# see https://cloud.google.com/compute/docs/gpus/add-gpus#install-gpu-driver
echo "Checking for CUDA and installing."
@neilpanchal
neilpanchal / .r
Created April 13, 2017 09:00
set_theme error
$theme
List of 58
$ line :List of 6
..$ colour : chr "#6e6e6e"
..$ size : num 0.5
..$ linetype : num 1
..$ lineend : chr "butt"
..$ arrow : logi FALSE
..$ inherit.blank: logi TRUE
..- attr(*, "class")= chr [1:2] "element_line" "element"
==================================================
Getting Started With Matplotlib's OO Class Library
==================================================
Introduction
------------
For those people coming to Matplotlib without any prior experience
of MatLab and who are familiar with the basic concepts of
programming API's and classes, learning to use Matplotlib via the
@neilpanchal
neilpanchal / .bashrc
Created July 27, 2016 21:01
Neil Panchal's .bashrc file for server droplets
# Neil Panchal's Server .bashrc file
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;