In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
This file contains hidden or 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
| function LRU(limit) { | |
| this.limit = limit || 1000; | |
| this.map = new Map(); | |
| } | |
| LRU.prototype.has = function(key) { | |
| return this.map.has(key); | |
| } | |
| LRU.prototype.set = function(key, value) { |
This file contains hidden or 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
| // Define your components like: | |
| class MyComponent extends React.Component { | |
| static fetchData = (params) => { | |
| // return an action here. | |
| }; | |
| /* ... */ | |
| } | |
| function fetchComponentData(component, store, params) { |
This file contains hidden or 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
| sudo apt-get install libgnome-keyring-dev | |
| cd /usr/share/doc/git/contrib/credential/gnome-keyring | |
| sudo make | |
| sudo ln -s /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring /usr/lib/git-core/ |
This file contains hidden or 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
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |
This file contains hidden or 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
| public class TransformingMatcher<U, T> extends TypeSafeMatcher<U> { | |
| private final Matcher<T> base; | |
| private final Function<? super U, ? extends T> function; | |
| public TransformingMatcher(Matcher<T> base, Function<? super U, ? extends T> function) { | |
| this.base = base; | |
| this.function = function; | |
| } | |
| @Override |
This file contains hidden or 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 logging | |
| from traceback import format_exc | |
| import datetime | |
| from schedule import Scheduler | |
| logger = logging.getLogger('schedule') |
This file contains hidden or 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/python | |
| # Connects to servers vulnerable to CVE-2014-0160 and looks for cookies, specifically user sessions. | |
| # Michael Davis ([email protected]) | |
| # Based almost entirely on the quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
| # The author disclaims copyright to this source code. | |
| import select |
This file contains hidden or 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
| /* | |
| Copy doc JSON exporter for Google Drive spreadsheets. | |
| Instructions: | |
| 1. Open the copy doc spreadsheet | |
| 2. Make sure the first row contains a column with the value “id” and that there’s at least one column with a locale value | |
| 2. Go to Tools/Script Editor… | |
| 3. (Optional) create a new script file and name it something funny | |
| 4. Paste the code from this file |