Skip to content

Instantly share code, notes, and snippets.

View mike820324's full-sized avatar
🎯
Focusing

MicroMike mike820324

🎯
Focusing
View GitHub Profile
$medium_url = "https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/" . $handle;
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
#[macro_use]
extern crate rocket_contrib;
#[macro_use]
extern crate serde_derive;
use rocket_contrib::json::{Json, JsonValue};
#[derive(Deserialize)]
struct RegisterData {
username: String,
password: String,
email: String,
}
#[post("/register", format = "json", data = "<data>")]
fn register(data: JSON<ResigterData> ) -> JsonValue {
json!({"success": data.email})
}
[package]
name = "microgram_server"
version = "0.1.0"
authors = ["mike820324 <[email protected]>"]
edition = "2018"
[dependencies]
rocket = "0.4.0"
rocket_contrib = "0.4.0"
serde = "1.0.86"
serde_derive = "1.0.86"
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
#[macro_use]
extern crate rocket_contrib;
#[macro_use]
extern crate serde_derive;
#[post("/register")]
fn register() -> &'static str {
@mike820324
mike820324 / Makefile
Created January 30, 2016 01:17
A simple goto ring3 code for unicorn
CC := gcc
LD := ld
ASFLAGS := -c
LDFLAGS := -T link.ld
all: boot_32.bin
boot_32.bin: boot_32.o
@${LD} ${LDFLAGS}
@echo "LINK $@"
@mike820324
mike820324 / PFNDump.c
Created June 27, 2014 18:56
Dump the virtual address and the physical Frame Number of the virtual address in linux kernel
#include <linux/linkage.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <asm-i386/page.h>
#include <asm-i386/pgtable.h>
asmlinkage long sys_project(unsigned long pid1, unsigned long pid2){
struct vm_area_struct *vm; /* loop counter to loop through all vm section */
@mike820324
mike820324 / SystemCallHooking.c
Created June 27, 2014 18:43
An example of Hooking Linux System Call
#include <linux/module.h>
#include <linux/printk.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <asm/unistd.h>
#include <asm/pgtable_types.h>
#include <linux/highmem.h>
#include "hook_function_ptr.h"
package ce1002.a2.ta;
import java.util.Scanner;
public class A2 {
public static void main(String[] args) {
Scanner input = new Scanner( System.in );
package ce1002.a2.s102522042;
import java.util.Scanner;
public class A2 {
public static void main(String[] args) {
Scanner input = new Scanner( System.in );