Skip to content

Instantly share code, notes, and snippets.

View cnu's full-sized avatar

Srinivasan Rangarajan cnu

View GitHub Profile
@cnu
cnu / with-nvidia-beta
Created October 18, 2019 04:21
journalctl -b output
-- Logs begin at Thu 2019-10-17 20:25:17 IST, end at Fri 2019-10-18 09:42:40 IST. --
Oct 18 09:40:05 archtop kernel: microcode: microcode updated early to revision 0xcc, date = 2019-04-01
Oct 18 09:40:05 archtop kernel: Linux version 5.3.6-arch1-1-ARCH (builduser@heftig-3261850) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Fri Oct 11 18:28:05 UTC 2019
Oct 18 09:40:05 archtop kernel: Command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=6eb7f4cc-f4bf-4290-99fc-bcb7e3547c66 rw resume=/dev/archtop/swap loglevel=3 quiet
Oct 18 09:40:05 archtop kernel: KERNEL supported cpus:
Oct 18 09:40:05 archtop kernel: Intel GenuineIntel
Oct 18 09:40:05 archtop kernel: AMD AuthenticAMD
Oct 18 09:40:05 archtop kernel: Hygon HygonGenuine
Oct 18 09:40:05 archtop kernel: Centaur CentaurHauls
Oct 18 09:40:05 archtop kernel: zhaoxin Shanghai
@cnu
cnu / download.go
Created December 2, 2018 19:23
Download files in Go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
### Keybase proof
I hereby claim:
* I am cnu on github.
* I am cnu (https://keybase.io/cnu) on keybase.
* I have a public key whose fingerprint is D707 EB5D D7F4 71BD 20E8 87F6 A05C BF23 45D5 E8EA
To claim this, I am signing this object:
@cnu
cnu / gist:6775442
Created October 1, 2013 08:31
URL regex
url_re = re.compile(r'''(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?''')
500 Internal Server Error
Sorry, something went wrong.
A team of highly trained monkeys has been dispatched to deal with this situation.
If you see them, show them this information:
UOZOfkwJzbFXCeFa0FaW1AHlaqCo7tPGvP_B7nxXB0xkggJrxUJkS2Fgqm7e
gOBldUH9WHQx_j0yJMG9PDRlzv5j4hRbQmIV3jXrSqj8Vfb3DyF5mOiyH5ti
FpFaRVjd_rnwZ6XlMJPx7EMB6c3jomiEJdpTCQ9punhYojpb7lRoTohhFjyZ
@cnu
cnu / .vimrc
Created March 10, 2013 02:52
Vimrc sachet and error message
set nocompatible
" Pathogen
call pathogen#infect()
call pathogen#helptags()
set statusline=%<\ %n:%f\ %m%r%y%=%-35.(line:\ %l\ of\ %L,\ col:\ %c%V\ (%P)%)
filetype plugin indent on
syntax on
@cnu
cnu / de.json
Created August 30, 2011 09:07 — forked from cramforce/de.json
lang.json
{
"locale": "de",
"text": {
"#authors": [
{
"name": "Malte Ubl",
"screen-name": "cramforce"
}
],
"tweet": {
def singularize(word):
"""Return the singular form of a word
>>> singularize('rabbits')
'rabbit'
>>> singularize('potatoes')
'potato'
>>> singularize('leaves')
'leaf'
>>> singularize('knives')