Skip to content

Instantly share code, notes, and snippets.

@guss77
guss77 / mongo_db_recover_delete_record-2.4.py
Last active June 28, 2024 04:32
Try to recover deleted documents from a mongodb 2.4 data file. Based on https://gist.github.com/egguy/2788955 with help from https://yazadk.wordpress.com/2015/07/15/a-forensic-perspective-on-recovering-deleted-data-from-big-data-systems/#MongoDB . Make sure to change `decode_chunk` so it properly detects the objects you are trying to recover - i…
#!/usr/bin/python
"""A little script to recover deleted recording of a mongoDB db file
There's no optimization but it work and has saved me
"""
import struct
import bson
import pymongo
@gunjanpatel
gunjanpatel / amazon-ec2-ftp.md
Last active October 10, 2023 15:31
amazon ec2 LAMP and FTP installation and setup

uboot代码架构

  • board: 和一些已有开发板有关的文件, 每个开发板都以一个子目录出现在当前目录中. 比如说: SMDK2410, 子目录中存放与开发板相关的配置文件.
  • common: 实现uboot命令行下支持的命令, 每一条命令都对应一个文件. 例如, bootm命令对应就是cmd_bootm.c.
  • cpu: 与特定CPU架构相关目录, 每一款uboot下支持的CPU在该目录下对应一个子目录, 比如有子目录arm920t等.
  • disk: 对磁盘的支持.
  • doc: 文档目录. uboot有非常完善的文档, 推荐大家参考阅读.
  • drivers: Uboot支持的设备驱动程序都放在该目录, 比如各种网卡, 支持CFI的Flash, 串口和USB等.
  • fs: 支持的文件系统, Uboot现在支持cramfs, fat, fdos, jffs2和registerfs.
  • include: Uboot使用的头文件, 还有对各种硬件平台支持的汇编文件, 系统的配置文件和对文件系统支持的文件. 该目录下configs目录有与开发板相关的配置头文件, 如: smdk2410.h. 该目录下的asm目录有与CPU体系结构相关的头文件, asm对应asm arm9
  • lib_xxx: 与体系结构相关的库文件. 如与ARM相关的库放在lib_arm中.
@Bouke
Bouke / gist:11261620
Last active March 4, 2025 11:36
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@chrisgillis
chrisgillis / ssl_smtp_example.go
Created April 16, 2014 14:48
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@jeremy5189
jeremy5189 / simple-rsa.py
Last active April 12, 2024 14:10
利用 Python 實作簡易 RSA 非對稱式加密法
#!/usr/bin/python
# -*- coding: utf8 -*-
# Simple RSA Implementation
# Authored by Jeremy <jeremy5189(at)gmail.com>
# Reference: http://www.ruanyifeng.com/blog/2013/07/rsa_algorithm_part_two.html
from fractions import gcd
import sys
@kwk
kwk / CMakeLists.txt
Last active August 31, 2024 02:57
Fix for "undefined reference to dlopen" in CMake projects
project(testlink)
add_executable(testlink main.cpp)
target_link_libraries(testlink)
@egguy
egguy / mongo_db_recover_delete_record.py
Created May 25, 2012 16:04
Recover deleted data from mongo DB database
"""A little script to recover deleted recording of a mongoDB db file
There's no optimization but it work and has saved me
"""
import struct
import bson
import pymongo
import sys