分类 Linux 下的文章

ArchLinux的备份以及恢复方法

过程概述:

直接硬盘数据对拷速度快,挂载新旧硬盘,然后使用 cp -a 将就数据拷贝到新硬盘。接着chroot后,重新生成fstab,再使用grub-install以及grub-mkconfig生成新的引导文件。

步骤一:挂载与复制数据

  1. 将SSD放到原来的HDD硬盘位,原HDD硬盘使用光驱位硬盘架放到光驱位,装好后开机,引导进U盘中的ArchLinux LiveCD

  2. 输入命令 lsblk 查看分区信息,举例来说:SSD为128G sda1,HDD为320G sdb3(若SSD为sda,则使用 fdisk 新建分区并mkfs 将分区格式化为指定的文件系统,推荐 Btrfs)

  3. 使用 mkdir /newmkdir /old ,创建两个文件夹,使用 mount /dev/sda1 /newmount /dev/sdb3 将SSD挂在到 new 文件夹,将 HDD 挂载到 old 文件夹,使用 ls /old 查看 old 文件列表,防止挂载错

  4. 使用 cp -a /old/* /new 将原分区数据全部拷贝到SSD

  5. 稍等几分钟等待数据拷贝完成

步骤二:新fstab以及Grub

  1. 可以使用 vi /etc/fstab 手写 fstab ,或者使用 genfstab 自动生成 fstab ,命令如下 genfstab -U -p /new >> /new/etc/fstab 或者 genfstab -U /new /new/etc/fstab ,再检查 vi /mnt/etc/fstab 查看是否正确

  2. 进入chroot: arch-root /new

  3. 安装 bootloader并生成新的引导: grub-install --target=i386-pc --recheck /dev/sda 再 grub-mkconfig -o /boot/grub/grub.cfg

步骤三:重启

  1. 离开 chroot 环境: exit

  2. 重启: reboot

步骤四:大功告成!

ArchLinux笔记本外接显示器的分辨率以及布局的设置

"xrandr" 是一款官方的 RandR Wikipedia:X Window System 扩展配置工具。它可以设置屏幕显示的大小、方向、镜像等。对多显示器的情况,也可使用 arandr 或 lxrandr 等图形前端作为替代。

我从Xfce4转到了LXDE桌面,由于是笔记本(1366×768)外接26寸显示器(1920×1080),导致两屏幕的布局有问题。

以下两图是LXDE的默认设置,左右排列的话是以上部分为对齐。但是我想要以下部分对齐,所以安装arander。

      

arander的GUI设置可以轻易的实现这个要求。

为ArchLinux安装Linux-ck内核

1. 简介

Linux-ck是 AUR 中的一个包,在非官方 linux-ck 源中允许用户运行一个定制的内核/头文件,基于 Con Kolivas 的 ck1 补丁集,包括 Brain Fuck Scheduler (BFS)。许多 Archer 选择使用这个包,因为 BFS 在任意负载状况下都具有优异的桌面交互性能和敏捷反应特性。

2. 安装

  • 添加源到  /etc/pacman.conf (我把这个条目放在文件末尾):

[repo-ck] 
Server = http://repo-ck.com/$arch 
  • 添加验证Key  

# pacman-key -r 5EE46C4C && pacman-key --lsign-key 5EE46C4C
  • 通过  pacman -Syy  刷新 

  • 直接用 Pacman 安装包: 

# pacman -S linux-ck linux-ck-headers 

3. 添加引导项目到Grub

通过以下命令, 重新编译  /boot/grub/grub.cfg

# grub-mkconfig -o /boot/grub/grub.cfg

linux下升级Python至2.x的最新版

简介

  • 之所以是2.x的最新版,而不是最新版,原因有很多,不过最大的原因还是兼容问题,以及以及软件库的可用量问题。
  • 显然2.x就像是Windows,而3.x就像是linux(当然这个比喻或许有点不恰当。linux的应用对比Windows来说不会少太多。)
  • 虽然性能优异,但是3.x的应用库还是略显稀少多数第三方库都还在使用2.x版本的Python。

步骤如下

1. 下载:

$ wget -c https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz

2. 解压

$ tar zxvf Python-2.7.9.tgz

3. 安装

# cd Python-2.7.9 && ./configure  && make && make install

1. 注意,这个是覆盖安装,如果有更多老版本需求,建议在configure 后面添加路径参数,如:–prefix=/usr/python27

  2. use root to install it! 

4. 看看成果吧。python v2.7.9

python -V


Install PIP

https://pip.pypa.io/en/latest/installing.html

# curl -O https://bootstrap.pypa.io/get-pip.py
# python get-pip.py

Angry IP Scanner: Scan IP Addresses And Ports For Analyzing Networks

Angry IP Scanner, also known as ipscan, is an open source network scanning tool that can be used to scan the ip addresses and ports on your network. It supports Linux, Windows, MAc OSX and other platforms. It has designed to be fast and simple to use. It has been used by Network administrators on almost all organizations.

Features

- Lightweight and cross-platform.
– Scans ip addresses in any range.
– Doesn’t require any installation
– Check for ip address if it is alive.
– Resolves hostnames, determines ip addresses and scans ports.
– Multi-threaded support to speed up scanning process.

Installation

As i mentioned before, we don’t have to install it. All we need is our system should have installed with Oracle java or openjdk. Just download the ipscan jar file and run it with command:

# java -jar ipscan.x.x.jar

Also you can install it if you wish. Just download deb/rpm packages and install as described below.

Hence all modern operating system comes with openjdk in their default repositories, we don’t have to worry about openjdk installation.

First install openjdk using command:

On Debian/Ubuntu:

$ sudo apt-get install openjdk-7-jdk

On RHEL/CentOS:

# yum install java-1.7.0-openjdk

Then grab Angry IP Scanner latest version from here depending upon your platform and  architecture.

After downloading it, go to the directory where you have downloaded and install it using command:

On Debian/Ubuntu:

$ sudo dpkg -i ipscan_3.2.1_*.deb

On RHEL/CentOS:

[[email protected] ~]# rpm -Uvh /ipscan-3.2.1-*.rpm

Launch Angry IP Scanner

After installing, launch it either from Menu or Dash. At the first launch, you’ll pleased with Getting Started screen. You can read it by clicking on the Next button or click Close to exit Getting Started screen.

IP Range - Angry IP Scanner _001By default, your local ip address is selected. You can specify other ip addresses as well to start scan.

IP Range - Angry IP Scanner _002

Scan Local System

Let us start with local system ip address. Click Start to scan. After a couple of seconds, you will get the Scan Statistics like below.

Scan Statistics _003To view the hostname, ports of the system, just double click on the ip address. You will get the details as shown here.

IP address details _006Scan ‘n’ number of  system

In the above test, we scanned only single system, i.e I entered the the same ip address on IP Range boxes. Now let me scan some remote systems on my network. Say for example, let us scan systems whose has ip address between 192.168.1.100 to 192.168.1.110.

Enter ip addresses 192.168.1.100 and 192.168.1.110 in the from and to column boxes of IP Range and click Start button.

Now you’ll see the list of alive hosts in the range of network that you have entered.

IP Range - Angry IP Scanner _007As you see in the above statistics, i have two hosts running on my network. Pretty easy, isn’t?

More Commands

Not only it displays the alive hosts in your network, also it will allow you to manage the remote systems. Let us see how.

Let us say you want to ssh to a system on your network. Just right click on the ip address, go to Open and select SSH. Alternatively you can open it from Menu bar. Click on the Commands button on the menu bar and go to Open -> SSH.

Menu_010A new small window will appear and will ask the password the password to log in to the system. Enter it and you’re in business. Now you should be able to ssh to your remote system.

sk@server:~_011Be mindful that, your remote server have SSH installed, otherwise you won’t be able to connect via ssh. Like this way, you can do various commands such as ftp, trace route, telnet etc.

While testing this app, i found myself, it will be quite useful for Network administrators. It is simple, but powerful and it does the job as advertised. Hope it will be useful for you.

Good luck!

最新文章

最近回复

  • 测试: 评论测试内容
  • 袅残烟: [嘻嘻]万网域名也降价了
  • yxy: 以后,我会经常来逛的。
  • 袅残烟: LXDE可以搭配xf...
  • Fooleap: 从好几年前用 Lub...

分类

  • 默认分类 (25)
  • 运维 (53)
  • docker (1)
  • 动漫 (19)
  • 科普知识 (15)
  • 苍白边缘 (17)
  • 资源 (12)
  • Linux (58)
  • Arch Linux (19)
  • 计算机 (18)
  • 编程 (3)
  • Java (4)
  • python (0)
  • php (0)
  • 前端 (1)
  • 公告 (1)
  • 归档




      其它