Skip to content

Instantly share code, notes, and snippets.

Avatar
🏫
School work

taoky taoky

🏫
School work
  • University of Science and Technology of China
  • Wuxi, Jiangsu, China
View GitHub Profile
@taoky
taoky / qt5.ps1
Last active Sep 23, 2021
Minimum static qt build (Windows)
View qt5.ps1
# Modified from https://gist.github.com/mrfaptastic/80e909c9a8237994471bce2d17657779
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# Tested with QT 5.15.2 on Windows 10
@taoky
taoky / Dockerfile
Created Aug 14, 2021
VMware's vibauthor in Docker
View Dockerfile
FROM centos:6
RUN echo "207.241.237.3 web.archive.org" >> /etc/hosts && \
curl https://web.archive.org/web/20140123032613if_/http://download3.vmware.com/software/vmw-tools/vibauthor/vmware-esx-vib-author-5.0.0-0.0.847598.i386.rpm > /tmp/vibauthor.rpm && \
sed -e "s|^mirrorlist=|#mirrorlist=|g" \
-e "s|^#baseurl=http://mirror.centos.org/centos/\$releasever|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10|g" \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo && \
yum makecache && \
yum install -y python-lxml && \
@taoky
taoky / main.py
Created Aug 4, 2021
Emergency finding broken repo in gitlab hashed storage
View main.py
import glob
import sys
configs = glob.iglob("/your/gitlab/path/repositories/@hashed/*/*/*.git/config")
keyword = sys.argv[1]
print("keyword", keyword)
for i in configs:
with open(i) as f:
@taoky
taoky / analyze.py
Last active Feb 27, 2021
Analyze rsyncd log with state-machine style python script
View analyze.py
from sys import stdin
from collections import defaultdict
def analyze(line):
state = 0
for idx, c in enumerate(line):
if state == 0:
if c == ']':
if line[idx + 2:idx + 6] == "send":
state = 1
@taoky
taoky / 1.sh
Last active Dec 6, 2020
run multi jobs and get whether any process failed
View 1.sh
#!/bin/bash
rm -f /tmp/failure
~/executor/executor -shell 'sleep 3 && ping' > /tmp/log || touch /tmp/failure &
~/executor/executor ls > /tmp/log2 || touch /tmp/failure &&
wait
test -f /tmp/failure && echo failed! && exit 1
exit 0
View executor.go
package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
"os/exec"
"strings"
@taoky
taoky / framebuffer.cpp
Created Jul 9, 2020
Printing a 800x600 XPM image to framebuffer
View framebuffer.cpp
// Modified from https://gist.github.com/FredEckert/3425429, with some bug fixes
// This following program requires at least 800x600, 32bpp to run
#include <fcntl.h>
#include <linux/fb.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
@taoky
taoky / keybase.md
Last active Mar 10, 2020
keybase.md
View keybase.md

Keybase proof

I hereby claim:

  • I am taoky on github.
  • I am taoky (https://keybase.io/taoky) on keybase.
  • I have a public key ASC4zasMLGpbMhJDVIbJ2f5IdI5AQszvf9tJuKJRP4vhfgo

To claim this, I am signing this object:

@taoky
taoky / exp6.asm
Created Feb 9, 2020
FTOA and ATOF procedure assembly for 80387
View exp6.asm
.model SMALL
.386
.STACK 100H
.DATA
TEMP DW ?
NUMB REAL4 ?
STRING DB 1024 DUP(0)
WHOLE DD ?
FRACT DD ?
@taoky
taoky / decode.c
Last active Sep 27, 2019
Malware "送给最好的TA" Analysis
View decode.c
#include <stdio.h>
char * load(char *a2, size_t size)
{
char *v9; // r0
int v10; // r1
signed int v11; // r2
char *v13; // [sp+8h] [bp-28h]
size_t v14; // [sp+Ch] [bp-24h]