顯示具有 ubuntu 標籤的文章。 顯示所有文章
顯示具有 ubuntu 標籤的文章。 顯示所有文章

2019年4月1日 星期一

print_req_error message from Ubuntu 18.04.2 with Hyper-V

In the recent Ubuntu 18.04.2 on Hyper-V, I noticed that an error keeps popping up to my terminal:

[%] print_req_error: I/O error, dev fd0, sector 0

After searching the problem, the following commands help resolve the problem

Execute the following with sudo

# rmmod floppy
# echo "blacklist floppy" | tee /etc/modprobe.d/blacklist-floppy.conf 

# dpkg-reconfigure initramfs-tools

Reference:
https://tinycp.com/community/show/solved-print-req-error-i-o-error-dev-fd0-sector-0,43.html

2017年12月7日 星期四

在 Ubuntu 上設置 Swap 空間

最近在使用Google Compute Engine,想要省錢,但又需要稍大的記憶體空間

看到一個基本的 Ubuntu 16.04 LTS 需要 10 GB 的空間,但實際的空間大小卻只約用到 2 GB

即然硬碟好大,就拿來玩玩 Swap 吧

下面的 script 可增加 1 GB 的 Swap 空間
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

實際運作上,swap可能會跑掉;也就是最後一行的 swapon 可能要自己手動重打一便,才可被系統抓到

參考資料: https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04

2016年2月19日 星期五

一些與hadoop有關的命令記錄

直接對同機台上另一個帳號下命令

su hdfs -c '~/hdfs/sbin/stop-dfs.sh'

使用hadoop streaming

bin/hadoop jar share/hadoop/tools/lib/hadoop-streaming-2.7.1.jar \
    -input /usr/ctfan/input01 \
    -output /usr/ctfan/output/folder \
    -mapper mapper.py \
    -reducer reducer.py \
    -file ~/ctfan/pyStreaming/mapper.py \
    -file ~/ctfan/pyStreaming/reducer.py

mapper.py

#!/usr/bin/env python
import sys
for line in sys.stdin:
    line = line.strip()
    words = line.split()
    for word in words:
        print '%s\t%s' % (word, 1)

reducer.py

#!/usr/bin/env python
from operator import itemgetter
import sys
current_word = None
current_count = 0
word = None
for line in sys.stdin:
    line = line.strip()
    word, count = line.split('\t', 1)
    try:
        count = int(count)
    except ValueError:
        continue

    if current_word == word:
        current_count += count
    else:
        if current_word:
            print '%s\t%s' % (current_word, current_count)
        current_count = count
        current_word = word

if current_word == word:
    print '%s\t%s' % (current_word, current_count)

單機測試streaming命令

echo 'a b c a b' | ./mapper.py | sort -k1,1 | ./reducer.py

參考網頁

hadoop官方文件
Michael G. Noll's Blog

2015年11月20日 星期五

Installation procedures of Hadoop 2.7.1

A Windows 7 computer with Oracle VM VirtualBox installed is exploited.  Within VirtualBox, Ubuntu 14.04.3 is installed on each VM created.
The following are the procedures of installing hadoop version 2.7.1.

2012年5月7日 星期一

如何在 Ubuntu 中為滑鼠加速

換了 Ubuntu 12.04 後,系統中的滑鼠設定,就是調不快

後來找到了這篇,讓我可以將滑鼠的移動速度加快

xset m 5 2;

這樣滑鼠就可以變快囉

2012年5月2日 星期三

Fresh Install/Upgrading from Ubuntu 10.04.4 to Ubuntu 12.04

1. Backup all the data to another hard drive.  Only needed data is copied, since I want a Fresh Upgrade.

back up things

2. Download Ubuntu, extract it to a pen drive

get ubuntu, and extract it with LinuxLive USB Creator.

3. Use GParted to partition

Errors of not able to format FAT32, so I uses GParted to partition the following table for me.

Setting: 

32MB - beginning of hard drive
2GB - Swap area
25GB - Root
100GB - Home folder
Rest - Fat32 as normal portable hard disk

If error still occur, try to partition one block per time.

4. Boot the pen drive and start install process

5. Other Settings

shutting down grub for searching other process while updating OS
sudo chmod -x 30_os-prober

Network manager 
sudo vi /etc/NetworkManager.conf
change false to true

adding repos

that is

2011年5月1日 星期日

java.io.IOException: org.apache.hadoop.fs.FSError: java.io.IOException: No space left on device

If you got following problem:

java.io.IOException: org.apache.hadoop.fs.FSError: java.io.IOException: No space left on device

This means that your space is running out.  Usually the /tmp space

To make more space, one is to add /tmp's space

Or there is another option: Set hadoop.tmp.dir in conf/core-site.xml to /home/hadoop/tmp


That is the easiest way to extend the space

2010年12月15日 星期三

Setup Hadoop with Clonezilla

This is a log that I used to install a Hadoop in Ubuntu, using with Clonezilla to quick install many computer.


2010年11月29日 星期一

Transfer file from Windows with SSH to Ubuntu

This will tell you how to transfer files from Windows to Ubuntu.

1) Download SSH client programs
    Here, I'm using Putty as the client of Windows side.  Download All binary is recommended.  We will use PSCP to transfer file.

2) Extract all putty binary to somewhere.  Add "C:/Path/To/All/Putty/Binary" to My Computer/Environment variable/Path .  So that we can use the command line to upload file.

3) Install ssh by typing:
sudo apt-get install ssh
.

4) Open cmd of the Windows, use following command to transfer file to Ubuntu computer
pscp [-r] <source file path> <name>@<IP><destination path from ~ >

2010年5月11日 星期二

WallpaperTray is not working in Ubuntu 10.04 (Lucid)

WallpaperTray is a good Gnome applet that it altomatically search user defined directory and ramdomly change your Wallpaper.  But it seems that it do not have anyone to maintaince the project.  And in Ubuntu 10.04, it is not the default packet that you can select from the Synaptic.  But you can install by compiling the orginal code.  Here is how it works.

1), download the wallpaper-tray_0.5.5.orig.tar.gz from Here.

2), extract it to a folder.  For example, /home//wp_tray

3), open the command, change the folder to where it is extracted.
cd ~/wp_tray

4), type the following command
./configure  --prefix=/usr
Normally, it  will have some error.  That is because you have some packet that is not installed. (For example, the gnome-dev.)  The packet you lack of will show at the bottom of the console window, just scroll up a little, and you will see the list.  Open Synaptic and install all packet you need.  Until there is no error when you excute this command.

5), compile the source code by entering the following command
make
This will compile all the source code.  It may takes a while.

6), install WallpaperTray by the following command
sudo make install
This will copy all the binary file that just compiled to the proper location in your OS.

7), logout and login to refresh the gnome setting.  After that, you may select WallpaperTray as the old way.

Also note that there should have no error when excuting the commands upon.

You may also notice that there is the .deb file of WallpaperTray in here when you download the source code on step 1.  Why not just download the .deb file from one of the list?  The reason is simple.  Some of the packet it depands have updated, but the WallpaperTray project did not update.  When installing, it will say that you have no ... package installed, but the packet is the old packet.  And this is the reason that you can not install this applet directly from Synaptic.  However, we can't install from the .deb file, but we can re-compile the source code and link to the newer library, and the problem is solved.

Updating Ubuntu from 9.04(Jaunty) to 10.04(Lucid) with clean install (not update)

Since Ubuntu 9.10(karmic) have some issue with my external hard disk.  I stopped and wait until 10.04 release.  Here is how I update from 9.04 to 10.04 using clean install.

1), change the /home from ext3 to ext4.

2), format the root(/) to fat32 (using GParted in the Ubuntu Desktop version).

3), format the root(/) to ext4 (using GParted in the Ubuntu Desktop version).

4), install Ubuntu 10.04.

5), when install, choose where the root is install, and also set your /home partition as /home. (It will not format the /home, just for mount issue when startup.)

Note that on the step 2 and 3, it seems that it could directly format to ext4, or when install 10.04, it will format directly.  But as I tested on other disk, It did not success, and it shows that it cannot remove another operating system (that is, 9.04).  So I format the root to fat32, and than format back.  Another reason is that if you delete the partition and create a new partition, the partitioning table on the harddrive may not work as what you expected.  It may change from sda5 to sda9 (in my case).

2010年5月8日 星期六

Ubuntu flash 亂碼的問題

每次重灌都遇到同樣的問題,就把他收到blog中啦

做法如下:

在 command line 下輸入
sudo gedit /etc/fonts/conf.d/49-sansserif.conf

然後將兩個「sans-serif」改成「sans serif」即可


參考網站:http://blog.yam.com/lijohnson/trackback/18793178

2009年12月3日 星期四

How to Build Chrome OS

Here, I will show how to build Google Chrome OS in a simple way.

Enviroment:
  1. Ubuntu 8.04 or Ubuntu 9.10, but it was fine to use Ubuntu 9.04 to build (it works fine with me).
  2. An account which can use "sudo" command.
  3. Internet environment, since we get all the source on the cloud.
Notice, there should have no error for the following steps.  If you have the problem, you should try to resolve it rather than skip it.

(1) Install packages by following command.
sudo apt-get install subversion pkg-config python perl g++ g++-multilib bison flex gperf libnss3-dev libgtk2.0-dev libnspr4-0d libasound2-dev libnspr4-dev msttcorefonts libgconf2-dev libcairo2-dev libdbus-1-dev wdiff lighttpd php5-cgi sun-java6-fonts git-core;
  For the builder in Taiwan, there will be a problem while installing msttcorefonts.  It is a problem of the server, not your problem.  Try the method below to solve the problem.
$ host ncu.dl.sourceforge.net;
ncu.dl.sourceforge.net has address 140.115.17.45
$host nchc.dl.sourceforge.net
nchc.dl.sourceforge.net has address 211.79.60.17
nchc.dl.sourceforge.net has IPv6 address 2001:e10:ffff:1f02::17
$echo "211.79.60.17 ncu.dl.sourceforge.net" >> /etc/hosts;
$sudo apt-get install msttcorefonts;
  For further information, please refer to this website(chinese).

(2) Get gclinet(depot_tools)

  Get the depot_tools by download it and unzip it in your home folder.  Here, we provide the easiest way to get the tool.  For further information, please refer to the website(english).

  Next, modify the file in /home/<Your Account>/.bashrc by following command.

sudo gedit ~/.bashrc;
  Add the following line in the end of the file, and save it

export PATH=${PATH}:/home/<your account>/<path to depot_tools>/depot_tools

  Remeber to restart the terminal window to reload the bash file.  You should try typing "gclient" first to try if it is setting properly.

(3) Get the source of Google Chrome OS

  Use the following command to get the newest Google Ghrome OS's source code.
mkdir chromiumos;
cd chromiumos;
gclient config http://src.chromium.org/git/chromiumos.git;
gclient sync;
  This will take a while.

(4) Build the Google Chrome OS

  Use the following command to build Google Chrome OS. All the command has been written in the directory chromiumos/chromiumos.git/src/script . You switch to there first.
./make_local_repo.sh;
./make_chroot.sh;
  If you failed on the first command, before re-build it, you should remove a folder by following command.
sudo rm -rf ~/chromiumos/chromiumos.git/repo/;
  If you failed on the second command, you should use the following command instead.
./make_chroot.sh --replace;

(5) Download Chrome Browser

  This step is simple, just goto this link and download the file like chromium-chromiumos-rxxxxx.zip, save it in ~/chromiumos/chromiumos.git/src/build/x86/local_assets, and than rename it into chromium-chromiumos.zip.

(6) Make the image

  Use the folling commands to make the image of Google Chrome OS
./enter_chroot.sh;
( cd ../platform/pam_google && ./enable_localaccount.sh USERNAME );
./set_shared_user_password.sh;
./build_platform_packages.sh;
./build_kernel.sh;
./build_image.sh;
exit;
  The image will be saved in ~/chromiumos/src/build/images/ .

(7) Use the image
  Here, we just simply put the image into a usb drive by following command.
./image_to_usb.sh --from=~/chromiumos/src/build/images/SUBDIR --to=/dev/USBKEYDEV;
  You can find the value of your usb drive by "sudo fdisk -l;".

  At last, your Chrome OS is finally done.
 
  To test it, you can plug in the usb drive to any computer, boot it by usb. than you will see the Chrome OS login screen.  The user name and password is what you type before, not the google account.