Skip to content

Instantly share code, notes, and snippets.

View zxteloiv's full-sized avatar

Haruki Kirigaya zxteloiv

View GitHub Profile
@Mahedi-61
Mahedi-61 / cuda_11.8_installation_on_Ubuntu_22.04
Last active June 12, 2024 10:40
Instructions for CUDA v11.8 and cuDNN 8.9.7 installation on Ubuntu 22.04 for PyTorch 2.1.2
#!/bin/bash
### steps ####
# Verify the system has a cuda-capable gpu
# Download and install the nvidia cuda toolkit and cudnn
# Setup environmental variables
# Verify the installation
###
### to verify your gpu is cuda enable check
@bao3
bao3 / GFW_ADBlock.conf
Last active March 3, 2024 06:10
由于 Surge for ios 的条目数量不能过大,导致手机内存不足,所以将 GFW 和 广告过滤集中后进行了人工挑选,压缩在 1万条左右,你仍然可以自己添加大约 900条规则,理论上足够你长久使用了,配置文件默认是直连,方便普通国内用户使用。配置文件中,我自己调整过的、有可能有误伤的条目我都放在了前面,方便你自己修改,不过运行自 2016/01 ~ 2016/02 我自己日常没有遇到问题。有误伤不要怕,打开软件可以自己调试添加。
[General]
#我的注释都是 # 开头,所以如果你用 vim,直接 :g/^#/d 就可以一次性清除所有注释
#开头这段skip包含以下几个目的:1,私网IP跳过,提高内网性能;2,苹果的一些服务跳过,比如公共热点wifi要先测试captive.apple.com。可解决很多内网的 TCP毛病,例如 kodi remote软件无法遥控
skip-proxy = 10.0.0.0/8,169.254/16,172.16.0.0/12,192.168.0.0/16,224.0.0.0/4, localhost, *.local,api.smoot.apple.com,configuration.apple.com,xp.apple.com,smp-device-content.apple.com,guzzoni.apple.com,captive.apple.com,*.ess.apple.com,*.push.apple.com,*.push-apple.com.akadns.net
#下面这一段则是完全跳过 Surge,最重要的一个是让 UDP包可以传输,解决很多内网毛病,例如DLNA,NFS或者btsync等组播类/UDP类应用
bypass-tun = 10.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.168.0.0/16, 224.0.0.0/4, 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 5
@yaqinking
yaqinking / RestartBluetooth.scpt
Created February 14, 2016 08:27
重启 Mac 蓝牙来解决 iOS 端 AirDrop 不能发现 Mac 设备
-- 有时候 Mac 的 AirDrop 会在 iOS 端发现不了,当窝发觉这个 bug 可以通过重启 Mac 蓝牙解决的时候,Google 加折腾找到了这个脚本的前半部分,经过修改,直接生成重启蓝牙的大法,解决问题,可喜可贺,可喜可贺(圆润的滚走
-- 如果还是在 iOS 端发现不了,那就关闭 iOS 端的 AirDrop 然后再开启,所谓的重启 iOS 端 AirDrop 大法诞生。
-- 至于 AirDrop 的用途,当然是拿来发 DL 链接 <_<
-- 脚本参考地址:https://apple.stackexchange.com/questions/152333/toggle-bluetooth-applescript-not-working-in-yosemite
property thePane : "com.apple.preferences.bluetooth"
tell application "System Preferences"
activate
set the current pane to pane id thePane
# -*- coding: utf8 -*-
"""Convex factorization machines
Implements the solver by: Mathieu Blondel, Akinori Fujino, Naonori Ueda.
"Convex factorization machines". Proc. of ECML-PKDD 2015
http://www.mblondel.org/publications/mblondel-ecmlpkdd2015.pdf
"""
# Author: Vlad Niculae <vlad@vene.ro>
# License: Simplified BSD
@karpathy
karpathy / min-char-rnn.py
Last active June 28, 2024 06:13
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@wecing
wecing / Monoid.cpp
Created May 3, 2015 07:10
Sum and Product monoid in C++
#include <iostream>
#include <cstdlib>
#include <memory>
#include <vector>
#include <string>
template<typename M, typename T>
class SemiGroup {
protected:
T m_t;
@stephenmcd
stephenmcd / parallel_merge_sort.py
Last active June 4, 2024 12:02
Parallel Merge Sort
import math
import multiprocessing
import random
import sys
import time
def merge(*args):
# Support explicit left/right args, as well as a two-item
# tuple which works more cleanly with multiprocessing.
@akorobov
akorobov / ipv6-httpd.py
Created December 11, 2013 00:58
quick ipv6 http server using python's SimpleHttpServer
import socket
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
class MyHandler(SimpleHTTPRequestHandler):
def do_GET(self):
if self.path == '/ip':
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active July 4, 2024 13:00
Backend Architectures Keywords and References
@rponte
rponte / restart_coreaudiod.sh
Created February 28, 2013 03:04
Restarting MacOSX coreaudiod process gracefully
sudo launchctl stop com.apple.audio.coreaudiod