Skip to content

Instantly share code, notes, and snippets.

View ysc3839's full-sized avatar

Richard Yu ysc3839

View GitHub Profile
@ysc3839
ysc3839 / stroke.c
Last active July 21, 2016 04:24
Image Stroke Algorithm
#include <stdint.h>
void stroke(void *srcBmp, void *dstBmp, size_t width, size_t height)
{
for (size_t x = 0; x < width; x++)
{
for (size_t y = 0; y < height; y++)
{
uint32_t *src = (uint32_t *)srcBmp + y * width;
uint32_t currPixel = src[x];
@ysc3839
ysc3839 / shBrushSquirrel.js
Created July 30, 2016 13:14
Squirrel hightlight js
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.0.320 (May 03 2009)
*
@ysc3839
ysc3839 / WallBreaker.py
Created August 22, 2016 04:48
WallBreaker
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, socket, select, SocketServer, struct, logging
from time import sleep
logging.basicConfig(level=logging.INFO)
BUFLEN = 1024
SLEEPTIME = 0.4
import zipfile
import os
import re
import sys
import cStringIO as StringIO
from Tkinter import *
from ttk import *
import thread
# Request https SSL error workaround
@ysc3839
ysc3839 / lxlaunch.cpp
Created January 15, 2017 14:50
lxlaunch.cpp
#include <initguid.h>
#include <Windows.h>
#include <comutil.h>
#include "..\inc\nt.h"
#include "..\inc\lxssmanager.h"
#include "..\inc\adss.h"
#ifndef DISABLE_NEWLINE_AUTO_RETURN
#define DISABLE_NEWLINE_AUTO_RETURN 0x08
#endif
@ysc3839
ysc3839 / cloudxns.sh
Last active April 30, 2017 08:00
cloudxns.sh
#!/bin/sh
[ "$1" = "" ] && exit 1
API_KEY=""
SECRET_KEY=""
DOMAIN=""
HOST=""
IP="$1"
@ysc3839
ysc3839 / S99znc
Last active January 26, 2017 00:41
znc init
#!/bin/sh
# Give a r\w permissions for "nobody" user
find /opt/share/znc/ -type f | xargs chmod 666
find /opt/share/znc/ -type d | xargs chmod 777
# Add droproot to znc.conf
CONF=/opt/share/znc/configs/znc.conf
grep -Fq "LoadModule = droproot" $CONF || echo "LoadModule = droproot nobody nogroup" >> $CONF
@ysc3839
ysc3839 / translatebot.py
Created February 5, 2017 09:50
Telegram translate bot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=I0011,C0111,C0103
from __future__ import print_function
import threading
import telepot
from telepot.namedtuple import InlineQueryResultArticle, InputTextMessageContent
from goslate import Goslate
@ysc3839
ysc3839 / msg2po.py
Last active April 9, 2017 06:49
PO Msg Converter
import sys
from os import path
import re
import polib
def msg2po(msgfile, pofile):
with open(msgfile, 'rb') as f:
messages = f.read()
po = polib.POFile()
#!/bin/sh
cookie="your cookie"
servers="cccat.club cccat.pw cccat.pro"
set -- $servers
while [ -n "$1" ]; do
logger -t CCCATSIGN Checking in $1.
response=$(wget -q -O - --header "Cookie: $cookie" https://$1/user/_checkin.php 2>&1)