Skip to content

Instantly share code, notes, and snippets.

View ZeppLu's full-sized avatar

Zepp ZeppLu

  • Beijing, China
View GitHub Profile
@ZeppLu
ZeppLu / gw_ict_login.sh
Last active September 12, 2021 01:32
登录计算所内网
curl -X POST \
-F "action=login" \
-F "ac_id=1" \
-F "user_ip=10.18.1.1" \
-F "username=xxx" \
-F "password=***" \
-o /dev/null -w "%{http_code}\n" \
https://gw.ict.ac.cn/srun_portal_pc.php
@echo off
:: Licenses used for converting Office 365 ProPlus:
:: set _O365asO2019=0 -> use Office 2016 Mondo (if you want some Office 365 features)
:: set _O365asO2019=1 -> use Office 2019 ProPlus (should only be used for Windows 7 and 8.1)
set _O365asO2019=0
set _Debug=0
set "SysPath=%Windir%\System32"
if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative")

Tested on Jetson Nano, should work on any Jetson device with JetPack installed.

Modified from official Dockerfile.

Machine Learning

Change or unset http_proxy/https_proxy/ALL_PROXY, then

cd /
sudo -H ./pytorch.sh
sudo -H ./tensorflow.sh
@ZeppLu
ZeppLu / UCAS_live.js
Created March 28, 2020 13:19
点击智慧教室按钮,直接打开直播页面,再也无需繁琐的跳转与新窗口
// ==UserScript==
// @name UCAS Live Classroom Shortcut
// @name:zh-CN UCAS 智慧教室一键直达
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Zepp
// @match http://course.ucas.ac.cn/portal/site/*
// @match https://course.ucas.ac.cn/portal/site/*
// @grant none
@ZeppLu
ZeppLu / zhihu_cleaner.js
Last active July 20, 2021 09:41
清理知乎页面。清理内容:首页推荐的短视频、问题页面的“盐选推荐”回答。
// ==UserScript==
// @name Zhihu Cleaner
// @name:zh-CN 知乎界面清理
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.zhihu.com/*
// @grant none
// ==/UserScript==
@ZeppLu
ZeppLu / recursive_cjpeg.sh
Last active March 10, 2020 07:06
Recursively compress JPEG/PNG, requires mozjpeg & imagemagick
export IFS="
"
# You may want to add patterns like "*.bmp", "*.tiff", etc
for i in $(find . \( -iname "*.jpg" \
-o -iname "*.jpeg" \
-o -iname "*.png" \)); do
echo "Compressing $i"
convert "$i" pnm:- | cjpeg > "$i.comp"
mv "$i" "$i.trash"
\documentclass{article}
\usepackage[textwidth=5.6cm,paperwidth=10cm,paperheight=7cm]{geometry}
\usepackage{fontspec}
\usepackage{xcolor}
\setmainfont[ItalicFont={Goudy Old Style Bold Italic.otf}]{Goudy Old Style Bold.ttf}
\begin{document}
\setlength{\baselineskip}{1.5\baselineskip}
\pagecolor{black}
@ZeppLu
ZeppLu / h2y_to_v2ray.py
Created May 3, 2019 17:50
Convert the famous https://github.com/h2y/Shadowrocket-ADBlock-Rules to V2Ray routing rules, in JSON format.
#!/usr/bin/env python3
import json
import requests
# usage: ./h2y_to_v2ray.py > rules.json
# then open rules.json, there's a list of RuleObjects, copy N' paste, enjoy!
SR_CONF_URL = "https://raw.githubusercontent.com/h2y/Shadowrocket-ADBlock-Rules/master/sr_top500_banlist_ad.conf"
PROXY_TAG = "proxy"
@ZeppLu
ZeppLu / serve_http.py
Last active August 23, 2023 09:47
Simple Python HTTP Server with multi-threading, partial-content, basic authentication and IPv6 support
#!/usr/bin/env python3
# Standard library imports.
from socketserver import ThreadingMixIn
from http.server import HTTPServer, SimpleHTTPRequestHandler
import sys
import json
import os
from os.path import (join, exists, dirname, abspath, isabs, sep, splitext,
isdir, basename, expanduser, split, splitdrive)
@ZeppLu
ZeppLu / generate-konsole-entries.bash
Last active July 21, 2018 19:05
better desktop entries of konsole for HiDPI mode
#!/bin/bash
# key=src, value=dst
declare -A entries=(
# desktop file, used when you launch konsole from most of the launchers
["/usr/share/applications/org.kde.konsole.desktop"]="$HOME/.local/share/applications/org.kde.konsole.desktop"
["/usr/share/applications/org.kde.konsole.desktop"]="$HOME/.local/share/applications/org.kde.konsole.desktop"
# KDE only, used when you launch a shell script with konsole from dolphin
["/usr/share/kservices5/ServiceMenus/konsolerun.desktop"]="$HOME/.local/share/kservices5/ServiceMenus/konsolerun.desktop"
# KDE only, used when you click "Open konsole here" from dolphin's context menu