hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso
diskutil unmountDisk /dev/diskN
sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m
diskutil eject /dev/diskN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def pick_pids(tasks) | |
| pids = tasks.map do |t| | |
| pids = `pgrep #{t}`.scan(/\d+/).map(&:to_i) | |
| pids.sample | |
| end | |
| pids | |
| end | |
| def vruntimes(pids) | |
| results = [] |
- python的方法参数不可初始为
{},多次调用会引用到同一个dict对象上。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- encoding:utf-8 -*- | |
| # | |
| # 2012 by fleuria | |
| # Inspired by vino from lepture | |
| # | |
| import logging | |
| import collections | |
| import MySQLdb as mysql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun! DelBlank() | |
| let _s=@/ | |
| let l = line(".") | |
| let c = col(".") | |
| :%s/\s\+$//e | |
| let @/=_s | |
| call cursor(l, c) | |
| endfun | |
| au BufWritePre *.* :call DelBlank() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (c) 1982, 1986, 1993 | |
| * The Regents of the University of California. All rights reserved. | |
| * | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions | |
| * are met: | |
| * 1. Redistributions of source code must retain the above copyright | |
| * notice, this list of conditions and the following disclaimer. | |
| * 2. Redistributions in binary form must reproduce the above copyright |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 写了一天的哈希表到最后觉得不如用红黑树... | |
| // 造轮子的下场果然是跪呢... | |
| // by fleuria 2012 | |
| #include <assert.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include "str.h" | |
| #include "pool.h" | |
| #include "hash.h" |