Skip to content

Instantly share code, notes, and snippets.

View KireinaHoro's full-sized avatar

Pengcheng Xu KireinaHoro

View GitHub Profile
@KireinaHoro
KireinaHoro / config-4.9.95-gentoo
Created May 4, 2018 18:17
Kernel configuration for Gentoo in Hyper-V
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.9.95-gentoo Kernel Configuration
#
#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y
@KireinaHoro
KireinaHoro / playground.py
Created May 6, 2018 17:16
FrozenLake test tensorflow
import gym
import numpy as np
import tensorflow as tf
env = gym.make('FrozenLake-v0')
tf.reset_default_graph()
# establish the feed-forward part of the network used to choose actions
inputs1 = tf.placeholder(shape=[1, 16], dtype=tf.float32)
{
"fonts": {
"MS UI Gothic": {
"replace": "源ノ角ゴシック Medium",
"#italic": false,
"#underLine": false,
"#strikeOut": false
},
"Open Sans": {
"replace": "Source Sans Variable Regular",
@KireinaHoro
KireinaHoro / main.py
Created May 19, 2018 08:26
FightTheLandlord
#!/usr/bin/env python
# FightTheLandlord Artificial Stupidity
# Version 0
# 2018 Pengcheng Xu, Junjie Shan, Zixin Zhou
# All rights reserved.
# TODO 判斷是用大牌打地主還是清理散牌
# TODO 給牌型排序(設計估值函數)
# TODO 計算打出牌型的分值
# TODO 儘量選長的牌出
@KireinaHoro
KireinaHoro / local.conf
Created July 14, 2018 01:44
Working fontconfig
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Turn off embedded font -->
<match target="font">
<edit name="embeddedbitmap" mode="assign">
<bool>false</bool>
</edit>
</match>
@KireinaHoro
KireinaHoro / arpa_inet_h-in_addr_t-definition.patch
Created July 24, 2018 17:23
Patch for Bionic headers for missing definition
--- arpa/inet.h.old 2018-07-25 00:19:42.423809828 +0800
+++ arpa/inet.h 2018-07-25 00:18:14.071813451 +0800
@@ -36,6 +36,8 @@
__BEGIN_DECLS
+typedef uint32_t in_addr_t;
+
in_addr_t inet_addr(const char* __s);
int inet_aton(const char* __s, struct in_addr* __addr);
@KireinaHoro
KireinaHoro / bootimg.diff
Last active October 6, 2018 06:11
DPT-RP1 boot.img diff
diff --git a/orig/boot.img b/new/boot.img
index cdcfca4..15a594e 100644
Binary files a/orig/boot.img and b/new/boot.img differ
diff --git a/orig/bootimg.cfg b/new/bootimg.cfg
index 42eaa62..fc7b66f 100644
--- a/orig/bootimg.cfg
+++ b/new/bootimg.cfg
@@ -5,5 +5,5 @@ ramdiskaddr = 0x11000000
secondaddr = 0x10f00000
tagsaddr = 0x10000100
@KireinaHoro
KireinaHoro / system.diff
Last active October 6, 2018 06:16
DPT-RP1 system diff
diff --git a/system-orig/build.prop b/system-new/build.prop
index 6afadb0..1f57459 100644
--- a/system-orig/build.prop
+++ b/system-new/build.prop
@@ -10,11 +10,11 @@ ro.build.version.all_codenames=REL
ro.build.version.release=1.2.02.07211
ro.build.date=Fri Jul 21 17:15:08 JST 2017
ro.build.date.utc=1500624908
-ro.build.type=user
+ro.build.type=userdebug
@KireinaHoro
KireinaHoro / hashcash.go
Created October 23, 2019 16:05
Basic implementation of the Bitcoin hashcash algorithm,
package main
import (
"crypto/sha256"
"encoding/binary"
"encoding/hex"
"encoding/json"
"fmt"
"math/big"
"os"
@KireinaHoro
KireinaHoro / docker-compose.yml
Created May 10, 2020 02:45
Grafana + Prometheus template.
version: '3'
volumes:
prometheus_data: {}
grafana_data: {}
services:
# Prometheus backend.
prometheus:
restart: always
image: prom/prometheus
volumes: