This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set-ExecutionPolicy Bypass -Scope CurrentUser # to further speedup powershell startup | |
$PROFILE_DIR = Split-Path -Path $PROFILE.CurrentUserAllHosts -Parent | |
$OLD = $PROFILE | |
$PROFILE = Join-Path $PROFILE_DIR "profile.ps1" | |
$PROFILE | Add-Member -NotePropertyName AllUsersAllHosts -NotePropertyValue $OLD.AllUsersAllHosts | |
$PROFILE | Add-Member -NotePropertyName AllUsersCurrentHost -NotePropertyValue $OLD.AllUsersCurrentHost | |
$PROFILE | Add-Member -NotePropertyName CurrentUserAllHosts -NotePropertyValue $PROFILE.ToString() | |
$PROFILE | Add-Member -NotePropertyName CurrentUserCurrentHost -NotePropertyValue $PROFILE.ToString() | |
Clear-Variable OLD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$help": "https://aka.ms/terminal-documentation", | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"actions": [], | |
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", | |
"initialCols": 140, | |
"initialRows": 30, | |
"profiles": | |
{ | |
"defaults": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
set -ev | |
echo -e "${GREEN}Downloading and installing nvidia repo${NC}" | |
wget http://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_10.0.130-1_amd64.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
try: | |
# Python 2.x | |
from SocketServer import ThreadingMixIn | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
from BaseHTTPServer import HTTPServer | |
except ImportError: | |
# Python 3.x | |
from socketserver import ThreadingMixIn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
def set_single_thread_envs(): | |
"""Better to set single thread for multi-process environment. | |
We need to do this before all import call""" | |
try: | |
import mkl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ev | |
# find the currently installed kernel module version | |
dkms status | |
# output example: | |
# bbswitch, 0.8, 4.9.70-040970-generic, x86_64: installed | |
# nvidia-418, 418.87.01, 4.9.70-040970-generic, x86_64: installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Unbuffered(object): | |
def __init__(self, stream): | |
self.stream = stream | |
def write(self, data): | |
self.stream.write(data) | |
self.stream.flush() | |
def writelines(self, datas): | |
self.stream.writelines(datas) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************* | |
* Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. | |
* | |
* See LICENSE.txt for license information | |
************************************************************************/ | |
#include <arpa/inet.h> | |
#include <errno.h> | |
#include <ifaddrs.h> | |
#include <net/if.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def extend_instance(obj, cls): | |
"""Apply mixins to a class instance after creation""" | |
base_cls = obj.__class__ | |
base_cls_name = obj.__class__.__name__ | |
obj.__class__ = type(base_cls_name, (cls, base_cls), {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
EMAIL=noreply@github.com | |
if [[ -z "$2" ]] | |
then | |
PPA_NUM="1" | |
else | |
PPA_NUM="$2" | |
fi |
OlderNewer