###grub rescue模式下修复
由于在rescue模式下,只有少量的基本命令可用,必须通过一定的操作才能加载正常模块,然后进入正常模式。
rescue模式下可使用的命令有:set,ls,insmod,root,prefix(设置启动路径)
先假设grub2的核心文件在(hd0,8)分区,再来看看怎样从 rescue模式进入从(hd0,8)启动的正常模式(normal)。
在 rescue模式下search命令不能用,对不清楚grub2文件处于哪个分区的,可以用ls命令查看,比如
#include <iostream> | |
#include <vector> | |
#include <string> | |
void print(const std::string &s, size_t i) { | |
size_t len = s.length(); | |
size_t space_count = i < len ? i : len; | |
for(size_t j = 0; j < space_count; ++j) | |
std::cout << " "; | |
if (space_count < len) |
#!/usr/bin/env python | |
# encoding: utf-8 | |
''' | |
replace one word with another recursively | |
''' | |
import os | |
import subprocess | |
import os.path |
#! /usr/bin/env python | |
import redis | |
import random | |
import pylibmc | |
import sys | |
r = redis.Redis(host = 'localhost', port = 6389) | |
mc = pylibmc.Client(['localhost:11222']) |
#!/bin/bash | |
for p in `cat all_packages`; | |
do | |
yaourt -S $p --needed --noconfirm | |
done |
###grub rescue模式下修复
由于在rescue模式下,只有少量的基本命令可用,必须通过一定的操作才能加载正常模块,然后进入正常模式。
rescue模式下可使用的命令有:set,ls,insmod,root,prefix(设置启动路径)
先假设grub2的核心文件在(hd0,8)分区,再来看看怎样从 rescue模式进入从(hd0,8)启动的正常模式(normal)。
在 rescue模式下search命令不能用,对不清楚grub2文件处于哪个分区的,可以用ls命令查看,比如
# coding: utf-8 | |
cache = dict() | |
def f(n): | |
if n <= 0: | |
return 0 | |
prev = cache.get(n-1) | |
if not prev: | |
s = 1; | |
for i in range(1, n+1): | |
s *= i |
#!/bin/bash | |
g++ -std=c++11 `pkg-config --libs tesseract opencv lept` $1 -o ${1}.out |
Loading data ... | |
Loading dev ... | |
10000 | |
10000 | |
9842 | |
Loading test ... | |
10000 | |
10000 | |
9824 | |
num_epochs: 20 |