Skip to content

Instantly share code, notes, and snippets.

@scootcho
scootcho / skylake-tuning-linux.md
Created February 15, 2020 01:47 — forked from Brainiarc7/skylake-tuning-linux.md
This gist will show you how to tune your Intel-based Skylake, Kabylake and beyond Integrated Graphics Core for performance and reliability through GuC and HuC firmware usage on Linux.

Tuning Intel Skylake and beyond for optimal performance and feature level support on Linux:

Note that on Skylake, Kabylake (and the now cancelled "Broxton") SKUs, functionality such as power saving, GPU scheduling and HDMI audio have been moved onto binary-only firmware, and as such, the GuC and the HuC blobs must be loaded at run-time to access this functionality.

Enabling GuC and HuC on Skylake and above requires a few extra parameters be passed to the kernel before boot.

Instructions provided for both Fedora and Ubuntu (including Debian):

Note that the firmware for these GPUs is often packaged by your distributor, and as such, you can confirm the firmware blob's availability by running:

@scootcho
scootcho / default
Created February 11, 2020 07:21
nginx default file at /etc/nginx/sites-available/default on Ubuntu 18.04
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@scootcho
scootcho / js - knex_bulkupdate
Created November 24, 2019 08:36 — forked from luc0/js - knex_bulkupdate
Node.js ( knex / bootshelf helper)
'use strict';
/*
CUSTOM METHODS TO EXTEND ORM
*/
module.exports = {
/*
var instance = new orm.bulkUpsert({
knex: knex,
model: 'modelName',
@scootcho
scootcho / Common-Currency.json
Created November 13, 2019 03:27 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@scootcho
scootcho / example-service.js
Created November 12, 2019 03:00
umi-request ant design pro request setting
import request from '@/utils/request';
// 测试登录
export async function Login(params) {
// params 来自于effects中参数
// 对应rest接口,/server/api/用的是config.js中proxy代理。详细配置在config.js中配置。
return request('/server/api/web/rest/UserRest/login', {
// 请求方式
method: 'POST',
@scootcho
scootcho / httpstatuses.json
Created November 2, 2019 15:23
HTTP Status Codes JSON
{
"100": "Continue",
"101": "Switching Protocols",
"102": "Processing",
"200": "OK",
"201": "Created",
"202": "Accepted",
"203": "Non-authoritative Information",
"204": "No Content",
"205": "Reset Content",
@scootcho
scootcho / statuses.md
Created November 2, 2019 15:06 — forked from vkostyukov/statuses.md
HTTP status codes used by world-famous APIs
API Status Codes
[Twitter][tw] 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504
[Stripe][stripe] 200, 400, 401, 402, 404, 429, 500, 502, 503, 504
[Github][gh] 200, 400, 422, 301, 302, 304, 307, 401, 403
[Pagerduty][pd] 200, 201, 204, 400, 401, 403, 404, 408, 500
[NewRelic Plugins][nr] 200, 400, 403, 404, 405, 413, 500, 502, 503, 503
[Etsy][etsy] 200, 201, 400, 403, 404, 500, 503
[Dropbox][db] 200, 400, 401, 403, 404, 405, 429, 503, 507
@scootcho
scootcho / authentication_with_express_postgres.md
Created October 26, 2019 23:41 — forked from laurenfazah/authentication_with_express_postgres.md
Authentication with an Express API and Postgres

Authentication with an Express API and Postgres

Setting Up

Let's make sure our Express app has the required base modules:

# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
@scootcho
scootcho / authentication_with_express_postgres.md
Created October 26, 2019 23:41 — forked from laurenfazah/authentication_with_express_postgres.md
Authentication with an Express API and Postgres

Authentication with an Express API and Postgres

Setting Up

Let's make sure our Express app has the required base modules:

# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
@scootcho
scootcho / .vimrc
Last active October 19, 2019 01:14
minimal vimrc to use for server consoles
" remap jj to escape in insert mode
" General
set number " Show line numbers
set linebreak " Break lines at word (requires Wrap lines)
set showbreak=+++ " Wrap-broken line prefix
set textwidth=100 " Line wrap (number of cols)
set showmatch " Highlight matching brace
set visualbell " Use visual bell (no beeping)