Skip to content

Instantly share code, notes, and snippets.

View imfing's full-sized avatar
✌️

Xin imfing

✌️
View GitHub Profile
@imfing
imfing / build-ray-aarch64.md
Created October 22, 2022 17:40
Build Ray Python wheel for Linux aarch64

Building Ray Python Wheel for aarch64

I used a EC2 A1 instance (a1.2xlarge) with Ubuntu 20.04 (arm64)

$ lscpu
Architecture:                    aarch64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
CPU(s):                          8
@imfing
imfing / realpython_registration_blocker.js
Created April 19, 2022 01:27
Tampermonkey script to block registration on realpython.com
// ==UserScript==
// @name Realpython Popup Remover
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Block realpython registration
// @author You
// @match https://realpython.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=realpython.com
// @grant none
// ==/UserScript==
@imfing
imfing / frpc.ini
Created February 21, 2019 03:26
frp configuration
# 指定服务端参数
[common]
server_addr = 115.159.0.167
server_port = 7000
# ssh端口设置
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
@imfing
imfing / dynamic_svg.md
Last active April 22, 2021 06:44
Using inline SVGs in Vue components

An alternative way to implement "dynamic" svg is using html-loader.

First, create a component for svg, SvgIcon.vue:

<template>
  <div v-html="require(`../../assets/icon-${icon}.svg`)"></div>
</template>

<script>
export default {
@imfing
imfing / wsl-setup.md
Last active September 15, 2023 01:55
WSL + ZSH + Hyper Setup

My WSL Setup

A guide to setup your WSL with Hyper and zsh

Download & Install the WSL

  • Follow the very thorough instructions here

Get a prettier terminal

  • Download Hyper.js here - I went with the 'hyperblue' theme.
@imfing
imfing / vimrc
Created August 27, 2018 00:21
Basic vimrc for server
"==========================================
" Original: https://github.com/wklken/vim-for-server
"==========================================
" leader
let mapleader = ','
let g:mapleader = ','
" syntax
syntax on
@imfing
imfing / ngrok.md
Last active January 24, 2018 05:05
Ngrok内网穿透配置

准备公网域名 创建两个A记录ngrok*.ngrok到云主机的IP

在系统上安装Go,最好不要安装在/usr/local/下,会有很多权限问题,直接安装在home目录下即可

注意对应下载相应系统的版本

参考的配置,其中GOPATH不用管:

GOPATH="/home/ubuntu/go"
@imfing
imfing / Ubuntu16.04配置经验.md
Created September 29, 2017 05:04
Ubuntu Configure for Deep Learning

Ubuntu相关Path的目录

Ubuntu Linux系统环境变量配置文件: /etc/profile : 在登录时,操作系统定制用户环境时使用的第一个文件 ,此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行。 /etc /environment : 在登录时操作系统使用的第二个文件, 系统在读取你自己的profile前,设置环境文件的环境变量。 ~/.profile : 在登录时用到的第三个文件 是.profile文件,每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件。 /etc/bashrc : 为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取. ~/.bashrc : 该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该该文件被读取。

安装Nvidia驱动及CUDA8.0

可以直接在系统设置中的Additional Drivers里面安装375版本

@imfing
imfing / Jupyter.md
Last active September 15, 2017 16:34
Installing Jupyter for Python 2.7 on Ubuntu

If you want to install jupyter with Python 2.7.x pip install jupyter

You'll get errors like:


 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.

 Beginning with IPython 6.0, Python 3.3 and above is required.
@imfing
imfing / Math Expression Parser.c
Created July 21, 2017 03:48
Parse math expression with c
/**
*Math Expression Parser
*
*Author: Fing
*
*First Created: 2015.12.13
*
*/
#include "stdio.h"