小编Nat*_*hek的帖子

如何在启动时自动响应fsck提示

我在单板计算机上有一个ubuntu服务器(11.10),偶尔可能会被关闭.当它在之后启动时,fsck会提示用户按'f'来检查驱动器.因为这个服务器通常没有连接监视器和键盘,并且正常访问它的唯一方法是通过SSH,这非常不方便.

有没有办法保证在启动时可以在没有用户输入的情况下完成任何所需的fsck检查?基本上,我希望它始终在启动时运行'fsck -y'(当检测到问题时),而不是提示用户输入.

谢谢!

filesystems ubuntu

10
推荐指数
1
解决办法
1万
查看次数

WebP编码 - 分段错误

所以我正在尝试使用webp API来编码图像.现在我将使用openCV来打开和操作图像,然后我想将它们保存为webp.这是我正在使用的来源:

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>
#include <webp/encode.h>

int main(int argc, char *argv[])
{

    IplImage* img = 0;
    int height,width,step,channels;
    uchar *data;
    int i,j,k;
    if (argc<2) {
        printf("Usage:main <image-file-name>\n\7");
    exit(0);
    }
    // load an image
    img=cvLoadImage(argv[1]);

    if(!img){
        printf("could not load image file: %s\n",argv[1]);
        exit(0);
    }

    // get the image data
    height      = img->height;
    width       = img->width;
    step        = img->widthStep;
    channels    = img->nChannels;
    data        = (uchar *)img->imageData;
    printf("processing a %dx%d image with %d channels \n", …
Run Code Online (Sandbox Code Playgroud)

c++ opencv webp

1
推荐指数
1
解决办法
1468
查看次数

标签 统计

c++ ×1

filesystems ×1

opencv ×1

ubuntu ×1

webp ×1