Friday, December 4, 2015
Tuesday, November 17, 2015
install linux
- 分区:主(一般最多四个)、延伸、逻辑
- /boot 必须在最前面
- 不同分区的大小,以及如何分区,依据系统的功能制定
- 一般需要etx4, swap类型的分区,当然也可以添加
file system
- find file system type : df -T
- linux & windows both support : vfat file system
Monday, November 16, 2015
Saturday, November 14, 2015
Python Plan
- develop some small projects
- develop games 2D
- develop games 3D
- develop games interesting (how to create a game structure)
Friday, November 13, 2015
Linux study plan
basic stage (精通使用、内核基本了解):
- 鸟哥的书,共两册。 使用、了解linux,打好基础!
- UCore. 初步了解linux系统的程序开发过程以及开发工具的使用,以及较好的了解UCore系统
- 其他的比较好的介绍linux的书
master stage (内核深入了解、精通开发):
- 更多的通过实践来了解
Wednesday, November 11, 2015
Windows visual studio 2013 install MS_MPI and run mpi program
- install MSMPI : msmpi. We need install both msmpisdk.msi (to get include\ & lib\) and MSMpiSetup.exe (to get bin\mpiexec.exe)
- set environment variables :
- MSMPI_BIN=C:\Program Files\Microsoft MPI\Bin\
- MSMPI_INC=C:\Program Files (x86)\Microsoft SDKs\MPI\Include\
- MSMPI_LIB32=C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x86\
- MSMPI_LIB64=C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64\
- create a new C++ empty project :
- change linker's system configuration to CONSOLE(SUBSYSTEM:CONSOLE)
- add linker additional lib directories (x86 or x64) this machine is x86:
- add linker input additional dependencies , Type msmpi.lib to the list
- add location of mpi header file
- Add a C++ file to write your first MPI program and write the following codes as a test:
#include<iostream> #include<mpi.h> using namespace std; int main(int argc, char** argv){ int mynode, totalnodes; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &totalnodes); MPI_Comm_rank(MPI_COMM_WORLD, &mynode); cout << "Hello world from process " << mynode; cout << " of " << totalnodes << endl; MPI_Finalize(); return 0; }
- build the program and if there is no error , then test it by running mpiexec: "mpiexec -n 4 mpi_hello.exe"
- use msmpi ; use msmpi 2 : 主要参考
local linux log in remote linux server (key pairs)
There are several ways we can do that.
Local machine:generate keys
- username and password : ssh username@host_ip port ; then input password
- key pairs (more secure then password logging in): it's a two way method, you need to create both private key(for local ubuntu to authenticate) and public key (to transfer to the remote server)
- create a new folder : mkdir ~/.ssh
- ssh-keygen -t rsa ; then we will find two files : id_rsa and id_rsa.pub in .ssh/
- then transfer the public key to remote server : here is a simple command (ssh-copy-id <username@host>)
Remote server:upload public key
- make sure .ssh is existed. use "ls -al "to examine.
- if .ssh not exist, then "mkdir ~/.ssh"
- then copy id_rsa.pub to .ssh/
Monday, November 9, 2015
Find && '/'
1,examples:
- find file in a specific path : find path -name filename (find /etc/ -name java.sh)
- -iname : 大小写不敏感
- -type : 文件类型
- -P : 路径
2, shortcut key : /
快捷键: n (next) ; u (previous one)
鸟哥私房菜 基础篇
- find file system type: df -T
- 关于man查询有关命令式,该命令后的数字是有实际意义的
- 内存的数据不会立刻存储到硬盘,而是暂时留在内存以防数据的频繁读取。所以为防止断电等意外事故造成数据的损失,应该随时执行 sync命令,讲内存中数据同步到硬盘中。
- fsck 文件系统修复。 如果硬盘有分区坏掉时,可以用这个命令修复该分区。
- 破解linux密码:单人维护模式
- root account is disabled by default. so, need to create a new root account to use 'su' command.
- sudo -i
- passwd
man page 的主要结构
man page 的常用快捷键
man 查找关键词,而非相应的命令名: man -k keyword
Thursday, October 29, 2015
Detect, mount, format devices
Detect devices:
- lsblk : prints all block devices (except RAM disks) in a tree-like format by dafault. More clear than comman "mount"
- mount -l \ -a (man mount for more details)
- file : determine file type
- df -h
- lsusb
- sudo fdisk -l
Mount devices:
- mount -t type device dir
- we can find some device in /dev/disk/.......
- usually linux can automatically detect file system type, so we don't need "-t"
- example: mount /dev/sdf4 /media/usb
- if path "/media/sdf4" is not exsited, we need create a new directory to mount device
Umount devices :
- umount device
Sunday, October 25, 2015
Friday, October 23, 2015
Thursday, October 22, 2015
Configure local ubuntu to be accessed remotely
LAN
1, configure ssh.
- we need ssh server to share our machine with others. ssh is usually installed in linux distributions, however , ssh server is not installed. so first , we need to install a ssh server. "sudo apt-get install openssh-server"
- start ssh server with command "sudo /etc/init.d/ssh start" check if it's started using command "ps -e | grep sshd"
- set the port which ssh server will listen for. "vim /etc/ssh/sshd_config" there is a line starting with "Port port_number", we can change this port_number to the port we want to listen for.
2, configure firewall: iptables
- add some rules to accept packages from other machine. "sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT "
- save set (method 1)(make iptables rules persistent):
- "iptables-save > /etc/iptables.rules" : save set in file iptables.rules
- edit a bash file in /etc/network/if-pre-up.d/iptables.sh
- #! /bin/bash
- iptables-restore < /etc/iptables.rules"
- save rules permant (method 2)
- sudo apt-get install iptables-persistent
- service iptables-persistent start
WAN
- if your server is in a LAN, and you want to access a server in the LAN from outside, then find the router of the LAN, and configure the router. Set the router to forward to forward connections to port 4015(set above) to your internal IP address.
Wednesday, October 21, 2015
Commands Learned
- less : see text file. one pape
- file : examine file type
- standard input / standard output / Pipelines
- Permissions
- Job control : ps/kill/jobs/bg/fg
Tuesday, October 20, 2015
alias Create a command for a linux executable file
edit the file ".bashrc" , add the below line at the bottom of the file.
"alias eclipse=/opt/eclipse/eclipse" and Do "source ~/.bashrc" to be able to use alias as a command.
**this is way like "define #"in the C/C++, when you type "eclipse",it will be replaced with the right hand side of the alias definition, which here is the full path to the executable.
Understanding more about /etc/profile and /etc/bashrc
"alias eclipse=/opt/eclipse/eclipse" and Do "source ~/.bashrc" to be able to use alias as a command.
**this is way like "define #"in the C/C++, when you type "eclipse",it will be replaced with the right hand side of the alias definition, which here is the full path to the executable.
Understanding more about /etc/profile and /etc/bashrc
examples
alias gquit="gnome-session-quit" (we can use a short word to replace the long command in this way)
Sunday, October 18, 2015
set up eclipse && java on ubuntu
Above are very good and complete method. and they are from website 2 day geek
Saturday, October 17, 2015
Hack Windows passward
- Bootablelinux USB && boot some flavor of linux live USB
- Navigate to system32
- Rename Magnify.exe : find magnify.exe, and rename it to magnify.old
- Rename cmd.exe : find cmd.exe, and rename it to magnify.exe
- shutdown ubuntu and reboot Windows
- Get CMD Prompt Modify Accounts : Ease of Access : click "magnifier" and hit "apply"
- get an cmd seesion, type "net user" to get a list of accounts. My Options: Change PWD : "net user username new_password" Add an account : net user username password /add Admin that : net localgroup administrators username /add Deltet that : net user username /delete net user systax reference
- Reboot linux and Fix magnify.exe : repeat step 1 && 2 && 3, then rename magnify.exe to cmd.exe , rename magnify.old to magnify.exe
reference : clever method
Friday, October 16, 2015
Ucore Course tools
Spending two months finishing Ucore Class and Ucore labs.
Then I will take MIT OS class. Meantime hoping to do something about sensor and hardware.
install grunt in ubuntu 14.04 : it's wrong according to the official website.
Git
install grunt in ubuntu 14.04 : it's wrong according to the official website.
Git
Thursday, October 15, 2015
Apache2
learn about how to configure with apache2 and learn about apache.
References:
Apache2 Ubuntu Documentation
Apache2 Documentation : contains in depth information on Apache2 configuration directives. Also, see the apache2 doc package for the official Apache2 docs.
Mod SSL Documentation : site for more related documentation
Apache Cookbook
References:
Apache2 Ubuntu Documentation
Apache2 Documentation : contains in depth information on Apache2 configuration directives. Also, see the apache2 doc package for the official Apache2 docs.
Mod SSL Documentation : site for more related documentation
Apache Cookbook
Tuesday, October 13, 2015
Linux Online Emulator
一个叫Fabrice Bellard的工程师使用 JavaScript 在浏览器上模拟出了一个 Linux 系统。没有图形化界面,完全使用命令行的方式与之互动。Linux操作系统内核版本为2.6.20。具体使用过程中可以参考jslinux:的
FAQ:http://bellard.org/jslinux/faq.html
技术说明:http://bellard.org/jslinux/tech.html
FAQ:http://bellard.org/jslinux/faq.html
技术说明:http://bellard.org/jslinux/tech.html
Subscribe to:
Posts (Atom)