Merge lp:~nijaba/ubuntu-server-tips/newtips into lp:ubuntu-server-tips
- newtips
- Merge into fortunes-ubuntu-server-tips
Proposed by
Nick Barcet
Status: | Merged |
---|---|
Approved by: | Dave Walker |
Approved revision: | 39 |
Merge reported by: | Dave Walker |
Merged at revision: | not available |
Proposed branch: | lp:~nijaba/ubuntu-server-tips/newtips |
Merge into: | lp:ubuntu-server-tips |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~nijaba/ubuntu-server-tips/newtips |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dave Walker | Approve | ||
Review via email: mp+11251@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Nick Barcet (nijaba) wrote : | # |
Revision history for this message
Dave Walker (davewalker) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
merge approved
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkq
qOMAoM0YgmntjHt
=imVA
-----END PGP SIGNATURE-----
Revision history for this message
Dave Walker (davewalker) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
merge approved
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkq
K5YAnRWQW+
=SvaG
-----END PGP SIGNATURE-----
review:
Approve
Revision history for this message
Dave Walker (davewalker) wrote : | # |
Merged ages ago, marking as such! Thanks!
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'ubuntu-server-tips' |
2 | --- ubuntu-server-tips 2009-08-17 18:11:26 +0000 |
3 | +++ ubuntu-server-tips 2009-09-05 13:37:28 +0000 |
4 | @@ -1,112 +1,148 @@ |
5 | -Ubuntu Server Tip: Want to run your own cloud infrastructure in your |
6 | -enterprise? Ubuntu Enterprise Cloud powered by Eucalyptus has what you need: |
7 | -http://www.ubuntu.com/cloud |
8 | -% |
9 | -Ubuntu Server Tip: Did you know that you can get useful notifications |
10 | -displayed at the bottom of a terminal by using the byobu package? |
11 | -http://launchpad.net/byobu |
12 | -% |
13 | -Ubuntu Server Tip: 'screen' can create multiple "windows" which you can |
14 | -detach and re-attach later. The Byobu package makes screen even |
15 | -simpler. http://launchpad.net/byobu |
16 | -% |
17 | -Ubuntu Server Tip: The powernap package allows you to suspend servers which |
18 | -are not being used, and save energy. https://launchpad.net/powernap |
19 | -% |
20 | -Ubuntu Server Tip: 'etckeeper' allows you to save changes you make to /etc |
21 | -in a bazaar repository. Useful to track and revert |
22 | -changes. http://tinyurl.com/etckeeper |
23 | -% |
24 | -Ubuntu Server Tip: Your KVM powered virtual machines will do IOs up to seven |
25 | -times faster if you enable virtio. http://tinyurl.com/virtio |
26 | -% |
27 | -Ubuntu Server Tip: The Ubuntu Server Team is an open community always |
28 | -looking for feedback and help: https://launchpad.net/~ubuntu-server |
29 | -% |
30 | -Ubuntu Server Tip: Did you know that releases of Ubuntu labeled LTS are |
31 | -maintained for 5 years on servers? 'cat /etc/lsb-release' will tell you |
32 | -which release you are on. |
33 | -% |
34 | -Ubuntu Server Tip: Browse the command line history with ctrl-r and then type |
35 | -a few characters that you know are part of the command you are looking for. |
36 | -% |
37 | -Ubuntu Server Tip: Edit the command line with cut and paste: ctrl-k for cut, |
38 | -and ctrl-y for paste. |
39 | -% |
40 | -Ubuntu Server Tip: Reach the end-of-line with ctrl-e and the beginning of |
41 | -line with ctrl-a. |
42 | -% |
43 | -Ubuntu Server Tip: Instead of typing the user and group, if they are the |
44 | -same ( like for www-data ) you can just type the user followed by a colon, |
45 | -e.g. "$ sudo chown -R www-data: *" |
46 | -% |
47 | -Ubuntu Server Tip: Use the "which" command to find if an executable is in |
48 | -your path, and if it is, where you can find the file. e.g. $ which nano |
49 | -% |
50 | -Ubuntu Server Tip: Instead of typing exit or closing the terminal if you |
51 | -want to logout you can press Ctrl+d. |
52 | -% |
53 | -Ubuntu Server Tip: Use 'tail -f file' to watch a log file as messages get |
54 | -appended, and use 'tail -100 file' to change the count of lines read from |
55 | -the file (to 100 in this case). |
56 | -% |
57 | -Ubuntu Server Tip: An easy way to see what processes own which network |
58 | -connections: "sudo netstat -tup" for established connections and "sudo |
59 | -netstat -tupl" for listening daemons. |
60 | -% |
61 | -Ubuntu Server Tip: The "history" command will show you the commands you've |
62 | -used before, alternatively you can use the up arrow button to look through |
63 | -them. |
64 | -% |
65 | -Ubuntu Server Tip: To make a backup without typing the full path twice: $ cp |
66 | -/long/path/to/file/name{,.orig} to create a copy with the suffix .orig |
67 | -% |
68 | -Ubuntu Server Tip: If you executed a command and neglected to use sudo, you |
69 | -can execute "sudo !!" to re-execute the previous command with sudo |
70 | -prepended. |
71 | -% |
72 | -Ubuntu Server Tip: Install "denyhosts" to help protect against brute force |
73 | -SSH attacks, auto-blocking attempts. |
74 | -% |
75 | -Ubuntu Server Tip: Use "iotop" for measuring hard disk I/O (current read / |
76 | -write) usage per application. |
77 | -% |
78 | -Ubuntu Server Tip: If you are using a PostgreSQL database, use "ptop" to |
79 | -monitor real time usage. |
80 | -% |
81 | -Ubuntu Server Tip: Use "iftop" to monitor current network activity |
82 | -connections per host. |
83 | -% |
84 | -Ubuntu Server Tip: Use "pastebinit" to copy a file, or output of a command |
85 | -to a webpage allowing you to share it with others. e.g. "pastebinit |
86 | -/proc/cpuinfo" or "df -h | pastebinit" |
87 | -% |
88 | -Ubuntu Server Tip: Use "tail -f /var/log/some.log" to see new lines added to |
89 | -a log instantly in real time. Ideal from watching webserver requests as |
90 | -they happen. Can also be used in conjunction with "grep". |
91 | -% |
92 | -Ubuntu Server Tip: Save time by starting to type a command or file name, |
93 | -then press tab to complete. Hit tab twice to bring up multiple completion |
94 | -options. |
95 | -% |
96 | -Ubuntu Server Tip: Append your ssh key to your server's authorized keys file |
97 | -using the command "ssh-copy-id user@server_address" |
98 | -% |
99 | -Ubuntu Server Tip: If you want to download a file from a URL via the |
100 | -console, you can use the command "wget http://address/to/file.tar" |
101 | -% |
102 | -Ubuntu Server Tip: To manage Apache modules use "a2enmod" to enable and |
103 | -"a2dismod" to disable. e.g. "sudo a2enmod rewrite" |
104 | -% |
105 | -Ubuntu Server Tip: To manage Apache virtualhosts use "a2ensite" to enable |
106 | -and "a2dissite" to disable. e.g. "sudo a2ensite example.org" |
107 | -% |
108 | -Ubuntu Server Tip: Use "top" to get a view of your server's performance |
109 | -such as processor, memory and swap utilisation and to see a rolling display |
110 | -of the top cpu using processes. |
111 | -% |
112 | -Ubuntu Server Tip: If you need to perform a command a second time on a |
113 | -different file, you can use command replacement with the ^ symbol. e.g. "cp |
114 | -foo.txt /to/some/directory" then "^foo^bar", expanding to: "cp bar.txt |
115 | -/to/some/directory". |
116 | +Want to run your own cloud infrastructure in your enterprise? Ubuntu Enterprise |
117 | +Cloud powered by Eucalyptus has what you need: http://www.ubuntu.com/cloud |
118 | +% |
119 | +Did you know that you can get useful notifications displayed at the bottom of a |
120 | +terminal by using the byobu package? http://launchpad.net/byobu |
121 | +% |
122 | +'screen' can create multiple "windows" which you can detach and re-attach later. |
123 | +The Byobu package makes screen even simpler. http://launchpad.net/byobu |
124 | +% |
125 | +The powernap package allows you to suspend servers which are not being used, and |
126 | +save energy. https://launchpad.net/powernap |
127 | +% |
128 | +'etckeeper' allows you to save changes you make to /etc in a bazaar repository. |
129 | +Useful to track and revert changes. http://tinyurl.com/etckeeper |
130 | +% |
131 | +Your KVM powered virtual machines will do IOs up to seven times faster if you |
132 | +enable virtio. http://tinyurl.com/virtio |
133 | +% |
134 | +The Ubuntu Server Team is an open community always looking for feedback and |
135 | +help: https://launchpad.net/~ubuntu-server |
136 | +% |
137 | +Did you know that releases of Ubuntu labeled LTS are maintained for 5 years on |
138 | +servers? 'cat /etc/lsb-release' will tell you which release you are on. |
139 | +% |
140 | +Browse the command line history with ctrl-r and then type a few characters that |
141 | +you know are part of the command you are looking for. |
142 | +% |
143 | +Edit the command line with cut and paste: ctrl-k for cut, and ctrl-y for paste. |
144 | +% |
145 | +Reach the end-of-line with ctrl-e and the beginning of line with ctrl-a. |
146 | +% |
147 | +Instead of typing the user and group, if they are the same (like for www-data) |
148 | +you can just type the user followed by a colon: 'sudo chown -R www-data: *' |
149 | +% |
150 | +Use the "which" command to find if an executable is in your path, and if it is, |
151 | +where you can find the file. e.g. 'which nano' |
152 | +% |
153 | +Instead of typing exit or closing the terminal if you want to logout you can |
154 | +press Ctrl+D. |
155 | +% |
156 | +Use 'tail -f file' to watch a log file as messages get appended, and use |
157 | +'tail -100 file' to change the count of lines read from the file. |
158 | +% |
159 | +An easy way to see what processes own which network connections: 'sudo |
160 | +netstat -tup' for connections and 'sudo netstat -tupl for listening process. |
161 | +% |
162 | +The 'history' command will show you the commands you've used before. |
163 | +Alternatively you can use the up arrow button to look through them. |
164 | +% |
165 | +To make a backup without typing the full path twice: |
166 | +'cp /long/path/to/file/name{,.orig}' to create a copy with the suffix .orig |
167 | +% |
168 | +If you executed a command and neglected to use sudo, you can execute "sudo !!" |
169 | +to re-execute the previous command with sudo prepended. |
170 | +% |
171 | +Install 'denyhosts' to help protect against brute force SSH attacks, |
172 | +auto-blocking multiple attempts. |
173 | +% |
174 | +Use "iotop" for measuring hard disk I/O (current read/write) usage |
175 | +per application. |
176 | +% |
177 | +If you are using a PostgreSQL database, use "ptop" to monitor real time usage. |
178 | +% |
179 | +Use "iftop" to monitor current network activity connections per host. |
180 | +% |
181 | +Use "pastebinit" to copy a file, or output of a command to a webpage allowing |
182 | +you to share it. e.g. 'pastebinit /proc/cpuinfo' or 'df -h | pastebinit' |
183 | +% |
184 | +Use "tail -f /var/log/some.log" to see new lines added to a log instantly in |
185 | +real time. Ideal from watching webserver requests as they happen. |
186 | +% |
187 | +Save time starting to type a command or file name, then press tab to complete |
188 | +Hit tab twice to bring up multiple completion options. |
189 | +% |
190 | +Append your ssh key to your server's authorized keys file using the command |
191 | +'ssh-copy-id user@server_address' |
192 | +% |
193 | +If you want to download a file from a URL via the console, you can use the |
194 | +command 'wget http://address/to/file.tar' |
195 | +% |
196 | +To manage Apache modules use "a2enmod" to enable and "a2dismod" to disable. |
197 | +e.g. 'sudo a2enmod rewrite' |
198 | +% |
199 | +To manage Apache virtualhosts use "a2ensite" to enable and "a2dissite" to |
200 | +disable. e.g. "sudo a2ensite example.org" |
201 | +% |
202 | +Use "top" to get a view of your server's performance such as processor, memory |
203 | +and swap utilisation and see a rolling display of the top cpu using processes. |
204 | +% |
205 | +If you need to perform a command a second time on a different file, you can use |
206 | +command replacement with the ^ symbol. e.g. "cp foo.txt /to/some/directory" |
207 | +then "^foo^bar", expanding to: "cp bar.txt /to/some/directory". |
208 | +% |
209 | +You can contact the Ubuntu Server team on IRC using chat.freenode.net in channel |
210 | +#ubuntu-server. You can also use http://webchat.freenode.net. |
211 | +% |
212 | +You can edit your network configuration in /etc/network/interfaces and enable |
213 | +your changes by issuing the command sudo /etc/init.d/networking restart. |
214 | +% |
215 | +If the empty file ~/.hushlogin exists on the server, login to the server will be |
216 | +super quiet. Only the bash prompt is displayed. |
217 | +% |
218 | +To find a package which name or descriprition contains a keyword use: |
219 | +'apt-cache search <keyword>'. 'apt-cache showpkg <packagename>' to get details. |
220 | +% |
221 | +If you need to compile a piece of software, you may need to install the |
222 | +build-essential package. Use 'sudo apt-get install build-essential'. |
223 | +% |
224 | +You can use the text-based web browser w3m to browse the Internet in your |
225 | +console screen. e.g 'w3m http://ubuntu.com' |
226 | +% |
227 | +The free command tells you the status of your memory and swap, how much you |
228 | +have used and how much you have left. |
229 | +% |
230 | +If you know you typed a command or password wrong, you can use ctrl + u to |
231 | +delete the whole line or ctrl + w to delete just a word. |
232 | +% |
233 | +Typing 'dmesg | tail' after you plug in usb storage will give you its partition |
234 | +name (ex: /dev/sdb1) simplifying the mounting process. |
235 | +% |
236 | +The column allows you to format output neatly. ex: 'mount | column -t' will |
237 | +reformat mount's messy output. See 'man column' for more info. |
238 | +% |
239 | +Use awk to quickly filter columns from some command output. |
240 | +e.g.: ls -l | awk '{print $3 " " $9}' |
241 | +% |
242 | +You can change your hostname by editing the file /etc/hostname. |
243 | +% |
244 | +Use 'dpkg --get-selections > selections.txt' to save a selection and |
245 | +'dpkg --set-selections < selections.txt && apt-get dselect-upgrade' to restore. |
246 | +% |
247 | +To deactivate a service at boot, for example, apache2: 'sudo update-rc.d -f |
248 | +apache2 remove'. To activate it: 'sudo update-rc.d apache2 install defaults'. |
249 | +% |
250 | +Tired of repeatedly pressing 'y' through some shell process (e.g. fsck)? |
251 | +Try the 'yes' command. 'man yes' for more info. |
252 | +% |
253 | +For a lightweight VPN alternative, have a look at ssh + netcat-openbsd for |
254 | +SOCKS proxy support. |
255 | +% |
256 | +Use the 'watch' command to repeat the same command a regular interval and get |
257 | +helpful datetime output. 'man watch' for more details. |
258 | +% |
259 | +Use lsof to find out which process has open handles for a file. 'lsof +D /path' |
260 | +will find all processes for the given path. This is useful for unmounting media. |
261 | +% |
262 | +A for loop in bash syntax: 'for i in * ; do echo $i ; done'. |
263 | % |
Add new tips that were marked confirmed in the bug list and remove prefix on each tip.