Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / auth.json
Created February 21, 2019 03:08
AWS Cognito Identity authenticate using cURL
{
"AuthParameters" : {
"USERNAME" : "[email protected]",
"PASSWORD" : "mysecret"
},
"AuthFlow" : "USER_PASSWORD_AUTH",
"ClientId" : "9..............."
}
@dimaryaz
dimaryaz / dropbox_ext4.c
Created August 15, 2018 07:28
Dropbox ext4 hack
/*
* dropbox_ext4.c
*
* Compile like this:
* gcc -shared -fPIC -ldl -o libdropbox_ext4.so dropbox_ext4.c
*
* Run Dropbox like this:
* LD_PRELOAD=./libdropbox_ext4.so ~/.dropbox-dist/dropboxd
*/
@tkrajina
tkrajina / unmarshal_interface.go
Last active October 29, 2024 03:30
Unmarshal JSON to specific interface implementation
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type Something interface{}
@varhub
varhub / Android - Enable ADB from recovery.md
Created December 23, 2016 17:54
Android - Enable ADB from recovery

Android - Enable ADB from recovery

Credits to @TheOnlyAnil-@Firelord[^stackoverflow]

  • Requirements: a) stock recovery + rooted phone b) custom recovery

  • Files changed:

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active November 14, 2024 10:34
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@leonroy
leonroy / ssh-hp1920-enable-cmdline-mode.exp
Created May 29, 2016 13:09
SSH to HP 1920 and enable cmdline-mode
#!/usr/bin/expect -f
set timeout 60
set host [lindex $argv 0]
stty -echo
send_user -- "Password for $host: "
expect_user -re "(.*)\n"
send_user "\n"
stty echo
set password $expect_out(1,string)
@Accalmie
Accalmie / winsock_sniffer.c
Created October 17, 2015 16:32
Winsock Sniffer code in C
/*
Simple Sniffer in winsock
Author : Silver Moon ( [email protected] )
*/
#include "stdio.h"
#include "winsock2.h"
#pragma comment(lib,"ws2_32.lib") //For winsock
umount: device is busy. Why?
There are several reasons why a file system cannot be unmounted. Here are a few of the reasons.
Working directory or file open of a running process
# umount /mnt/test
umount: /mnt/test: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
# lsof /mnt/test/
@koelling
koelling / gist:ef9b2b9d0be6d6dbab63
Last active February 7, 2017 16:21
CVE-2015-0235 (GHOST) test code
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
struct {
char buffer[1024];