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 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
# Author: Jay | |
# Date: 2023-01-24 | |
# Description: A mini web proxy to accelerate github access. | |
# Usage: python3 mini_web_proxy.py | |
# Note: You need to set up a http/https proxy first | |
import http.client | |
import http.server | |
import logging | |
import socketserver |
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
if [ "$#" != 1 ];then | |
echo "param error." | |
exit 0 | |
fi | |
ACCOUNT="" | |
PASSWORD="" | |
DOMAIN="" | |
SUBDOMAIN="" | |
RECORD_LINE="" | |
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
# This file must be used with "source bin/activate" *from bash* | |
# you cannot run it directly | |
deactivate () { | |
unset -f pydoc >/dev/null 2>&1 | |
# reset old environment variables | |
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all | |
if ! [ -z "${_OLD_PYTHONPATH+_}" ] ; then | |
PYTHONPATH="$_OLD_PYTHONPATH" |
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
#name : #ifndef XXX; #define XXX; #endif | |
# key: once | |
# -- | |
#ifndef ${1: `(upcase (subst-char-in-string ?. ?_ (subst-char-in-string ?/ ?_ (file-relative-name buffer-file-name (projectile-project-root)))))`_} | |
#define $1 | |
$0 | |
#endif // $1 |
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
(defun remove-line() | |
(delete-region | |
(progn (forward-visible-line 0) (point)) | |
(progn (forward-visible-line 1) (point)))) | |
(defun remove-guard() | |
(interactive) | |
(progn | |
(goto-char (point-min)) | |
(search-forward-regexp "^#ifndef") |
if you create a new wget child process "wget http://foo.bar", but redirect child stdin and stdout to the same pipe, wget will give you something like this
0K .......... .......... .......... .......... .......... 0% 105K 2h1m
50K .......... .......... .......... .......... .......... 0% 158K 1h41m
100K .......... .......... .......... .......... .......... 0% 302K 81m58s
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
function(PROTOBUF_GENERATE_PYTHON SRCS) | |
if(NOT ARGN) | |
message(SEND_ERROR "Error: PROTOBUF_GENERATE_PYTHON() called without any proto files") | |
return() | |
endif() | |
if(PROTOBUF_GENERATE_CPP_APPEND_PATH) | |
# Create an include path for each file specified | |
foreach(FIL ${ARGN}) | |
get_filename_component(ABS_FIL ${FIL} ABSOLUTE) |
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
tell application "Google Chrome" | |
set theURL to URL of active tab of window 1 | |
end tell | |
tell application "Safari" | |
open location theURL | |
activate | |
end tell |
NewerOlder