Skip to content

Instantly share code, notes, and snippets.

View jjmontesl's full-sized avatar

Jose Juan Montes jjmontesl

View GitHub Profile
################ NVIDIA DRIVER 440 INSTALLATION
# Install NVIDIA driver
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/440.64/NVIDIA-Linux-x86_64-440.64.run
chmod a+x NVIDIA-Linux-x86_64-440.64.run
sudo dpkg --add-architecture i386
sudo apt install lib32gcc1 build-essential dkms
sudo ./NVIDIA-Linux-x86_64-440.64.run --no-cc-version-check
# Reboot. Check that GPUs are visible using the command: nvidia-smi
################ NVIDIA CUDA 10.0 INSTALLATION
@pglazkov
pglazkov / webpack.config.js
Created October 17, 2017 12:50
Webpack.config.js for multiple applications
const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const apps = [
{
name: 'app1',
baseUrl: '/app1'
},
{
name: 'app2',
@ottokart
ottokart / word2vec-binary-to-python-dict.py
Last active July 25, 2019 22:41
Python script to convert a binary file containing word2vec pre-trained word embeddings into a pickled python dict.
# coding: utf-8
from __future__ import division
import struct
import sys
FILE_NAME = "GoogleNews-vectors-negative300.bin"
MAX_VECTORS = 200000 # This script takes a lot of RAM (>2GB for 200K vectors), if you want to use the full 3M embeddings then you probably need to insert the vectors into some kind of database
FLOAT_SIZE = 4 # 32bit float
@pklaus
pklaus / README.md
Last active June 2, 2020 22:36
Easterntimes Tech Wired Gaming Mouse T1

Easterntimes Tech - Wired Gaming Mouse T1

A script to change settings of the Wired Gaming Mouse T1 when running Linux.

@berlincount
berlincount / http-server.py
Last active December 20, 2022 21:22
Twisted HTTP server example
#!/usr/bin/env python
from twisted.web import server, resource
from twisted.internet import reactor, defer
from pprint import pprint
import base64
class DummyServer(resource.Resource):
isLeaf = True
@dave-newson
dave-newson / toggle-checkbox.js
Last active January 10, 2018 05:00
Bootstrap-toggle AngularJS directive
'use strict';
/**
* Bootstrap-toggle Directive
* @link https://github.com/minhur/bootstrap-toggle
*/
angular.module('toggleCheckbox', [])
.directive('toggleCheckbox', function() {
/**
# Autobahn client with auto-reconnect capability
# Totally based on https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/wamp/beginner/client.py
import sys
from twisted.python import log
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.internet.protocol import ReconnectingClientFactory
from autobahn.twisted import wamp, websocket
from autobahn.wamp import types
@bxt
bxt / proxy.py
Last active August 30, 2020 15:57
A very basic caching python HTTP proxy server.
# Originally from http://sharebear.co.uk/blog/2009/09/17/very-simple-python-caching-proxy/
#
# Usage:
# A call to http://localhost:80000/example.com/foo.html will cache the file
# at http://example.com/foo.html on disc and not redownload it again.
# To clear the cache simply do a `rm *.cached`. To stop the server simply
# send SIGINT (Ctrl-C). It does not handle any headers or post data.
import BaseHTTPServer
import hashlib
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@lymanlai
lymanlai / sftp-ubuntu.md
Created June 28, 2012 02:01 — forked from joshellington/sftp-ubuntu.md
Basic tutorial for creating a SFTP-only user on Ubuntu 9.04 and greater

Adding SFTP-only user to Ubuntu Server

To add a SFTP-only user, you'll need to make sure your SSH config settings are correct, add a new user/group and set permissions for your new user. For step-by-step directions, see below. Omit sudo if you're logged in as root.

Directions

  1. Edit /etc/ssh/sshd_config and make sure to add the following at the end of the file:

     Match group filetransfer
    

ChrootDirectory %h