Skip to content

Instantly share code, notes, and snippets.

---
ip: "192.168.10.10"
memory: 8192
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
{
"name":"laravel/homestead",
"versions":[
{
"version":"3.0.0",
"providers":[
{
"name":"virtualbox",
"url":"mynew.box"
}
@0xnbk
0xnbk / recover_source_code.md
Created March 15, 2017 11:24 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@0xnbk
0xnbk / nadar.py
Created September 25, 2016 04:52 — forked from emad-elsaid/nadar.py
Python script to enumerate hosts on the same network and notify you if another device connected/disconnected from network
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# prerequisites :
# sudo apt-get install nmap
#
# nmap.py
# Network Radar
#
#
# This program is free software; you can redistribute it and/or modify

Keybase proof

I hereby claim:

  • I am nikhilben on github.
  • I am nikhilben (https://keybase.io/nikhilben) on keybase.
  • I have a public key whose fingerprint is 64A5 B4DC 8DF9 106D A54E 1ACC AAA4 FCE4 E8FA EB7B

To claim this, I am signing this object:

<?php // \app\http\routes.php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
// app.js
$.ajaxSetup({
// force ajax call on all browsers
cache: false,
// Enables cross domain requests
crossDomain: true,
// Helps in setting cookie
@0xnbk
0xnbk / kernel.php
Last active September 2, 2015 05:19
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
@0xnbk
0xnbk / Cors.php
Last active October 3, 2015 02:27
<?php
namespace App\Http\Middleware;
use Closure;
/**
* Class Cors
* @package App\Http\Middleware
*/
class Cors
import sys
from PySide.QtCore import QObject, Slot
from PySide.QtGui import QApplication
from PySide.QtWebKit import QWebView
html = """
<html>
<body>
<h1>Hello!</h1><br>