Skip to content

Instantly share code, notes, and snippets.

View Mattosx's full-sized avatar

mattos Mattosx

  • Netease
  • Hangzhou
View GitHub Profile
@Mattosx
Mattosx / LICENSE
Created February 11, 2022 17:01 — forked from yamnikov-oleg/LICENSE
Shared (interprocess) mutexes on Linux
MIT License
Copyright (c) 2018 Oleg Yamnikov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Mattosx
Mattosx / nmap-scan-show-open.sh
Created January 24, 2021 12:20 — forked from gregjhogan/nmap-scan-show-open.sh
nmap scan for port open and only show open results
nmap -p <port> 192.168.0.*|grep -B3 open
# EXAMPLE OUTPUT
# ==============
# opening device 0xddcc
# connected
# tester present ...
# read data by id: boot software id ...
# 39990-TVA-A110
# read data by id: application software id ...
# 39990-TVA-A150
# read data by id: application data id ...
isolation.tools.getPtrLocation.disable = "TRUE"
isolation.tools.setPtrLocation.disable = "TRUE"
isolation.tools.setVersion.disable = "TRUE"
isolation.tools.getVersion.disable = "TRUE"
monitor_control.disable_directexec = "TRUE"
monitor_control.disable_chksimd = "TRUE"
monitor_control.disable_ntreloc = "TRUE"
monitor_control.disable_selfmod = "TRUE"
monitor_control.disable_reloc = "TRUE"
monitor_control.disable_btinout = "TRUE"
@Mattosx
Mattosx / .gitignore
Created March 8, 2019 11:13 — forked from FullStackForger/.gitignore
.gitignore for Unity3d project
###
# Unity folders and files
###
[Aa]ssets/AssetStoreTools*
[Bb]uild/
[Ll]ibrary/
[Ll]ocal[Cc]ache/
[Oo]bj/
[Tt]emp/
[Uu]nityGenerated/
@Mattosx
Mattosx / gist:1b835342cd8a0d8c55f4ecef239902b1
Created November 26, 2018 07:41
process communication via mmap
/*************************************************************************\
* Copyright (C) Michael Kerrisk, 2016. *
* *
* This program is free software. You may use, modify, and redistribute it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation, either version 3 or (at your option) any *
* later version. This program is distributed without any warranty. See *
* the file COPYING.gpl-v3 for details. *
\*************************************************************************/
@Mattosx
Mattosx / eventsim.py
Created September 17, 2018 07:13 — forked from damonjw/LICENSE
Event driven simulator in Python, using async/await
import heapq
import asyncio
class EventSimulator(asyncio.AbstractEventLoop):
'''A simple event-driven simulator, using async/await'''
def __init__(self):
self._time = 0
self._running = False
self._immediate = []
@Mattosx
Mattosx / tfo.c
Created September 13, 2018 09:31 — forked from linusyang/tfo.c
// x86_64-w64-mingw32-gcc tfo.c -o tfo -lws2_32 -static -g -O0
#define TARGET_URL "localhost"
#define TARGET_PORT 8000
#ifndef _WINSOCK_H
#define _WINSOCK_H
#ifdef __MINGW32__
int bytes2string(unsigned char *src, int srcsize, unsigned char *dst, int dstsize)
{
if (dst != NULL)
{
*dst = 0;
}
if (src == NULL || srcsize <= 0 || dst == NULL || dstsize <= srcsize * 2)
{
return 0;
string replaceNullStr(const char* input){
size_t srcLen = strlen(input);
const char* p = input;
int nullStr = 0;
while (*p != '\0') {
if (*p == ' ') {
++nullStr;
}
++p;
}