用户讨论:Jinzd:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Jinzd留言 | 贡献
Jinzd留言 | 贡献
 
(未显示2个用户的50个中间版本)
第1行: 第1行:
=sudo=
[[Kubuntu 技巧]]


'''sudo'''
[[Shell编程基础]]


以其他用户身份执行一个命令.
[[man sudo_root]]


用法:


: sudo -h | -K | -V
export JAVA_HOME=/usr/local/jdk1.8.0_91/
: sudo -v [-Akns] [-g group] [-h host] [-p prompt] [-u user]
: sudo -l [-Akns] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [p prompt] [-u user] [VAR=value] [-i|-s] [<command>]
: sudo -e [-Akns] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ...


Options:
export PATH=$JAVA_HOME/bin:$PATH


{| style="border: none" width="100%"
export classPath=/usr/local/jdk1.8.0_91/
|-
 
| width="200px" | -A, --askpass
[http://askubuntu.com/questions/26632/how-to-install-eclipse eclipse]
|  使用一个辅助程序以提示密码。
 
|-
[http://forum.ubuntu.org.cn/index.php forum]
| -b, --background
 
| 在后台运行命令。
=Ubuntu=
|-
 
| -C, --close-from=num
<pre>
| 关闭所有大于等于num的文件描述。
----------------------Ubuntu update
|-
sudo apt-get update
| -E, --preserve-env
 
| 运行命令时保存用户环境。
sudo apt-get dist-upgrade / sudo apt-get upgrade
|-
----------------------Postgresql installation
| -e, --edit
sudo apt-get install postgresql-9.5
| 编辑文件而非运行一个命令。
 
|-
sudo apt-get install pgadmin3
| -g, --group=group
 
| 以指定的组名或组ID运行一个命令。
sudo -u postgres psql postgres
|-
 
| -H, --set-home
\password postgres
| 设置 HOME 变量以指向用户的 HOME 目录。
----------------------Postgresql configuration
|-
cd /etc/postgresql/9.5/main
| -h, --help
 
| 显示帮助信息并且退出。
sudo nano postgresql.conf
|-
 
| -h, --host=host
# add following line to the file
| 在主机上运行命令(如果插件支持)。
 
|-
listen_addresses = '*'
| -i, --login
 
| 以目标用户运行登录shell;也可以指定一个命令。
# ctrl-o and ctrl-x to finish the operation.
|-
 
| -K, --remove-timestamp
sudo nano pg_hba.conf
| 完全删除时间戳文件。
 
|-
# add following line to the file
| -k, --reset-timestamp
 
| 失效时间戳文件。
hostnossl all all 192.168.128.45 255.255.255.0 md5
|-
 
| -l, --list
# ctrl-o and ctrl-x to finish the operation.
| 列出用户特权或检查一个特定的命令;长格式使用两次。
----------------------Apache2 Web Server
|-
sudo apt-get install apache2
| -n, -- non-interactive
----------------------PHP for apache2
| 非交互方式,无提示被使用。
sudo apt install php libapache2-mod-php
|-
 
| -P, --preserve-groups
sudo apt install php-cli
| 保存组向量而非设置指定的目标。
 
|-
sudo apt install php-cgi
| -P, --prompt=prompt
 
| 使用指定的密码提示。
sudo apt install php-pgsql
|-
 
| -r, --role=role
 
| 用指定的角色创建SELinux安全上下文。
#debug
|-
 
| -S, --stdin
sudo apt-get install php-xdebug
|
----------------------Netbeans
|-
sudo sh ./netbeansXXXXX.sh
| -s, --shell
----------------------Java env for all users
|
#move jdk to /usr/lib/jvm
|-
 
| -t, --type=type
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_91
|
 
|-
export PATH=$JAVA_HOME/bin:$PATH
| -U, --other-user=user
 
|
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar: $JAVA_HOME/lib/tools.jar
|-
 
| -u, --user=user
 
|
 
|-
 
| -V, --version
 
|
sudo nano /etc/profile
|-
 
| -v, --validate
# add following lines to the end of the file
|
 
|-
export JAVA_HOME=/usr/local/jdk1.8.0_91
| --
 
|
export PATH=$JAVA_HOME/bin:$PATH
|}
 
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar: $JAVA_HOME/lib/tools.jar
----------------------OpenSSH
sudo apt-get install openssh-server
 
ssh [user]@[server ip]
 
# windows client is putty, can be downloaded from internet.
----------------------jdk
# go to Downloads directory
 
tar -zxvf jdk-8u92-linux-x64.tar.gz
 
# move jdk to /usr/local
 
sudo mv ./jdk1.8.0_92 /usr/local
 
# set java env for ubuntu
----------------------PDT Installation
# download eclipse from https://eclipse.org/pdt/#download
 
$ cd {directory where your browser downloaded the package to}
 
$ tar -zxvf eclipse-SDK-3.4.1-linux-gtk.tar.gz && mv eclipse ~/opt
 
</pre>
 
=Apache2=
 
<pre>
# create a new site juniverse
 
cd /etc/apache2/sites-available
 
sudo cp 000-default.conf juniverse.conf
 
# edit juniverse.conf
 
sudo nano juniverse.conf
 
<VirtualHost *:81>
 
DocumentRoot /var/www/juniverse
 
# save and exit it
 
sudo mkdir /var/www/juniverse
 
# restart apache2
 
sudo a2ensite juniverse.conf
 
sudo service apache2 restart
</pre>
 
=wiki=
 
https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu#Ubuntu_Up-To-Date
 
[https://www.mediawiki.org/wiki/Manual:Installing_MediaWiki Install Wiki]
 
 
[https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu#Ubuntu_Up-To-Date wiki install]
 
http://www.54chen.com/php-tech/mediawiki-pgsql.html
 
https://help.ubuntu.com/community/MediaWiki
 
=ifconfig=
 
[[ifconfig]]
 
Usage:
 
: ifconfig [-a] [-v] [-s] <interface> [[&lt;AF&gt; ] &lt;address&gt;]
: [add &lt;address&gt;[/<prefixlen&gt;]]
: [del &lt;address&gt;[/<prefixlen&gt;]]
: [[-]broadcast [&lt;address&gt;]]  [[-]pointopoint [&lt;address&gt;]]
: [netmask &lt;address&gt;]  [dstaddr &lt;address&gt;]  [tunnel &lt;address&gt;]
 
=Java=
 
Add deb resource path:
 
<pre style="margin: 5px">
sudo add-apt-repository "deb http://archive.canonical.com/ubuntu maverick partner"
 
sudo apt-get update
 
sudo apt install sun-java8-jdk
 
# remove
 
sudo add-apt-repository -r "deb http://archive.canonical.com/ubuntu maverick partner"
</pre>


=PostgreSQL=
=PostgreSQL=
第118行: 第207行:


<pre style="margin: 5px">
<pre style="margin: 5px">
jinzd@ubuntu:~S sudo -u postgres created JUniverse
jinzd@ubuntu:~S sudo -u postgres createdb JUniverse
 
sudo -u postgres psql --host=localhost --username=postgres --password
</pre>
</pre>


第126行: 第217行:
jinzd@ubuntu:~S sudo -u postgres createuser  
jinzd@ubuntu:~S sudo -u postgres createuser  
</pre>
</pre>
== 关于[[Bash Reference Manual/zh]]的翻译 ==
这种texinfo文档还是喂进po4a然后直接翻译po为妙。——[[用户:Arthur2e5|Arthur2e5]]([[用户讨论:Arthur2e5|讨论]]) 2016年7月2日 (六) 18:02 (CST)

2016年7月4日 (一) 10:12的最新版本

Kubuntu 技巧

Shell编程基础

man sudo_root


export JAVA_HOME=/usr/local/jdk1.8.0_91/

export PATH=$JAVA_HOME/bin:$PATH

export classPath=/usr/local/jdk1.8.0_91/

eclipse

forum

Ubuntu

----------------------Ubuntu update
sudo apt-get update

sudo apt-get dist-upgrade / sudo apt-get upgrade
----------------------Postgresql installation
sudo apt-get install postgresql-9.5

sudo apt-get install pgadmin3

sudo -u postgres psql postgres

\password postgres
----------------------Postgresql configuration
cd /etc/postgresql/9.5/main

sudo nano postgresql.conf

# add following line to the file

listen_addresses = '*'

# ctrl-o and ctrl-x to finish the operation.

sudo nano pg_hba.conf

# add following line to the file

hostnossl all all 192.168.128.45 255.255.255.0 md5

# ctrl-o and ctrl-x to finish the operation.
----------------------Apache2 Web Server
sudo apt-get install apache2
----------------------PHP for apache2
sudo apt install php libapache2-mod-php

sudo apt install php-cli

sudo apt install php-cgi

sudo apt install php-pgsql


#debug

sudo apt-get install php-xdebug
----------------------Netbeans
sudo sh ./netbeansXXXXX.sh
----------------------Java env for all users
#move jdk to /usr/lib/jvm

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_91

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar: $JAVA_HOME/lib/tools.jar





sudo nano /etc/profile

# add following lines to the end of the file

export JAVA_HOME=/usr/local/jdk1.8.0_91

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar: $JAVA_HOME/lib/tools.jar
----------------------OpenSSH
sudo apt-get install openssh-server

ssh [user]@[server ip]

# windows client is putty, can be downloaded from internet.
----------------------jdk
# go to Downloads directory

tar -zxvf jdk-8u92-linux-x64.tar.gz

# move jdk to /usr/local

sudo mv ./jdk1.8.0_92 /usr/local

# set java env for ubuntu
----------------------PDT Installation
# download eclipse from https://eclipse.org/pdt/#download

$ cd {directory where your browser downloaded the package to}

$ tar -zxvf eclipse-SDK-3.4.1-linux-gtk.tar.gz && mv eclipse ~/opt

Apache2

# create a new site juniverse

cd /etc/apache2/sites-available

sudo cp 000-default.conf juniverse.conf

# edit juniverse.conf

sudo nano juniverse.conf

<VirtualHost *:81>

DocumentRoot /var/www/juniverse

# save and exit it

sudo mkdir /var/www/juniverse

# restart apache2

sudo a2ensite juniverse.conf

sudo service apache2 restart

wiki

https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu#Ubuntu_Up-To-Date

Install Wiki


wiki install

http://www.54chen.com/php-tech/mediawiki-pgsql.html

https://help.ubuntu.com/community/MediaWiki

ifconfig

ifconfig

Usage:

ifconfig [-a] [-v] [-s] <interface> [[<AF> ] <address>]
[add <address>[/<prefixlen>]]
[del <address>[/<prefixlen>]]
[[-]broadcast [<address>]] [[-]pointopoint [<address>]]
[netmask <address>] [dstaddr <address>] [tunnel <address>]

Java

Add deb resource path:

sudo add-apt-repository "deb http://archive.canonical.com/ubuntu maverick partner"

sudo apt-get update

sudo apt install sun-java8-jdk

# remove

sudo add-apt-repository -r "deb http://archive.canonical.com/ubuntu maverick partner"

PostgreSQL

For newest Ubuntu 16.04 postgresql is ready to install:

jinzd@ubuntu:~S sudo apt install postgresql-9.5

Get postgresql ready to use, set password is the first step:

jinzd@ubuntu:~S sudo -u postgres psql template1

template1=# \password postgres;

or

jinzd@ubuntu:~S sudo -u postgres psql postgres

postgres=# \password postgres;

Create database:

jinzd@ubuntu:~S sudo -u postgres createdb JUniverse

sudo -u postgres psql --host=localhost --username=postgres --password

Create user:

jinzd@ubuntu:~S sudo -u postgres createuser 

关于Bash Reference Manual/zh的翻译

这种texinfo文档还是喂进po4a然后直接翻译po为妙。——Arthur2e5讨论) 2016年7月2日 (六) 18:02 (CST)