Skip to content

Instantly share code, notes, and snippets.

View clarkzjw's full-sized avatar
🌴

Jinwei Zhao clarkzjw

🌴
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>
#include <iostream>
#include <queue>
#include <stdio.h>
#include <time.h>
#include <cv.h>
#include <highgui.h>
int main()
{
IplImage *img = cvCreateImage(cvSize(5000, 5000), IPL_DEPTH_8U, 1);
cvZero(img);
@clarkzjw
clarkzjw / video.cpp
Created February 17, 2015 05:41
OpenCV video example
#include <stdio.h>
#include <opencv\cv.h>
#include <opencv\cxcore.h>
#include <opencv\highgui.h>
int main()
{
IplImage* pFrame = NULL;
IplImage* pFrameNew = NULL;
#include <stdio.h>
int main()
{
char *str = "HelloWorld";
int a = *(int *)str;
if (a == 0x6c6c6548)
printf("Little endian\n");
else if (a == 0x48656c6c)
printf("Big endian\n");
return 0;
@clarkzjw
clarkzjw / LumberJack.py
Last active October 23, 2016 05:17
Telegram game LumberJack bot, require Python3 and PyAutoGUI, the coordinates are for the left side of 1366*768 screen.
from pyautogui import *
from time import sleep
def move(_pos, _now):
if _pos == 'left' and _now == 'left':
typewrite(['left'])
typewrite(['left'])
elif _pos == 'left' and _now == 'right':
typewrite(['right'])
@clarkzjw
clarkzjw / docker-compose.yml
Last active January 10, 2017 05:12
Prometheus
version: '2'
volumes:
prometheus_data: {}
grafana_data: {}
services:
swarm_exporter:
image: daocloud.io/daocloud/swarm_exporter:0.1.1
labels:
io.daocloud.dce.compose.placement.constraints: '["node.role == manager"]'
@clarkzjw
clarkzjw / docker-compose.yml
Created January 10, 2017 05:13
三节点MongoDB副本集
version: '2'
services:
mongo1:
image: mongo
container_name: mongo1
command: [mongod, --replSet, my-mongo-set, --dbpath, /data/db]
networks:
- mongo-net
mongo2:
image: mongo
@clarkzjw
clarkzjw / docker-compose.yml
Created January 10, 2017 06:36
MongoDB-Sharded-Cluster-ReplicaSet
version: '2'
services:
mongo-config1:
image: mongo
container_name: mongo-config1
command: [mongod, --configsvr, --replSet, my-mongo-set, --dbpath, /data/db]
ports:
- "27019"
networks:
- mongo-net
@clarkzjw
clarkzjw / log.py
Last active January 19, 2017 05:48
LogStash
import logging
import time
from logging.handlers import RotatingFileHandler
# ----------------------------------------------------------------------
def create_rotating_log(path):
"""
Creates a rotating log
@clarkzjw
clarkzjw / libimobiledevice_ifuse_Ubuntu.md
Created February 27, 2017 03:12 — forked from samrocketman/libimobiledevice_ifuse_Ubuntu.md
On Ubuntu 16.04, since iOS 10 update, libimobiledevice can't connect to my iPhone. This is my attempt to document a fix.

Why this document?

I upgraded my iPhone 5s to iOS 10 and could no longer retrieve photos from it. This was unacceptable for me so I worked at achieving retrieving my photos. This document is my story (on Ubuntu 16.04).

The solution is to compile libimobiledevice and ifuse from source.

Setup environment

Don't forget to set up your environment before building. I typically build and install packages to my local user at $HOME/usr.