Skip to content

Instantly share code, notes, and snippets.

View akhilrs's full-sized avatar
👨‍💻
Focusing

Akhil R S akhilrs

👨‍💻
Focusing
View GitHub Profile
@akhilrs
akhilrs / configure_cuda_p70.md
Created May 18, 2020 05:00 — forked from alexlee-gk/configure_cuda_p70.md
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

Keybase proof

I hereby claim:

  • I am akhilrs on github.
  • I am akhilrs (https://keybase.io/akhilrs) on keybase.
  • I have a public key ASDNS3B4kCQ3PjeF9YV9SICgX_cfc_RZxkmsFDPam19vkgo

To claim this, I am signing this object:

@akhilrs
akhilrs / kolkata-zoom-14.py
Created September 25, 2017 01:42 — forked from iambibhas/kolkata-zoom-14.py
Downloads the OSM tiles and stiches them in a single image
#!/usr/bin/env python
# Generated by BigMap 2. Permalink: http://bigmap.osmz.ru/bigmap.php?xmin=12200&xmax=12231&ymin=7120&ymax=7143&zoom=14&scale=256&tiles=mapnik
import io, urllib2, datetime, time, re, random
from PIL import Image, ImageDraw
# ^^^^^^ install "python-pillow" package | pip install Pillow | easy_install Pillow
(zoom, xmin, ymin, xmax, ymax) = (14, 12200, 7120, 12231, 7143)
layers = ["http://tile.openstreetmap.org/!z/!x/!y.png"]
attribution = 'Map data (c) OpenStreetMap'
@akhilrs
akhilrs / kolkata-zoom-14.py
Created September 25, 2017 01:42 — forked from iambibhas/kolkata-zoom-14.py
Downloads the OSM tiles and stiches them in a single image
#!/usr/bin/env python
# Generated by BigMap 2. Permalink: http://bigmap.osmz.ru/bigmap.php?xmin=12200&xmax=12231&ymin=7120&ymax=7143&zoom=14&scale=256&tiles=mapnik
import io, urllib2, datetime, time, re, random
from PIL import Image, ImageDraw
# ^^^^^^ install "python-pillow" package | pip install Pillow | easy_install Pillow
(zoom, xmin, ymin, xmax, ymax) = (14, 12200, 7120, 12231, 7143)
layers = ["http://tile.openstreetmap.org/!z/!x/!y.png"]
attribution = 'Map data (c) OpenStreetMap'
@akhilrs
akhilrs / gist:d2b45b2b8b232c5557525db33f691a71
Created June 12, 2017 05:43 — forked from eyecatchup/gist:ba92d97c9b81f3b9fb95
Filter your own commit messages from git log and group by day. (Modified from http://stackoverflow.com/questions/2976665/git-changelog-day-by-day)
#!/bin/bash
AUTHOR=$(git config user.name)
DATE=$(date +%F)
git log --no-merges --format="%cd" --date=short --no-merges --author="$AUTHOR" --all | sort -u -r | while read DATE ; do
if [ $NEXT != "" ]
then
echo
echo [$NEXT]
fi
GIT_PAGER=cat git log --no-merges --format=" %s" --since=$DATE --until=$NEXT --author="$AUTHOR" --all
@akhilrs
akhilrs / nginx.conf
Created May 19, 2017 06:54 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@akhilrs
akhilrs / gist:8e6eb55b33347267865f9cb3a1552808
Created January 19, 2017 11:42 — forked from doofusdavid/gist:6072257
quick and dirty wordpress slug generator in excel for data import from an existing database.
=LOWER(CLEAN(SUBSTITUTE(TRIM(C2)," ","-")))
@akhilrs
akhilrs / styles.less
Created August 6, 2016 04:25 — forked from brandondurham/styles.less
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
@akhilrs
akhilrs / utcisoformat.py
Created May 5, 2016 08:54 — forked from bryanchow/utcisoformat.py
Convert Django DateTimeField values to ISO format in UTC
# Convert Django DateTimeField values to ISO format in UTC
# Useful for making Django DateTimeField values compatible with the
# jquery.localtime plugin.
#
# https://gist.github.com/1195854
from pytz import timezone, utc
from django.conf import settings