Skip to content

Instantly share code, notes, and snippets.

View southwolf's full-sized avatar

SouthWolf southwolf

  • HSBC
  • Guangzhou, China
View GitHub Profile

近来由于 Mac 出了点小问题一直没有解决,加上用了已经有好长一段时间,一直想清理一下(精神洁癖作祟),所幸重装了事。没有使用 TimeMachine,所以需要先行将一些觉得尚有价值的文件拷贝下来。

写下这篇文章,也是为了以后再次遇到问题能够有章可循,不至于胡乱一通重装。本文也会持续更新,欢迎大家分享更好的使用技巧与经验。

重装 macOS

在线恢复系统实在太慢,进行在 Windows 下制作 Mac U盘启动盘重装系统. 额外所需的物理设备为 U 盘一个,8G 及以上为宜。

1. 准备软件与镜像

@southwolf
southwolf / sdl_yuv.cpp
Created October 11, 2013 03:20
SDL YUV display, screen freezes but code still running
int _tmain(int argc, _TCHAR* argv[])
{
FILE *in_fp;
int frameNum = 10000;
Uint32 screenWidth = 0, screenHeight = 0;
Uint32 frameSize = 0;
Uint8 *frame, *displayFrame;
SDL_RWops *handle = nullptr;
Uint32 readStart, readEnd, readTime, showStart, showEnd, showTime;
#include <string.h>
#include <ctype.h>
const uint8_t req[5] = {0x00, 0x01, 0x00, 0x11, 0x00};
const uint8_t cap[17] = {0x00, 0x0d, 0x00, 0x11, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32};
const uint8_t ping[9] = {0x00, 0x05, 0x07, 0xd1, 0x00, 0xde, 0xad, 0xbe, 0xef};
const uint8_t sms[23] = {0x00, 0x13, 0x0b, 0xb8, 0x01, 0x01, 0x41, 0x01, 0x42, 0x0d, 0x31, 0x33, 0x37, 0x36, 0x34, 0x36, 0x36, 0x36, 0x35, 0x39, 0x30, 0x30, 0x30};
//uint8_t serialMessage[200];
int index = 0;
$ ./waf configure
Waf: The wscript in 'c:\\Users\\SouthWolf\\pebble\\sdk\\watches\\segment_six' is
unreadable
Traceback (most recent call last):
File "c:\Users\SouthWolf\pebble\sdk\watches\segment_six\waf-1.7.0-9334f7e963be
e5410f4fa28728feffdd\waflib\Scripting.py", line 87, in waf_entry_point
set_main_module(Context.run_dir+os.sep+Context.WSCRIPT_FILE)
File "c:\Users\SouthWolf\pebble\sdk\watches\segment_six\waf-1.7.0-9334f7e963be
e5410f4fa28728feffdd\waflib\Scripting.py", line 112, in set_main_module
Context.g_module=Context.load_module(file_path)
# coding=utf-8
import Image, ImageDraw, ImageFont
import struct
font_width = 16
font = ImageFont.truetype("/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc", font_width)
def get_font_data(char):
@southwolf
southwolf / manifest.json
Last active December 15, 2015 15:09
Correct Resource Map of Pebble v1.9.1
{
"debug": {
"resourceMap": {
"friendlyVersion": "v1.8-HM",
"media": [
{
"defName": "PUG",
"file": "images/pug.png",
"type": "png"
},
# coding=utf-8
import Image, ImageDraw, ImageFont
import struct
font_width = 16
font = ImageFont.truetype("/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc", font_width)
def get_font_data(char):
@southwolf
southwolf / font2pbm.rb
Created March 29, 2013 09:49
Pebble font resource to pbm(the most close format I can think of to the pebble res) converter **Faulty**
class Image
attr_accessor :width, :height, :bitmap
end
img = Image.new
hexmap = nil
File.open('font1', 'rb') do |f|
data = f.read
img.width = data[0].ord
@southwolf
southwolf / tumblr-photo-ripper.rb
Created November 2, 2015 02:50 — forked from jamiew/tumblr-photo-ripper.rb
Download all the images from a Tumblr blog
# Usage:
# [sudo] gem install mechanize
# ruby tumblr-photo-ripper.rb
require 'rubygems'
require 'mechanize'
# Your Tumblr subdomain, e.g. "jamiew" for "jamiew.tumblr.com"
site = "doctorwho"