Skip to content

Instantly share code, notes, and snippets.

View mpfund's full-sized avatar

Marinus Pfund mpfund

  • ifempty
  • Munich
View GitHub Profile
@mpfund
mpfund / excel_interop_character.cs
Created November 29, 2019 10:56
format character in excel cell and preserve old formatting
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.Drawing;
namespace excelinterop
{
class Program
{
@mpfund
mpfund / main.go
Created May 24, 2017 09:47
read raw bytes from disk
package main
import (
"syscall"
"fmt"
)
func main() {
disk := "\\\\.\\C:"
@mpfund
mpfund / main.go
Created May 24, 2017 09:46
encode/decode file base64
package main
import( b64 "encoding/base64"
"fmt"
"log"
"flag"
"io/ioutil"
)
func main() {
@mpfund
mpfund / main.go
Created May 24, 2017 09:45
golang upload file to aws
package main
import (
"compress/gzip"
"io"
"log"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
@mpfund
mpfund / main.cpp
Created December 31, 2016 11:24
dll in process injecten
#include <iostream>
#include <windows.h>
#include <psapi.h>
using namespace std;
int main()
{
DWORD pProcessIds[500];
@mpfund
mpfund / main.c
Created December 31, 2016 11:19
sockets in C
int main()
{
SOCKET sock;
sockaddr_in target;
unsigned long addr;
WSADATA wsaData;
WSAStartup(MAKEWORD(2,0),&wsaData);
target.sin_family = AF_INET;
target.sin_port = htons(80);
@mpfund
mpfund / bootstrap.js
Created August 9, 2016 06:31
modify firefox response (addon)
/////// START - DO NOT EDIT
var {classes: Cc, interfaces: Ci, results: Cr, Constructor: CC, utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
var BinaryInputStream = CC('@mozilla.org/binaryinputstream;1', 'nsIBinaryInputStream', 'setInputStream');
var BinaryOutputStream = CC('@mozilla.org/binaryoutputstream;1', 'nsIBinaryOutputStream', 'setOutputStream');
var StorageStream = CC('@mozilla.org/storagestream;1', 'nsIStorageStream', 'init');
function TracingListener() {
this.receivedChunks = []; // array for incoming data. holds chunks as they come, onStopRequest we join these junks to get the full source
@mpfund
mpfund / fileupload.go
Created February 29, 2016 07:39
golang file upload
package main
import (
"bytes"
"fmt"
"io/ioutil"
"mime/multipart"
"net/http"
)
@mpfund
mpfund / phantomjs_webserver_getcontent.js
Created January 21, 2016 13:00
Loads web content from dynamic sites via phantomjs and webserver module
var webserver = require('webserver');
var webPage = require('webpage');
var server = webserver.create();
var service = server.listen(8080, function(request, response) {
response.statusCode = 200;
var page = webPage.create();
var q = queriesFromUrl(request.url)
if(q.url==null)
response.close();
@mpfund
mpfund / main.go
Created December 17, 2015 20:42
gin web server + db
package main
import (
"fmt"
"github.com/HouzuoGuo/tiedot/db"
"github.com/gin-gonic/gin"
)
func main() {