Skip to content

Instantly share code, notes, and snippets.

View papadave66's full-sized avatar
🍋
When life gives you lemons, make lemonade!

papadave papadave66

🍋
When life gives you lemons, make lemonade!
View GitHub Profile
@papadave66
papadave66 / Main.java
Created October 22, 2018 02:55
a demo to read error by using java
import java.io.InputStream;
public class Main{
public static void main(String[] args){
try{
new ProcessBuilder("gcc", "-o", "test.out", "test.c").start();
ProcessBuilder process_builder = new ProcessBuilder("./test.out", "");
Process run_process;
run_process = process_builder.start();
InputStream subprocess_error = run_process.getErrorStream();
byte[] a = subprocess_error.readAllBytes();
import urllib
import urllib.request
from urllib import request,parse
import requests
import re
import getpass
import json
courseId="3B0BF5AFB336476F815E3934181F1DA2"
print("正在初始化...")
session=requests.session()
@papadave66
papadave66 / bilibili_rank_spider.py
Last active October 30, 2019 02:50
A spider for bilibili rank
import requests
import re
url='https://www.bilibili.com/ranking'
html = requests.get(url).text
pattern = re.compile(r'www\.bilibili\.com/video/av\d+')
videos = pattern.findall(html)
for vid in videos:
print('https://'+vid)
@papadave66
papadave66 / latest.log
Created January 30, 2020 14:26
the log of forge server
[21:20:27] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker
[21:20:27] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker
[21:20:27] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLServerTweaker
[21:20:27] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2847 for Minecraft 1.12.2 loading
[21:20:27] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_65, running on SunOS:amd64:5.11, installed at /opt/jdk1.8.0_65/jre
[21:20:27] [main/WARN] [FML]: The coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin) is not signed!
[21:20:27] [main/WARN] [FML]: The coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin) is not signed!
[21:20:27] [main/INFO] [FML]: Searching /export/home/minecraft/chemistry/./mods for mods
[21:20:27] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraft
@papadave66
papadave66 / setup_server.sh
Created April 13, 2022 07:43
Setup server script for Minecraft modpack "Crucial 2"
[ -n "$JAVA_HOME" ] && JAVA="$JAVA_HOME/bin/java" || JAVA=java
set -e
if [ -f forge-installer.jar ]; then
echo forge-installer.jar is present, which indicates the pack is already installed.
echo Delete forge-installer.jar if you intended to install or if the previous installation stopped halfway.
read -p "Press ENTER to continue..." answer
exit 0
fi