Skip to content

Instantly share code, notes, and snippets.

View shuxiaokai's full-sized avatar
:octocat:

shuxiaokai

:octocat:
  • M78 Nebula
  • Mars
View GitHub Profile
@shuxiaokai
shuxiaokai / backup-github.sh
Created June 23, 2021 05:48 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username); also see the note below about the `REPOLIST` definition around line 48
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
@shuxiaokai
shuxiaokai / PyQt5VideoPlayer
Created July 3, 2021 07:32 — forked from Axel-Erfurt/PyQt5VideoPlayer
PyQt5 VideoPlayer
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.QtGui import QPalette, QKeySequence, QIcon
from PyQt5.QtCore import QDir, Qt, QUrl, QSize, QPoint, QTime, QMimeData, QProcess, QEvent
from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer, QMediaMetaData
from PyQt5.QtMultimediaWidgets import QVideoWidget
from PyQt5.QtWidgets import (QApplication, QFileDialog, QHBoxLayout, QLineEdit,
QPushButton, QSizePolicy, QSlider, QMessageBox, QStyle, QVBoxLayout,
QWidget, QShortcut, QMenu)
@shuxiaokai
shuxiaokai / download.py
Created August 11, 2021 07:59 — forked from khardix/download.py
Python AsyncIO/aiohttp downloader with progressbars
#!/usr/bin/env python3.6
import asyncio
from contextlib import closing
import aiohttp
import tqdm
async def download(session, url, progress_queue):
@shuxiaokai
shuxiaokai / m3u8_decryptor.py
Created August 12, 2021 14:39 — forked from delimitry/m3u8_decryptor.py
Python script for download and decrypt TS chunks from m3u8 file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import requests
import sys
from Crypto.Cipher import AES
Note: I don't know where does this thread belongs. If I'm on the incorrect section, move it to the correct one.
Many people are literally just selling this method and I feel like sharing this out so that you don't have to pay because the seller just don't do a minute of work to get you the drive.
So moving straight towards the method:
Step I:
Go to this link: https://td.fastio.me/ (mirrors to be left at the last)
Step II:
Type your desired drive's name at the first field and your Gmail on the bottom field.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@shuxiaokai
shuxiaokai / nginx-server.conf
Created January 23, 2022 06:42 — forked from zaru/nginx-server.conf
ngrok + nginx proxy (keep alive)
upstream http_backend {
server example.ngrok.io;
keepalive 128;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
@shuxiaokai
shuxiaokai / colab_xface_vnc.ipynb
Created January 23, 2022 19:28 — forked from ahmedengu/colab_xface_vnc.ipynb
Use google colab as a remote machine with the help of ngrok, vnc server and xface desktop you can change the configurations and desktop environment as you please it's just a start
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shuxiaokai
shuxiaokai / xiaoxiao_tts.py
Created January 26, 2022 04:59 — forked from Dobby233Liu/xiaoxiao_tts.py
superb edit of an old parameterless script
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Edge Microsoft TTS for Python."""
import sys
from ws4py.client.threadedclient import WebSocketClient
import binascii
import argparse
import json
import requests
import re
@shuxiaokai
shuxiaokai / xiaoxiao_tts.py
Created January 26, 2022 05:01 — forked from xjohjrdy/xiaoxiao_tts.py
返回的音频没有文件头,所以我随便加的一个文件头,但显示的音频时长有问题。如果播放器不能正常播放,可以使用Chrome播放。
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from ws4py.client.threadedclient import WebSocketClient
import binascii
class WSClient(WebSocketClient):
def __init__(self, url, text, filename):