ACPI enumerates and lists the different DMA engines in the platform, and device scope relationships between PCI devices and which DMA engine controls them.
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 _XOPEN_SOURCE 700 | |
| #include <fcntl.h> /* open */ | |
| #include <stdint.h> /* uint64_t */ | |
| #include <stdio.h> /* printf */ | |
| #include <stdlib.h> /* size_t */ | |
| #include <unistd.h> /* pread, sysconf */ | |
| typedef struct { | |
| uint64_t pfn : 55; | |
| unsigned int soft_dirty : 1; |
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
| brew install pandoc | |
| brew tap homebrew/cask | |
| brew install --cask basictex | |
| eval "$(/usr/libexec/path_helper)" | |
| # Update $PATH to include `/usr/local/texlive/2020basic/bin/x86_64-darwin` | |
| sudo tlmgr update --self | |
| sudo tlmgr install texliveonfly | |
| sudo tlmgr install xelatex | |
| sudo tlmgr install adjustbox | |
| sudo tlmgr install tcolorbox |
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
| #include<linux/module.h> | |
| #include<linux/init.h> | |
| #include<linux/proc_fs.h> | |
| #include<linux/sched.h> | |
| #include<linux/uaccess.h> | |
| #include<linux/fs.h> | |
| #include<linux/seq_file.h> | |
| #include<linux/slab.h> | |
| static char *str = NULL; |
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
| # https://clang.llvm.org/docs/ClangFormat.html | |
| # https://clang.llvm.org/docs/ClangFormatStyleOptions.html | |
| --- | |
| Language: Cpp | |
| AlignAfterOpenBracket: Align | |
| AlignConsecutiveAssignments: false # although we like it, it creates churn | |
| AlignConsecutiveDeclarations: false | |
| AlignEscapedNewlinesLeft: true | |
| AlignOperands: true | |
| AlignTrailingComments: false # churn |
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
| wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1 | |
| # --no-check-cerftificate was necessary for me to have wget not puke about https | |
| curl -LJO https://github.com/joyent/node/tarball/v0.7.1 |
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
| #include <stdio.h> | |
| #include <pthread.h> | |
| #include <string.h> | |
| #include <sys/syscall.h> | |
| #include <sys/types.h> | |
| #include <assert.h> | |
| #include <sys/time.h> | |
| #define LOOPS 100000 |
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/python3 | |
| #coding:utf-8 | |
| import time | |
| from selenium import webdriver | |
| # enter username and password below | |
| jd_up={"ue":"***","pd":"***"} | |
| chrome=webdriver.Chrome() | |
| chrome.get(url="https://passport.jd.com/new/login.aspx?") | |
| chrome.find_element_by_xpath("//*[@id=\"content\"]/div/div[1]/div/div[3]/a").click() |
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
| # Install dependencies | |
| sudo apt install libcurl4-openssl-dev libip4tc-dev libiptc-dev autoconf libgmp3-dev libssl-dev pkg-config | |
| # Install StrongSwan | |
| wget http://download.strongswan.org/strongswan-5.6.1.tar.bz2 | |
| tar xjvf strongswan-5.6.1.tar.bz2 && cd strongswan-5.6.1 | |
| # FIXME: Some of these options may be redundant, but they work on my laptop. | |
| autoconf && ./configure \ | |
| --prefix=/usr/local \ |
NewerOlder