Skip to content

Instantly share code, notes, and snippets.

View soxfmr's full-sized avatar
🎯
Focusing

soxfmr

🎯
Focusing
  • /dev/null
View GitHub Profile
@ilammy
ilammy / Makefile
Created April 5, 2015 18:31
Linux kernel system call table hooking
obj-m += afw.o
afw-objs := afw_main.o locate_sct.o ttgl.o
ccflags-y := -std=gnu99 -O2
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@chadrien
chadrien / README.md
Last active September 1, 2023 12:43
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@kotakanbe
kotakanbe / ipcalc.go
Created September 17, 2015 02:59
get all IP address from CIDR in golang
package main
import (
"net"
"os/exec"
"github.com/k0kubun/pp"
)
func Hosts(cidr string) ([]string, error) {
@dropmeaword
dropmeaword / browser_history.md
Last active April 5, 2024 17:37
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

@oreoshake
oreoshake / canvas-exif-stripper.html
Created November 10, 2015 00:38
Take a file input, paint the image to a canvas, display it, read the canvas data, and POST the canvas data as an image file.
<input type="file" id="input"><br>
<img id="output">
<canvas id="canvas" style="display:none"></canvas>
<script>
// from http://stackoverflow.com/questions/19032406/convert-html5-canvas-into-file-to-be-uploaded
function uploadCanvas(dataURL) {
var blobBin = atob(dataURL.split(',')[1]);
var array = [];
for(var i = 0; i < blobBin.length; i++) {
@qhwa
qhwa / go_port_forwarding.go
Last active March 27, 2024 13:17
network port forwarding in go lang
package main
import (
"fmt"
"io"
"net"
)
func main() {
ln, err := net.Listen("tcp", ":8080")
@HugoGuiroux
HugoGuiroux / Makefile
Created January 12, 2016 09:43
Kernel module tracepoint hook
obj-m := my_module.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) M=$(PWD) modules
unload:
sudo rmmod ./my_module.ko
load:
sudo insmod ./my_module.ko
@gaejabong
gaejabong / laracast-theme.icls
Created January 31, 2016 12:32
Laracast theme updated
<scheme name="laracasts-theme-updated" version="142" parent_scheme="Default">
<option name="LINE_SPACING" value="1.7" />
<option name="EDITOR_FONT_SIZE" value="15" />
<option name="CONSOLE_FONT_NAME" value="Menlo" />
<option name="CONSOLE_FONT_SIZE" value="10" />
<option name="CONSOLE_LINE_SPACING" value="1.4" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="ADDED_LINES_COLOR" value="292d38" />
<option name="ANNOTATIONS_COLOR" value="8b999f" />
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get purge lxc-docker*
sudo apt-get purge docker.io*
@gcmurphy
gcmurphy / ramdisk.c
Created February 23, 2016 18:40
Create tmpfs mountpoint in c.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <sys/mount.h>
char *
ramdisk(const char *ns, const char *sz)
{