Skip to content

Instantly share code, notes, and snippets.

View zhiyue's full-sized avatar
🌻
just do it.

zhiyue zhiyue

🌻
just do it.
View GitHub Profile
@HouCoder
HouCoder / youtube-dl.sh
Last active March 2, 2022 16:37
A shell script for automatic downloading your YouTube playlist.
#!/bin/bash
# Use $ which youtube-dl to get the path.
youtube_dl_path=/usr/local/bin/youtube-dl
# https://askubuntu.com/a/157787
if ps aux | grep -v grep | grep $youtube_dl_path > /dev/null
then
echo "youtube-dl is running"
exit 1
anonymous
anonymous / v2ex.js
Created July 25, 2017 00:37
(function(){
if( location.hostname.indexOf('v2ex.com')+1 )
{
var list = function(nodelist){return Array.prototype.slice.call(nodelist);};
['DOMNodeInserted', 'DOMContentLoaded'].forEach(function(str){
window.addEventListener(str, function(e){
if( e.target.nodeType % 8 != 1 ) return;
// 处理每个楼层
list( e.target.querySelectorAll('div.cell[id^="r_"]') ).forEach(function(cell){
// 只在楼层第一次插入时处理,人工插楼后忽略
@purcell
purcell / iosevka
Last active June 13, 2020 16:35
Mac custom-build of Iosevka with Pragmata-like features
#!/bin/sh -e
# https://github.com/be5invis/Iosevka#build-your-own-style
DIR=~/Projects/External/iosevka
if [ -d "$DIR" ]; then
(cd $DIR && git pull)
else
git clone --depth 1 https://github.com/be5invis/Iosevka $DIR
fi
@rverton
rverton / chrome_headless_screenshot.py
Created July 10, 2017 08:53
Make a screenshot with a headless google chrome in python
# Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads
import os
from optparse import OptionParser
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROME_PATH = '/usr/bin/google-chrome'
@preytaren
preytaren / cleanup.py
Last active July 25, 2017 16:30
Helps you cleanup files in a specified folder, especially downloads. Re-group files in folders named by date it's created.
# -*- encoding= utf-8
“”“
“””
import os
import sys
import re
import shutil
import time
from collections import defaultdict
@alswl
alswl / hosts
Last active August 24, 2025 12:53
(deprecated, I bought xiaomi VIP)hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
@pohmelie
pohmelie / build-opencv-for-pyenv.py
Created April 26, 2017 14:46
Build opencv for ubuntu 16.04 with pyenv
import pathlib
import sys
import sh
def clone_if_not_exists(name, url, **kwargs):
if not pathlib.Path(name).exists():
print("Cloning", url, "...")
sh.git.clone(url, name, depth=1, **kwargs)
@mjdietzx
mjdietzx / waya-dl-setup.sh
Last active September 20, 2025 11:52
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
@dongweiming
dongweiming / send_message.py
Last active December 18, 2018 06:49
send_message.py
# coding=utf-8
# pip install zhihu_oauth
import os
import time
import json
@caputomarcos
caputomarcos / vm.md
Last active December 26, 2023 11:08
Create Manage VirtualBox VMs from the Command Line

Create/Manage VirtualBox VMs from the Command Line

Note to self, here’s a quick recipe for creating a Virtual Machine using the VirtualBox command line,

Create the VM,

    VBoxManage createvm --name "io" --register
    VBoxManage modifyvm "io" --memory 512 --acpi on --boot1 dvd
 VBoxManage modifyvm "io" --nic1 bridged --bridgeadapter1 eth0