Skip to content

Instantly share code, notes, and snippets.

View dipsywong98's full-sized avatar
👶
Teletubbies say hello

Dipsy Wong dipsywong98

👶
Teletubbies say hello
View GitHub Profile

Installing Ubuntu on my Nvidia RTX2060 Laptop (Lenovo Legion Y7000SE)

Procrastinated for three years, I finally decided to buy my very first "first-hand" computer. Now I am bankrupted. I got it from the school's notebook ownership program which is rather worth it given the OP spec. With just 12000 HKD, I got 1TB SSD, Gen 9 i7 intel CPU core, Nvidia RTX 2060, 32GB RAM, HD screen, as well as a gigantic power supply yay~. As a professional IT dog, the very first thing I need to do is to install linux dual boot on it, but it has been cries and tears doing so. Took me several days TAT.

1. Install Nvidia Driver

I cant directly install from desktop images as it will enter a broken screen as the computer don't have Nvidia driver at fresh install.

Therefore I install ubuntu by first installing a ubuntu server, install the Nvidia driver manually, finally install the desktop.

Apollo Notes

Resolver

fieldName: (parent, args, context, info) => data;

Lazy query in graphql

Sometimes we are not interested in getting all values of a node, we can do some tricks to prevent loading extra contents or generating infinite circular structure. Below example the users have many books, and each book have one owner, which is a user again. How can we query the user without returning the books, or reuse the node resolver if we want to return the books?

Config root login for server

  1. add ssh public key to /root/.ssh/authorized_keys

  2. Refer to the following to set root login:

sudo -s (to become root)
vi /root/.ssh/authorized_keys
@dipsywong98
dipsywong98 / Setup-new-subdomain-on-NginX-with-redirected-SSL.md
Last active June 12, 2019 14:27
Setup new subdomain on NginX with redirected SSL
@dipsywong98
dipsywong98 / 路亞闖關(BETA)_ans.lua
Created October 27, 2018 16:00
路亞闖關(BETA)的答案
--play at http://tw.gamelet.com/mission.do?code=csArena&gltParam=%7B%27mode%27%3A%27userMission%27%2C+%27id%27%3A%27270136%27%7D
--請不要更改第1至第1行的程式碼
require "sys.game"
if level == nil then
--請在此初始化你的程式
elseif level == 1 then
--第一關目標:說出 hello world
@dipsywong98
dipsywong98 / 路亞闖關(BETA).lua
Created March 23, 2018 14:47
路亞闖關(BETA)的模板
--play at http://tw.gamelet.com/mission.do?code=csArena&gltParam=%7B%27mode%27%3A%27userMission%27%2C+%27id%27%3A%27270136%27%7D
--請不要更改第1至第1行的程式碼
require "sys.game"
if level == nil then
--請在此初始化你的程式
elseif level == 1 then
--第一關目標:說出 hello world
@dipsywong98
dipsywong98 / run_with_timeout.bat
Created January 6, 2018 05:06
php execute program with timeout using batch file in windows server
::param 1 is executable, param 2 is timeout seconds
echo "running %1 with timeout %2"
start %1
set time=0
:check
tasklist /FI "IMAGENAME eq %1" 2>NUL | find /I /N "%1">NUL
::time limit exceed
if "%time%"=="%2" goto kill
::program is running
if "%ERRORLEVEL%"=="0" ( ping 127.0.0.1 -n 2 >nul & set /a time=%time%+1 & goto check) else ( goto end)