Skip to content

Instantly share code, notes, and snippets.

View zhaopengme's full-sized avatar

zhaopeng zhaopengme

View GitHub Profile
@JimLiu
JimLiu / ChatGPT-Translate-Long-Text.js
Last active April 8, 2024 07:26
使用ChatGPT自动分页翻译长文
// WARNING:此脚本仅做学习和演示用途,在不了解其用途前不建议使用
// 本脚本的用途是将输入内容分页,每次提取一页内容,编辑第二条消息,发送,然后收集结果
// 使用前,需要有两条消息,参考模板 https://chat.openai.com/share/17195108-30c2-4c62-8d59-980ca645f111
// 演示视频: https://www.bilibili.com/video/BV1tp4y1c7ME/?vd_source=e71f65cbc40a72fce570b20ffcb28b22
//
(function (fullText) {
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const groupSentences = (fullText, maxCharecters = 2800) => {
const sentences = fullText.split("\n").filter((line) => line.trim().length > 0);
@niutech
niutech / hosts
Last active June 26, 2024 23:02
/etc/hosts file for blocking Microsoft Edge tracking domains (and more)
0.0.0.0 a-0001.a-msedge.net
0.0.0.0 a-0002.a-msedge.net
0.0.0.0 a-0003.a-msedge.net
0.0.0.0 a-0004.a-msedge.net
0.0.0.0 a-0005.a-msedge.net
0.0.0.0 a-0006.a-msedge.net
0.0.0.0 a-0007.a-msedge.net
0.0.0.0 a-0008.a-msedge.net
0.0.0.0 a-0009.a-msedge.net
0.0.0.0 a-msedge.net
@digvijayky
digvijayky / installTF.sh
Last active September 26, 2019 10:47
Tensorflow installation on Bash on Ubuntu on Windows
#!/bin/bash
#Bash script for installing Tensorflow(GPU Enabled), CUDA 7.5 and cuDNN v5 on Bash on Ubuntu on Windows
#Prerequisites:
#Make this script executable using command "chmod +x installTF.sh"
#Download cuDNN v5 for CUDA 7.5 from website https://developer.nvidia.com/cudnn
#After downloading cuDNN v5 from NVIDIA developers website, run this script using command "sudo sh installTF.sh"
#Install nvidia drivers
sudo apt-get install nvidia-367
#Install CUDA-7.5
sudo apt-get install cuda-7.5
@piiswrong
piiswrong / install.sh
Last active December 12, 2017 07:58
install mxnet on ubuntu
#!/usr/bin/env bash
set -e
# install cuda-7.5
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install -y linux-image-extra-`uname -r` linux-headers-`uname -r` linux-image-`uname -r`
sudo apt-get install -y cuda-7-5
echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:\$LD_LIBRARY_PATH" | tee -a ~/.profile | tee -a ~/.bashrc
@dopplesoldner
dopplesoldner / install_cuda.sh
Last active January 18, 2017 14:49
Install cuda
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y opencl-headers build-essential protobuf-compiler \
libprotoc-dev libboost-all-dev libleveldb-dev hdf5-tools libhdf5-serial-dev \
libopencv-core-dev libopencv-highgui-dev libsnappy-dev libsnappy1 \
libatlas-base-dev cmake libstdc++6-4.8-dbg libgoogle-glog0 libgoogle-glog-dev \
libgflags-dev liblmdb-dev git python-pip gfortran
@nkgokul
nkgokul / git_ubuntu_latest.sh
Created April 6, 2015 06:43
Ubuntu update Git
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git
git --version
@zouzias
zouzias / nginx-tomcat.conf
Created December 15, 2014 11:27
Nginx: Proxy Configuration for Apache Tomcat
# Simple proxying to tomcat
server {
listen nginx.server.com:80;
server_name nginx.server.com;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@toutantic
toutantic / JgitTest
Created November 9, 2011 09:51
Code sample for jgit
package net.toutantic.jgit;
import static org.junit.Assert.*;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;