Skip to content

Instantly share code, notes, and snippets.

/* GStreamer
* Copyright (C) 2008 Wim Taymans <wim.taymans at gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@peanutwolf
peanutwolf / proxybin.go
Created March 11, 2020 07:32
Simple executable args sniffer written in golang
package main
import (
"log"
"os"
"os/exec"
"path/filepath"
"strings"
ps "github.com/mitchellh/go-ps"
#include <memory>
#include <cstdlib>
#include <restbed>
using namespace std;
using namespace restbed;
class CustomLogger : public Logger
{
#!/usr/bin/python3
__author__ = 'vigurskiy'
import sys
import difflib
import re
import os
version_template_arcus = '\A\d+\.\d+\.\d+\.\d+ \[\d{1,2}\.\d{1,2}\.\d{2,4}\]\s{1}'
version_template = '\A\d+\.\d+\.\d+\.\d+ \[\d{1,4}\.\d{1,2}\.\d{1,2}\]\s{1}'
@peanutwolf
peanutwolf / dijkstra.py
Created January 30, 2016 11:38 — forked from mdsrosa/dijkstra.py
Modified Python implementation of Dijkstra's Algorithm (https://gist.github.com/econchick/4666413)
from collections import defaultdict, deque
class Graph(object):
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
@peanutwolf
peanutwolf / lockOrient.java
Created October 6, 2015 08:08
Locking orientation on Android
private void lockOrientation(){
int orientation;
int rotation = ((WindowManager) getActivity().getSystemService(
Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
switch (rotation) {
case Surface.ROTATION_0:
orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
break;
case Surface.ROTATION_90:
orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
/**
* Created by vigursky on 17.08.2015.
*/
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.CookieStore;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import java.util.Properties;
import javax.mail.*;
import javax.mail.event.MessageCountEvent;
import javax.mail.event.MessageCountListener;
import com.sun.mail.imap.*;
public abstract class MailProtoPort {
#include "sdk30.h"
#include "ip_.h"
#include "timer.h"
#define UDP 0
int logSockData(char* data, int Size, struct sockaddr_in *from);
int isMoreLogSize(int size);
int openLogFile(void);
void setMyEthParams(char eth_str[32]);