###grub rescue模式下修复
由于在rescue模式下,只有少量的基本命令可用,必须通过一定的操作才能加载正常模块,然后进入正常模式。
rescue模式下可使用的命令有:set,ls,insmod,root,prefix(设置启动路径)
先假设grub2的核心文件在(hd0,8)分区,再来看看怎样从 rescue模式进入从(hd0,8)启动的正常模式(normal)。
在 rescue模式下search命令不能用,对不清楚grub2文件处于哪个分区的,可以用ls命令查看,比如
| Loading data ... | |
| Loading dev ... | |
| 10000 | |
| 10000 | |
| 9842 | |
| Loading test ... | |
| 10000 | |
| 10000 | |
| 9824 | |
| num_epochs: 20 |
| #!/bin/bash | |
| g++ -std=c++11 `pkg-config --libs tesseract opencv lept` $1 -o ${1}.out |
| # 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 |
###grub rescue模式下修复
由于在rescue模式下,只有少量的基本命令可用,必须通过一定的操作才能加载正常模块,然后进入正常模式。
rescue模式下可使用的命令有:set,ls,insmod,root,prefix(设置启动路径)
先假设grub2的核心文件在(hd0,8)分区,再来看看怎样从 rescue模式进入从(hd0,8)启动的正常模式(normal)。
在 rescue模式下search命令不能用,对不清楚grub2文件处于哪个分区的,可以用ls命令查看,比如
| #!/bin/bash | |
| for p in `cat all_packages`; | |
| do | |
| yaourt -S $p --needed --noconfirm | |
| done |
| #! /usr/bin/env python | |
| import redis | |
| import random | |
| import pylibmc | |
| import sys | |
| r = redis.Redis(host = 'localhost', port = 6389) | |
| mc = pylibmc.Client(['localhost:11222']) |
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| ''' | |
| replace one word with another recursively | |
| ''' | |
| import os | |
| import subprocess | |
| import os.path |
| #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) |
| #include <iostream> | |
| class Base { | |
| public: | |
| Base() { | |
| std::cout << "Base Constructor" << std::endl; | |
| ctor(); | |
| } | |
| virtual ~Base() { | |
| std::cout << "Base Destructor" << std::endl; |
| #include <iostream> | |
| #include <ostream> | |
| #include <string> | |
| #include <vector> | |
| //comment this define to see reallocate | |
| #define F4 | |
| class Test { | |
| public: | |
| std::string tag; | |
| Test(std::string &t) : tag(t) { |