sudo apt-get install hdparm
sudo hdparm -Tt /dev/sdX
Timing cached reads: 3164 MB in 2.00 seconds = 1582.31 MB/sec
Timing buffered disk reads: 238 MB in 3.01 seconds = 79.08 MB/sec
本站為個人筆記之用途,主要內容為電腦技術及生活分享。
dd if=/dev/zero of=sdcard.img bs=1G count=1
file sdcard.img hexdump sdcard.img
losetup /dev/loop0 sdcard.img
sudo fdisk /dev/loop0 n p 1 [enter] +80M n p 2 [enter] [enter] t 1 b p w
fdisk -lu /dev/loop0查看分割,輸出如下:
losetup -o `expr 512 \* 2048` /dev/loop1 /dev/loop0 losetup -o `expr 512 \* 165888` /dev/loop2 /dev/loop0
losetup -a
apt-get install dosfstools
fdisk -lu /dev/loop0查看分割,輸出如下:
mkfs.vfat /dev/loop1 81920 mkfs.ext4 /dev/loop2 965632
blkid /dev/loop1/dev/loop1: SEC_TYPE="msdos" UUID="3A38-5A24" TYPE="vfat"
blkid /dev/loop2/dev/loop2: UUID="dec7a9d5-b0bb-433b-aefb-6b4eecc28aba" TYPE="ext4"
mkdir /sd1 /sd2
mount /dev/loop1 /sd1 mount /dev/loop2 /sd2
df -h
umount /sd1 umount /sd2 df -h
losetup -a losetup -d /dev/loop2 losetup -d /dev/loop1 losetup -d /dev/loop0 losetup -a
losetup /dev/loop0 sdcard.img losetup -o `expr 512 * 2048` /dev/loop1 losetup -o `expr 512 * 165888` /dev/loop2 losetup -a mount /dev/loop1 /sd1 mount /dev/loop2 /sd2 df -h
mkfs -t ntfs /dev/sdb1 mkfs.ntfs /dev/sdb1
sudo apt-get install ntfsprogs mkntfs -f /dev/sdb1
mkfs.ext4 -T largefile /dev/sdb1
iconv -f big5 -t utf-8 big5.txt -o utf8.txt(2) UTF-8 To Big-5
iconv -f utf-8 -t big5 utf8.txt -o big5.txt
sudo vi /etc/apt/sources.list
deb http://ftp.tw.debian.org/debian wheezy-backports main
sudo apt-get update && apt-get upgrade
tar xfva qemu-linaro-1.7.0-2014.01.tar.gz cd qemu-linaro-1.7.0-2014.01/ ./configure
ERROR: pixman not present. Your options: (1) Preferred: Install the pixman devel package (any recent distro should have packages as Xorg needs pixman too). (2) Fetch the pixman submodule, using: git submodule update --init pixman解決1:
sudo apt-get install libseccomp-dev
ERROR: DTC not present. Your options: (1) Preferred: Install the DTC devel package (2) Fetch the DTC submodule, using: git submodule update --init dtc解決2:
sudo apt-get install -y libfdt-dev
sudo apt-get install libnss3-dev libudev-dev libpng12-dev libghc6-zlib-dev libogg-dev libglobus-openssl-dev libxrandr-dev libxfixes-dev libjpeg8-dev libsasl2-dev libiscsi-dev librbd-dev xfslibs-dev libbrlapi-dev libbluetooth-dev libxen-dev libvte-dev libseccomp-dev python-pyparsing
vi configure
tar xfva spice-0.12.5.tar.bz2 cd spice-0.12.5/
./configure --enable-smartcard
make -j ${core number} sudo make install
Alternatively, you may set the environment variables CELT051_CFLAGS and CELT051_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
tar xfva celt-0.5.1.3.tar.gz cd celt-0.5.1.3/ ./configure make -j ${core number} sudo make install
checking for pyparsing python module... not found configure: error: pyparsing python module is required to compile this package解決:
sudo apt-get install python-pyparsing
checking sasl/sasl.h usability... no checking sasl/sasl.h presence... no checking for sasl/sasl.h... no checking for sasl_client_init in -lsasl2... no checking for sasl_client_init in -lsasl... no configure: error: Missing required Cyrus SASL development package解決:
sudo apt-get install libsasl2-dev
checking for SMARTCARD... no configure: error: Package requirements (libcacard >= 0.1.2) were not met: No package 'libcacard' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables SMARTCARD_CFLAGS and SMARTCARD_LIBS to avoid the need to call pkg-config.解決:
tar xfva libcacard-0.1.2.tar.bz2 cd libcacard-0.1.2/ ./configure make -j ${core number} sudo make install
checking for NSS... no configure: error: Package requirements (nss) were not met: No package 'nss' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NSS_CFLAGS and NSS_LIBS to avoid the need to call pkg-config.解決:
sudo apt-get install libnss3-dev
tar xfva spice-protocol-0.12.7.tar.bz2 cd spice-protocol-0.12.7/ ./configure make -j ${core number} sudo make install
tar xfva libusb-1.0.19.tar.bz2 cd libusb-1.0.19/ ./configure make -j ${core number} sudo make install
tar xfva usbredir-0.7.tar.bz2 cd usbredir-0.7/ ./configure make -j ${core number} sudo make install
cd qemu-linaro-1.7.0-2014.01/ ./configure內容如下:
tcg debug enabled no gprof enabled no sparse enabled no strip binaries yes profiler no static build no -Werror enabled no pixman system SDL support yes GTK support yes curses support yes curl support yes mingw32 support no Audio drivers oss Block whitelist (rw) Block whitelist (ro) VirtFS support yes VNC support yes VNC TLS support yes VNC SASL support yes VNC JPEG support yes VNC PNG support yes VNC WS support yes xen support yes brlapi support yes bluez support yes Documentation yes GUEST_BASE yes PIE yes vde support yes Linux AIO support yes ATTR/XATTR support yes Install blobs yes KVM support yes RDMA support yes TCG interpreter no fdt support yes preadv support yes fdatasync yes madvise yes posix_madvise yes sigev_thread_id yes uuid support yes libcap-ng support yes vhost-net support yes vhost-scsi support yes Trace backend nop Trace output file trace-接著編譯:spice support yes (0.12.7/0.12.5) rbd support yes xfsctl support yes nss used yes libusb yes usb net redir yes GLX support yes libiscsi support yes build guest agent yes QGA VSS support no seccomp support yes coroutine backend ucontext coroutine pool yes GlusterFS support no virtio-blk-data-plane yes gcov gcov gcov enabled no TPM support no libssh2 support yes TPM passthrough no QOM debugging yes vhdx yes
make -j ${core number}安裝:
sudo make install
ldconfig
qemu-system-arm -version
QEMU emulator version 1.7.0 (qemu-linaro 2014.01), Copyright (c) 2003-2008 Fabrice Bellard
qemu-system-arm -M ?
Supported machines are: none empty machine beagle Beagle board (OMAP3530) beaglexm Beagle board XM (OMAP3630) collie Collie PDA (SA-1110) nuri Samsung NURI board (Exynos4210) smdkc210 Samsung SMDKC210 board (Exynos4210) connex Gumstix Connex (PXA255) verdex Gumstix Verdex (PXA270) highbank Calxeda Highbank (ECX-1000) midway Calxeda Midway (ECX-2000) integratorcp ARM Integrator/CP (ARM926EJ-S) (default) kzm ARM KZM Emulation Baseboard (ARM1136) mainstone Mainstone II (PXA27x) musicpal Marvell 88w8618 / MusicPal (ARM926EJ-S) n800 Nokia N800 tablet aka. RX-34 (OMAP2420) n810 Nokia N810 tablet aka. RX-44 (OMAP2420) n900 Nokia N900 (OMAP3) sx1 Siemens SX1 (OMAP310) V2 sx1-v1 Siemens SX1 (OMAP310) V1 overo Gumstix Overo board (OMAP3530) cheetah Palm Tungsten|E aka. Cheetah PDA (OMAP310) realview-eb ARM RealView Emulation Baseboard (ARM926EJ-S) realview-eb-mpcore ARM RealView Emulation Baseboard (ARM11MPCore) realview-pb-a8 ARM RealView Platform Baseboard for Cortex-A8 realview-pbx-a9 ARM RealView Platform Baseboard Explore for Cortex-A9 akita Akita PDA (PXA270) spitz Spitz PDA (PXA270) borzoi Borzoi PDA (PXA270) terrier Terrier PDA (PXA270) lm3s811evb Stellaris LM3S811EVB lm3s6965evb Stellaris LM3S6965EVB tosa Tosa PDA (PXA255) versatilepb ARM Versatile/PB (ARM926EJ-S) versatileab ARM Versatile/AB (ARM926EJ-S) vexpress-a9 ARM Versatile Express for Cortex-A9 vexpress-a15 ARM Versatile Express for Cortex-A15 xilinx-zynq-a9 Xilinx Zynq Platform Baseboard for Cortex-A9 z2 Zipit Z2 (PXA27x)
file arm.img hexdump arm.img
dd if=/dev/zero of=arm_test.img bs=1G count=2 file arm_test.img hexdump arm_test.img
加法: expr 5 + 2 減法: expr 5 - 2 乘法: expr 5 \* 2 除法: expr 5 / 2
cd ~/qemu_image su 查看連接狀況: losetup -a 將 /dev/loop0 連接 arm.img: losetup /dev/loop0 arm.img
fdisk -lu /dev/loop0所用裝置 開機 開始 結束 區塊 識別號 系統
losetup -o `expr 512 \* 2048` /dev/loop1 /dev/loop0
sudo mount /dev/loop1 /mnt
cd /mnt/boot cp vmlinuz-3.2.0-4-versatile ~/qemu_image cp initrd.img-3.2.0-4-versatile ~/qemu_image
vi runarm.sh
# !/bin/bash # # Run arm.img qemu-system-arm -M versatilepb -m 512 \ -kernel ~qemu_image/vmlinuz-3.2.0-4-versatile \ -initrd ~qemu_image/initrd.img-3.2.0-4-versatile \ -hda ~qemu_image/arm.img \ -append "root=/dev/sda1" &
sh runarm.sh
cat /proc/cpuinfo
sudo apt-get update && apt-get upgrade -y
sudo apt-get install icewm xorg
apt-get clean
startx
sudo apt-get install iceweasel apache2 iceweasel &網址列: localhost
sudo halt
vi Backup_data.sh
#!/bin/bash # 2014/06/24 KLin # Backup My data. # parameter setting TIME=`date +"%Y%m%d"` # Use Setting USER=youUsserName SAVE_AS=/bak_dir BAK_DIR=backup_$TIME BAK_TARGET=$SAVE_AS/$BAK_DIR # check account if [ ! `whoami` == root ];then echo "Permision Deny, you're no root." exit 0 fi # check directory if [ -e "$BAK_TARGET.tar.xz" ];then echo "Directory exist!" exit 0 fi # build directory mkdir $BAK_TARGET mkdir -p $BAK_TARGET/root_dir mkdir -p $BAK_TARGET/${USER}_dir ############################################################## ## Backup List # system backup list rsync -av /etc $BAK_TARGET/root_dir # root backup list rsync -av /root/.bashrc $BAK_TARGET/root_dir rsync -av /root/.vimrc $BAK_TARGET/root_dir rsync -av /root/* $BAK_TARGET/root_dir # user backup list rsync -av /home/$USER/.bashrc $BAK_TARGET/${USER}_dir rsync -av /home/$USER/.conkyrc $BAK_TARGET/${USER}_dir rsync -av /home/$USER/.vimrc $BAK_TARGET/${USER}_dir rsync -av /home/$USER/.xinitrc $BAK_TARGET/${USER}_dir rsync -av /home/$USER/.asoundrc $BAK_TARGET/${USER}_dir rsync -av /home/$USER/bin $BAK_TARGET/${USER}_dir rsync -av /home/$USER/images $BAK_TARGET/${USER}_dir rsync -av /home/$USER/Notes $BAK_TARGET/${USER}_dir rsync -av /home/$USER/Other_work $BAK_TARGET/${USER}_dir rsync -av /home/$USER/sdl $BAK_TARGET/${USER}_dir rsync -av /home/$USER/Script $BAK_TARGET/${USER}_dir rsync -av /home/$USER/Eclipse $BAK_TARGET/${USER}_dir rsync -av /home/$USER/Java $BAK_TARGET/${USER}_dir #rsync -av /home/$USER/driver $BAK_TARGET/${USER}_dir ############################################################## # compress cd $SAVE_AS;tar -c --xz -f $BAK_DIR.tar.xz $BAK_DIR # remove dir rm -r $BAK_TARGET # permision change chown $USER:$USER $BAK_TARGET.tar.xz
chmod a+x Backup_data.sh mv Backup_data.sh /usr/local/bin/
sudo apt-get -y install isc-dhcp-server
vi /etc/dhcp/dhcpd.conf subnet 192.168.9.0 netmask 255.255.255.0{ range 192.168.9.51 192.168.9.100; option subnet-mask 255.255.255.0; option broadcast-address 192.168.9.255; option routers 192.168.9.1; option domain-name-servers 120.117.2.1; next-server 192.168.9.254; filename "pxelinux.0";
/etc/init.d/isc-dhcp-server restart update-rc.d isc-dhcp-server defaults
[root@localhost ~]# ifconfig enp5s0 enp5s0: flags=4163mtu 1500 inet 120.117.73.XX netmask 255.255.255.0 broadcast 120.117.73.255 inet6 fe80::22cf:30ff:fe30:7273 prefixlen 64 scopeid 0x20 ether 20:cf:30:30:72:XX txqueuelen 0 (Ethernet) RX packets 42382 bytes 25199666 (24.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 17379 bytes 2544252 (2.4 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# vim /etc/udev/rules.d/70-persistent-net.rules [root@localhost ~]# cat /etc/udev/rules.d/70-persistent-net.rules SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="20:cf:30:30:72:73", ATTR{type}=="1", KERNEL=="eth", NAME="eth1" #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="10:c3:7b:45:7e:70", ATTR{type}=="1", KERNEL=="eth", NAME="eth0"
[root@localhost ~]# mv /etc/sysconfig/network-scripts/ifcfg-enp5s0 /etc/sysconfig/network-scripts/ifcfg-eth1
[root@localhost ~]# sed -i 's/enp5s0/eth1/g' /etc/sysconfig/network-scripts/ifcfg-eth1
[root@localhost ~]# echo "HWADDR=20:cf:30:30:72:XX" >> /etc/sysconfig/network-scripts/ifcfg-eth1
# yum install [套件名] # yum remove [套件名] # yum update [套件名] # yum update (全部套件)
[root@localhost ~]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# ll total 16 -rw-r--r--. 1 root root 1664 Aug 23 00:21 CentOS-Base.repo -rw-r--r--. 1 root root 649 Aug 23 00:21 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 1331 Aug 23 00:21 CentOS-Sources.repo -rw-r--r--. 1 root root 156 Aug 23 00:21 CentOS-Vault.repo
[root@localhost yum.repos.d]# mkdir old [root@localhost yum.repos.d]# mv CentOS-* old/
[root@localhost yum.repos.d]# vim mybase.repo myupdate.repo
[root@localhost yum.repos.d]# cat mybase.repo [mybase] name=mybase baseurl=ftp://ftp.twaren.net/Linux/CentOS/7/os/x86_64/ enabled=1 gpgcheck=0
[root@localhost yum.repos.d]# cat myupdate.repo [myupdate] name=myupdate baseurl=ftp://ftp.twaren.net/Linux/CentOS/7/updates/x86_64/ enabled=1 gpgcheck=0
[root@localhost yum.repos.d]# yum clean all Loaded plugins: fastestmirror, langpacks Cleaning repos: base extras google-chrome mybase myupdate updates Cleaning up everything Cleaning up list of fastest mirrors
[root@localhost yum.repos.d]# yum update Loaded plugins: fastestmirror, langpacks base | 3.6 kB 00:00 extras | 3.4 kB 00:00 google-chrome | 951 B 00:00 mybase | 3.6 kB 00:00 myupdate | 3.4 kB 00:00 updates | 3.4 kB 00:00 base/7/x86_64/primary_db FAILED http://ftp.twaren.net/Linux/CentOS/7.0.1406/os/x86_64/repodata/efa521576f53587de26616ea1e45f902993abcd9d67e707b8993b5f29bd15956-primary.sqlite.bz2: [Errno 14] HTTP Error 403 - Forbidden Trying other mirror. (1/7): base/7/x86_64/group_gz | 157 kB 00:00 (2/7): extras/7/x86_64/primary_db | 26 kB 00:00 (3/7): base/7/x86_64/primary_db | 4.9 MB 00:00 (4/7): updates/7/x86_64/primary_db | 3.6 MB 00:00 (5/7): mybase/group_gz | 157 kB 00:01 (6/7): myupdate/primary_db | 3.6 MB 00:02 (7/7): mybase/primary_db | 4.9 MB 00:02 google-chrome/primary | 1.9 kB 00:00 Determining fastest mirrors * base: ftp.stust.edu.tw * extras: ftp.stust.edu.tw * updates: ftp.stust.edu.tw google-chrome 3/3 No packages marked for update
sudo apt-get update && apt-get install ssh
ssh -Xl Account IP ssh -X Account@IP
Account : userA IP: 192.168.1.2 ssh -Xl userA 192.168.1.2 ssh -X userA@192.168.1.2-------------------------------------------------------------------------
vi /etc/ssh/sshd_config 將 「PermitRootLogin」關閉,設 no /etc/init.d/ssh restart
apt-get update apt-get install denyhosts openssh-blacklist openssh-blacklist-extra /etc/init.d/ssh restart
vi /etc/denyhosts.conf
apt-get install sshpass rsh
StrictHostKeyChecking no
sshpass -p <密碼> rsh <主機 IP> <指令> &
/etc/sysconfig/network-scripts/ll /etc/sysconfig/network-scripts/ | grep ifcfg 可以看到下列訊息 ( ll = ls -l ):
-rw-r--r--. 1 root root 124 Oct 8 19:27 ifcfg-bridge0 -rw-r--r--. 1 root root 125 Oct 7 19:07 ifcfg-bridge10 -rw-r--r--. 1 root root 354 Oct 1 02:41 ifcfg-enp2s0.bak -rw-r--r--. 1 root root 354 Oct 8 19:28 ifcfg-enp5s0 -rw-r--r--. 1 root root 254 Apr 2 2014 ifcfg-lo
HWADDR="00:0C:29:A6:22:15" TYPE=Ethernet BOOTPROTO=dhcp DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes< IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no NAME=enp5s0 UUID="7e2c54c0-a09d-45ca-a074-7ed5d5d8ed32" ONBOOT=yes
vim /etc/sysconfig/network-scripts/ifcfg-enp5s0
HWADDR="00:0C:29:A6:22:15" UUID="7e2c54c0-a09d-45ca-a074-7ed5d5d8ed32"
DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no
TYPE=Ethernet BOOTPROTO=dhcp ONBOOT=yes NAME=enp5s0
DEVICE="enp5s0" TYPE=Ethernet BOOTPROTO=static NAME=enp5s0 ONBOOT=yes IPADDR=120.117.73.XX NETMASK=255.255.255.0 GATEWAY=120.117.73.94
[root@localhost ~]# /etc/init.d/network restart
[root@localhost ~]# systemctl restart network
[root@localhost ~]# ifconfig enp5s0 enp5s0: flags=4099mtu 1500 inet 120.117.73.80 netmask 255.255.255.0 broadcast 120.117.73.255 ether 20:cf:30:30:72:20 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1 bytes 90 (90.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 120.117.73.94 0.0.0.0 UG 1024 0 0 enp5s0
[root@localhost ~]# vim /etc/resolv.conf
[root@localhost ~]# cat /etc/resolv.conf # Generated by NetworkManager domain stust.edu.tw search stust.edu.tw nameserver 120.117.2.2 nameserver 120.117.2.1
[root@localhost ~]# ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=17.3 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=46 time=17.1 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=46 time=17.2 ms
qemu-img create ubuntuOS.img 80G qemu-system-x86_64 -enable-kvm \ -cpu host \ -smp 4 \ -m 4000 \ -hda ubuntuOS.img \ -boot c -net nic \ -net bridge,br=br9 & 開始 Ubuntu 安裝…
sudo apt-get update && apt-get install curl git python
git config --global user.name myUser git config --global user.email myMail@gmail.com
mkdir ~/bin echo 'export PATH=$PATH:~/bin' >> ~/.bashrc source ~/.bashrc curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo chmod u+x ~/bin/repo
mkdir ~/android_src ; cd ~/android_src repo init -u https://android.googlesource.com/platform/manifest
cd ~/android_src repo sync -j核心數
sudo apt-get update && apt-get install libglapi-mesa:i386 git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib gcc-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo apt-get update && apt-get install openjdk-7-jdk
echo 'export PATH=$PATH:/usr/lib/jvm/java-7-openjdk-amd64/bin' >> ~/.bashrc source ~/.bashrc
chmod u+x ./jdk-6u45-linux-x64.bin ./jdk-6u45-linux-x64.bin sudo mv jdk1.6.0_45 /opt
echo 'export PATH=$PATH:/opt/jdk1.6.0_45/bin' >> ~/.bashrc source ~/.bashrc
進入 Ubuntu 進行套件更新時出現: GPG error: http://www.debian-multimedia.org etch Release: The following signatures couldn't be verified because teh public key is not available: NO_PUBKEY 123456789123456789Sol 1:
若 apt-get install 安裝時出現訊息: dpkg: error: configuration error: /etc/dpkg/dpkg.cfg.d/multiarch:1: unknown option 'foreign-architectureSol 2:
sudo rm /etc/dpkg/dpkg.cfg.d/multiarch
E: Unable to locate package mingw32 E: Package 'python-markdown' has no installation candidateSol 3:
sudo vim /etc/apt/sources.list 找到鏡像站設定: deb http://archive.ubuntu.com/ubuntu precise main 在 main 後面加上 universe
vi /etc/apt/sources.list ## Security.debian deb http://security.debian.org/ wheezy/updates main deb-src http://security.debian.org/ wheezy/updates main ## Opensource deb http://opensource.nchc.org.tw/debian/ wheezy main deb-src http://opensource.nchc.org.tw/debian/ wheezy main deb http://opensource.nchc.org.tw/debian/ wheezy-updates main deb-src http://opensource.nchc.org.tw/debian/ wheezy-updates main
apt-get update
apt-get upgrade
apt-get install apt-get remove
apt-get -f install apt-get autoremove apt-get install debian-keyring
aptitude
apt-get install debian-keyring gpg --keyserver pgp.mit.edu --recv-keys 123456789123456789 gpg --armor --export 123456789123456789 | apt-key add -
apt-get install emdebian-archive-keyring
sudo apt-get install bash-completion source /etc/bash_completion
apt-get ins [TAB] apt-get install dove[TAB] apt-get install dovecot[TAB]
sudo apt-get install bridge-utils uml-utilities
brctl help brctl show brctl addbr [Bridge Name] brctl addif [Interface Name] brctl delbr [Bridge Name] brctl delif [Interface Name]
sudo brctl addbr br0
sudo brctl addif br0 eth0
sudo vi /etc/network/interfaces ## 說明 # # -> eth0 -> 實體機 # Internet -> br0 -> # -> br1 -> N 個虛擬機 # # The loopback network interface auto lo iface lo inet loopback iface eth0 inet manual ## interent -> br0 -> eth0 -> 實體機 auto br0 iface br0 inet static address [本機 ip] netmask [本機 netmask] gateway [本機 gateway] bridge_ports eth0 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off ## interent -> br0 -> br1 -> 虛擬機 auto br1 iface br1 inet static address 192.168.1.1 netmask 255.255.255.0 gateway [本機 ip] bridge_ports tap0 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off
ifconfig eth0 down ifconfig eth0 up /etc/init.d/netwroking restart
ifconfig route -n ping gateway ping 8.8.8.8
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A INPUT -i br1 -j ACCEPT iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
qemu-system-x86_64 -enable-kvm \ -cpu host \ -smp 4 \ -m 6000 \ -hda OS.img \ -boot c \ -net nic \ -net bridge,br=br1 &
Could not access KVM kernel module: No such file or directory failed to initialize KVM: No such file or directory Back to tcg accelerator. qemu: could not load PC BIOS 'bios.bin'
sudo apt-get install seabios sudo cd /usr/local/share/qemu sudo ln -sf /usr/share/seabios/*.bin .
failed to create tun device: Operation not permitted failed to launch bridge helper qemu-system-x86_64: -net bridge,br=br10: Device 'bridge' could not be initialized
chmod u+s /usr/local/libexec/qemu-bridge-helper
failed to initialize KVM: No such file or directory Back to tcg accelerator.
failed to parse default acl file `/usr/local/etc/qemu/bridge.conf' failed to launch bridge helper
vi /usr/local/etc/qemu/bridge.conf -> allow br1
Could not access KVM kernel module: Permission denied failed to initialize KVM: Permission denied
groupadd kvm
usermod -a -G kvm $USER
chown root:kvm /dev/kvm chmod 660 /dev/kvm
rmmod kvm_intel kvm modprobe kvm_intel kvm
shutdown -r now
qemu-system-x86_64: symbol lookup error: qemu-system-x86_64: undefined symbol: libusb_get_port_numbers
sudo ln -sf /lib/x86_64-linux-gnu/libusb-1.0.so.0 /usr/local/lib/libusb-1.0.so.0
update-alternatives --config x-session-manager選項 路徑 優先權 狀態
update-alternatives --config x-window-manager選項 路徑 優先權 狀態
cd ~/Download tar xfva deadbeef-static_0.6.2-2_x86_64.tar.bz2 sudo mv deadbeef-0.6.2 /opt
/opt/deadbeef-0.6.2/deadbeef
vi ~/.bashrc
alias deadbeef='/opt/deadbeef-0.6.2/deadbeef' :wq 儲存離開 source ~/.bashrc
vi /etc/X11/icewm/menu vi /etc/X11/icewm/toolbar prog "DeaDBeef" deadbeef.png /opt/deadbeef-0.6.2/deadbeef ## 注意,deadbeef.png 要放到 IconPath 下。
INFO: loading playlist Default INFO: from file /home/skmpz/.config/deadbeef/playlists/0.dbpl server_start INFO: unlink socket: Permission denied bind: Address already in useSol:
ls -l ~/.config/deadbeef/socket -------> 權限是否為 root ? chown -R user:user ~/.config/deadbeef
sudo apt-get update && apt-get -y install shutter
shuuter
vi /etc/X11/icewm/menu vi /etc/X11/icewm/menu
prog "Screenshot" shutter.png shutter
cd ~ mkdir qemu_image mkdir -p qemu_image/install cd qemu_image/
qemu-img create arm.img 2G
ls -l du -sh arm.img
vi buildarm.sh
qemu-system-arm -M versatilepb -m 512 \ -kernel ./install/vmlinuz-3.2.0-4-versatile \ -initrd ./install/initrd.gz \ -hda arm.img \ -append "root=/dev/sda1"
chmod u+x ~/qemu_image/buildarm.sh
sh ~/qemu_image/buildarm.sh
~/qemu_image $ cp arm.img arm_OK.img
/etc/passwd -------------> 帳號設定檔
/etc/group ----------------> 群組設定檔
/etc/shadow --------------> 密碼設定檔
useradd
-m ---------------------------> 自動建家目錄
-d homename ------------> 指定家目錄
-g groupname ------------> 加入Main group
-G ----------------------------> 加入Sub group
-s /bin/bash ----------------> 設定Shell為bash
usermod ---------------------> 修改使用者帳號
passwd -----------------------------------------------> 設定密碼
echo “user:password” | chpasswd ----------> 設定密碼,適用Script大量建帳號
groupadd [GroupName] --------------------------> 建立群組
groupdel -r [GroupName] -------------------------> 移除群組
change -l [Account] --------------------------> 觀看帳號資訊
change -d 0 [Account] -----------------------> 設定密碼只能用一次,擔入後就要換密碼
chown --------------------------> 改檔案、目錄的所有使用者
chgrp ---------------------------> 改檔案、目錄的所有群組
chmod --------------------------> 改檔案、目錄的權限
dpkg --add-architecture i386 apt-get update apt-get -fy install dpkg -i [AdobeReader..................deb]