Skip to content

Instantly share code, notes, and snippets.

@xixitalk
xixitalk / simplerelay.py
Created November 22, 2021 07:08 — forked from JCotton1123/simplerelay.py
Start of simple SMTP relay service in Python
#!/usr/bin/env python
import os
import re
import daemon
import asyncore
import smtpd
class SimpleRelayService(smtpd.PureProxy):
"""Handles processing mail for relay"""
{"sig":"903b0b516fb252b1c42da91b083ef69f840cd2874de5e896662bbd8e9527fd9f633074a78c17a309ba1e1e464d23cf67d6185c5c2c1129c76cd851f7f9f4ea8f1","msghash":"098f9dec6bd669745a7da5cd8c437ac2b971fd1e9d5307d22192fc28afe94fb7"}

Keybase proof

I hereby claim:

  • I am xixitalk on github.
  • I am xixitalk (https://keybase.io/xixitalk) on keybase.
  • I have a public key whose fingerprint is 81EA F423 F64F 7730 BF0E 182D 6DC8 72E5 A611 F93B

To claim this, I am signing this object:

@xixitalk
xixitalk / sleep.c
Created September 15, 2016 00:05
command sleep
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>
#include <string.h>
static void Usage(const char *name)
{
printf("%s NUMBER[SUFFIX]...\n\n", name);
printf("The sleep command pauses for an amount of time defined by NUMBER. NUMBER must be an integer. floating-point value is NOT support.\n");
@xixitalk
xixitalk / funcStackCheck.c
Last active July 10, 2016 08:49
函数栈破坏检查
#define STACK_FIND_SIZE 2048 //find from SP to SP+STACK_FIND_SIZE
void funcStackCheck(unsigned long *psp, unsigned long lr)
{
if(psp && (*psp != lr))
{
assert(0);
}
}
@xixitalk
xixitalk / mymalloc.c
Last active July 10, 2016 09:36
malloc封装用于检测内存越界
#define BEGIN_MAGIC 0x3a3a3a3a
#define END_MAGIC 0x5a5a5a5a
void *mymalloc(unsigned int size)
{
char *ptr = (char *)malloc(size+12);
unsigned int *ptmp = NULL;
if(NULL == ptr)
return NULL;
@xixitalk
xixitalk / deadloop.c
Created July 9, 2016 02:15
UINT32引起的死循环
SINT32 txsem_count_init(Semaphore *ptxSem)
{
UINT32 i = 0;
UINT32 semCount = 0;
UINT32 Count = 0;
semCount = GetSemaphoreCount(ptxSem);
Count = SEM_INIT_NUM - semCount;
if (Count > 0)
@xixitalk
xixitalk / 0. remote.conf
Created May 8, 2016 02:07 — forked from clowwindy/0. remote.conf
SigmaVPN configure
[peername]
proto = nacltai
proto_publickey = LOCAL_PUBKEY
proto_privatekey = REMOTE_PRIKEY
local = tuntap
local_interface = tunnel
local_tunmode = 1
peer = udp
peer_localaddr = REMOTE_IP
peer_localport = 8000
@xixitalk
xixitalk / haproxy.cfg
Last active March 26, 2016 00:24
8877为haproxy对外的端口,8443是多个SS服务器的端口,weight是权重,值越大分配的负载越多,backup是标志后备的服务器。手机上影梭使用haproxy所在的IP和端口8877访问,加密方式和密码使用SS服务器的设置。
global
ulimit-n 51200
defaults
log global
mode tcp
option dontlognull
balance roundrobin
option persist
timeout connect 10000
timeout client 150000
@xixitalk
xixitalk / base64_block.rb
Last active December 19, 2015 08:39
octopress plugins:base64 encode twice and decode at browser with javascript
# Title: base64 encode content
# Author: xixitalk http://xixitalk.github.io
# Description: base64 encode twice and decode at browser with javascript
#
# Syntax:
# {% base64_block %}
# This text will be encoded twice with base64
# {% endbase64_block %}
#
# Output: