Skip to content

Instantly share code, notes, and snippets.

View gongpengjun's full-sized avatar

巩鹏军 gongpengjun

View GitHub Profile
@BretFisher
BretFisher / docker-for-mac.md
Last active May 15, 2024 05:19
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@SuperY
SuperY / version_by_git_commit_number.sh
Last active August 26, 2016 14:13
编译把Git的提交次数作为小版本号
#Git 版本数
VERSION_NUMBER=`git rev-list head | sort | wc -l | awk '{print $1}'`
#VERSION_HASH=`git rev-list head | head -1`
echo $VERSION_NUMBER
#echo $VERSION_HASH
@gongpengjun
gongpengjun / TimeMeasure.m
Last active January 21, 2016 07:06
iOS Time Measure Routine
//
// TimeMeasure.m
//
// Created by 巩 鹏军 on 13-6-25.
// Copyright (c) 2013年 巩 鹏军. All rights reserved.
//
#import <Foundation/Foundation.h>
void do_somthing()
@niranjan-nagaraju
niranjan-nagaraju / tcpdump_tcpreplay.org
Last active October 26, 2023 10:15
TCPReplay/TCPRewrite/TCPPrep/TCPDump Cheatsheet

TCPReplay/TCPRewrite/TCPPrep/TCPDump Cheatsheet

tcprewrite

Rewrite IP/Mac addresses, -C optionally to fix checksums

  1. tcpprep, first:C2S, Second S2C, Generate cache file
        
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@nowa
nowa / iOS App Store Crawler
Created August 4, 2010 04:19
iOS App Store Crawler
#!/usr/bin/env ruby
# iOS App Store Crawler by Nowa <nowazhu@gmail.com>
# 2010-08-04
require 'rubygems'
require 'hpricot'
require 'open-uri'
USERAGENT = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4'
LETTERS = %w{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z *}
//
// UIWebView+SmartJS.h
//
// Created by Jon Olson on 12/27/08.
// Copyright 2008-2009 Ballistic Pigeon, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString * const SmartJSErrorDomain;