Skip to content

Instantly share code, notes, and snippets.

View helloqiu's full-sized avatar
😺
Learning programming from @DCjanus

Yuyang Zhang(helloqiu) helloqiu

😺
Learning programming from @DCjanus
View GitHub Profile
@helloqiu
helloqiu / docker-compose.yml
Created September 28, 2018 16:26
create simple test smtp server
version: '2'
services:
imap:
image: antespi/docker-imap-devel:latest
container_name: imap
ports:
- "25:25"
- "143:143"
- "993:993"
@helloqiu
helloqiu / mpv-ftp.go
Created March 31, 2018 04:40
Decode url then execute mpv with it.
package main
import (
"fmt"
"net/url"
"os"
"os/exec"
)
func main() {
@helloqiu
helloqiu / with_a_redundant_assignment.s
Created March 10, 2018 04:23
Assembly code generated by GCC 7.3.0 on i5-5257U Mac OS
.text
.cstring
lC1:
.ascii "%lf\12\0"
.text
.globl _main
_main:
LFB1:
pushq %rbp
LCFI0:
@helloqiu
helloqiu / move.py
Created January 19, 2018 04:36
Move all files in sub dir out and delete dir.
# -*- coding: utf-8 -*-
import os
base_path = os.path.abspath("./")
def move_out(path, target_path):
dirs = os.listdir(path)
for file in dirs:
@helloqiu
helloqiu / courseTable.js
Last active September 5, 2017 08:54
Simple js which can export course table from uestc.
$.getScript('https://cdn.bootcss.com/FileSaver.js/2014-11-29/FileSaver.min.js', function() {
const table_rows = $('#manualArrangeCourseTable').children('tbody')[0].children
let course_result = []
for (let i = 0; i < 12; i++) {
const row = table_rows[i]
for (let j = 0; j < 8; j++) {
const block = row.children[j]
if (block && block.hasAttribute('title')) {
const data = /(.*)\s([^ \(]*)\(.*(\d+)\-(\d+)\,(.*)\)/.exec(block.title)
course_result.push({
systemctl stop plexmediaserver
cd '/var/lib/plex/Plex Media Server/Plug-ins'
git clone https://github.com/ZeroQI/Hama.bundle.git
chown -R plex:plex '/var/lib/plex/Plex Media Server/Plug-ins/Hama.bundle'
chmod 775 -R '/var/lib/plex/Plex Media Server/Plug-ins/Hama.bundle'
mkdir -p '/var/lib/plex/Plex Media Server/Scanners/Series'
wget -O '/var/lib/plex/Plex Media Server/Scanners/Series/Absolute Series Scanner.py' https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/Scanners/Series/Absolute%20Series%20Scanner.py
chown -R plex:plex '/var/lib/plex/Plex Media Server/Scanners'
chmod 775 -R '/var/lib/plex/Plex Media Server/Scanners'
//
// Created by helloqiu on 2017/3/18.
//
#ifndef LIST_LIST_H
#define LIST_LIST_H
struct list_head {
struct list_head *next, *prev;
};
@helloqiu
helloqiu / smallworld.py
Created November 17, 2016 11:33
small world generator
# -*- coding: utf-8 -*-
import networkx
import matplotlib.pyplot as plt
import random
import json
l = dict()
c = dict()
@helloqiu
helloqiu / unix_homework_2.sh
Created April 25, 2016 10:24
A small shell to manage something.
#! /bin/bash
max_space_user(){
du -s /home | sort -nr | head -1
}
max_file(){
find -type f -exec stat -c "%s %n" {} \; | sort -nr | head -1
}
@helloqiu
helloqiu / apt-mirror.perl
Created April 20, 2016 09:36
apt-mirror for termux-packages
#!/usr/bin/perl
=pod
=head1 NAME
apt-mirror - apt sources mirroring tool
=head1 SYNOPSIS