Skip to content

Instantly share code, notes, and snippets.

@iamkissg
iamkissg / export_to_logseq.txt
Last active May 19, 2022 23:53
简悦通过定制 Markdown 导出至 Logseq #markdwon #simpread #logseq
title:: 【Reading Highlights】{{title}}
source:: {{url}}
summary:: {{note}}
tags:: [[简悦]] {{tags}} [[reading_highlights]]
date:: {{date_format|now|yyyyMMdd}}
{{#each}}
- > {{an_html}} {{an_tags}} ([🌐 摘要链接]({{an_org_uri}}))
{{ - 📝|an_note}}
@iamkissg
iamkissg / 全文.txt
Last active May 10, 2022 23:31
简悦自定义 Markdown 导出 #simpread #markdown
> [!md] **Metadata**
> **原文**:: [{{title}}]({{url}})
> **日期**:: {{create}}
> **标签**:: #simpread {{tags}}
> **反向链接**:: {{backlinks}}
> [!summary] **描述**
> {{desc}}
> [!note] **摘要**
@iamkissg
iamkissg / 标注.txt
Last active May 19, 2022 00:57
简悦 Markdown 增强导出配置 #simpread #markdown
<%
let colors = [ '#B4D9FB', '#ffeb3b', '#a2e9f2', '#a1e0ff', '#a8ea68', '#ffb7da' ],
color = colors[ annote.color ];
-%>
> [!<%= (annote.note? "note":"abstract")%>]+ <mark style="background-color: <%= color %>">Highlight</mark> [🧷](<{{an_int_uri}}>)[🌐](<{{an_ext_uri}}>) {{an_tags}}
{{{html_format|>|{{an_html}}}}}
<% if (annote.note) { -%>
{{> - 📝|an_note}}
<% } -%>
^sran-{{an_id}}
@iamkissg
iamkissg / linux_helpful_command_collection.md
Last active May 5, 2022 00:52
A collection of helpful linux commands

repeat line multiple times

perl -ne 'print $_ x 3' file
# or
!awk '{for (i = 1; i <= 3; i++) print $0}' file

Auto sync updates to Github

@iamkissg
iamkissg / install_ms_fonts_in_ubuntu.sh
Created May 28, 2019 19:52
Install Microsoft Windows Fonts In Ubuntu
sudo apt-get update
sudo apt-get install ttf-mscorefonts-installer
sudo fc-cache -f -v
@iamkissg
iamkissg / multi_cuda_single_machine.md
Last active May 30, 2019 13:35
Multiple CUDA Single Machine

How to maintain multiple CUDA versions in a single computer

Suppose we have already installed Nvidia GPU driver which should be equal to or newer than the required.

  1. Download cuda runfile (installer type: runfile (local)) from https://developer.nvidia.com/cuda-downloads
  2. Extract what we want: toolkit following the interactive prompt or sudo sh cuda-10.1.run --silent --toolkit --toolkitpath=/usr/local/cuda-10.1
    • To maintain a cudatoolkit with different versions of cudnn, we can name the dicrectory cuda-10.1_cudnn-v7.5
  3. Check the installation status
@iamkissg
iamkissg / batch_downloader.py
Created July 12, 2017 04:23
Batch Downloader
import logging
import os
import re
import sys
from urllib import urlretrieve
from urlparse import urljoin
import fire
import requests
@iamkissg
iamkissg / tookit.py
Last active April 11, 2017 07:17
Tookit for daily requirement
#
# A simple Toolkit for my daily requirement.
#
__author__ = "Engine"
__date__ = "2017-04-03"
import os
@iamkissg
iamkissg / img-converter.py
Last active April 14, 2017 06:06
Simple Image Converter
#
# Simple Image Converter for some simple usage.
#
__author__ = "Engine"
__date__ = "2017-04-01"
import string
@iamkissg
iamkissg / toggletouchpad.sh
Created March 31, 2017 13:02
Toggle touchpad (enable/disable) in Linux with xinput.
#!/bin/bash
#
# type cmd `xinput`, it shows my device X input information as follow
#
# ➜ ~ xinput
# ⎡ Virtual core pointer id=2 [master pointer (3)]
# ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
# ⎜ ↳ ETPS/2 Elantech Touchpad id=14 [slave pointer (2)]
# ⎣ Virtual core keyboard id=3 [master keyboard (2)]
# ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]