Skip to content

Commit 2b19b2d

Browse files
committed
Split id, usermod. Eclipse keyboard shortcuts
1 parent 5641a0f commit 2b19b2d

File tree

6 files changed

+156
-73
lines changed

6 files changed

+156
-73
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ Media video, games, etc.) file types, viewers, editors, capture, synthesizers:
103103
- [Markup](markup/): Markdown, RST. Focus on command line interface and extensions.
104104
- [Video](video.md): videos, films, subtitles.
105105

106+
User operations:
107+
108+
- [id](id.md)
109+
- [usermod](usermod.md)
110+
106111
Generic data formats:
107112

108113
- [JSON](json.md)

eclipse.md

+87-7
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,89 @@ Install Eclipse as a regular user, not as root or via package managers like `apt
2727

2828
Preferences, settings are under Window > Preferences
2929

30+
### Line wrapping
31+
32+
<http://stackoverflow.com/questions/2846002/does-eclipse-have-line-wrap>
33+
34+
Hard is possible, soft is notoriously not.
35+
36+
### Project preferences
37+
38+
On the package explorer, click on the project and hit `Alt + Enter` or go File > Properties.
39+
40+
From there you can do things like:
41+
42+
- set how the project is run (`F12`), e.g. passing command line arguments to the program or to the VM.
43+
3044
## Keyboard shortcuts
3145

3246
General > Keys
3347

48+
Navigate in editor and its tabs:
49+
50+
- `F3`: open definition in a new tab
51+
52+
- `Alt left`: go to the last location. May jump between lines and change tabs.
53+
54+
- `Ctrl + Shift + T`: find class definition (Type). Does a sort of Fuzzy search for capital letters.
55+
56+
- `Ctrl + Shift + R`: find files.
57+
58+
- `Ctrl + H`: search for Java things. Allows you to select classes, methods, fields, etc.
59+
60+
- `Alt + Shift + Q + XXX`: focus on many different things depending on `XXX`
61+
62+
- `P`: Package Explorer
63+
64+
- `Alt + Shift + X + XXX`: run things
65+
66+
- `J`: Java. Runs the `main` of the file.
67+
68+
- `Ctrl + T`: show a popup with type hierarchy of current class file. You can then click on the classes to jump to them.
69+
70+
- `Ctrl + Shift + Down/Up`: move to the next / previous class member
71+
72+
Navigate across editor and other widgets:
73+
74+
- `Ctrl + M`: Toggle maximize current window.
75+
76+
- `F12`: focus editor
77+
78+
Edit:
79+
80+
- `Ctrl + /`: toggle single line comment
81+
82+
- `Ctrl + Alt + J`: toggle single line comment
83+
84+
Misc:
85+
86+
- `F12`: run program. How it gets run is defined under the project properties.
87+
88+
## Non-keyboard stuff
89+
90+
- Jump to overridden method: a little triangle appears to the left of the method.
91+
92+
<http://stackoverflow.com/questions/3771934/eclipse-navigate-to-inheritor-base-declaration>
93+
3494
## Plugins
3595

3696
### Install
3797

3898
Install and search plugins through the Eclipse Marketplace.
3999

40-
From the IDE: Help > Eclipse Marketplace
100+
From the IDE: Help > Eclipse Marketplace ... note the very intuitive placement under Help.
41101

42102
The website: <http://marketplace.eclipse.org/>
43103

44104
### Good plugins
45105

46106
Add Vim like editing to eclipse: <http://vrapper.sourceforge.net/update-site/stable>.
47107

48-
C and C++: #http://download.eclipse.org/tools/cdt/releases/indigo/
108+
C and C++: <http://download.eclipse.org/tools/cdt/releases/indigo/>
49109

50110
Python: <http://pydev.org/updates>
51111

52-
HTML, Javascript, PHP: <http://download.eclipse.org/webtools/repository/indigo/>
112+
HTML, JavaScript, PHP: <http://download.eclipse.org/webtools/repository/indigo/>
53113

54114
#### LaTeX
55115

@@ -72,14 +132,34 @@ Parses git configure files as key value pairs and shows them on Eclipse. Doesn't
72132

73133
<http://vrapper.sourceforge.net/home>
74134

135+
### StartExplorer
136+
137+
<https://github.com/basti1302/startexplorer>
138+
139+
Open file explorer or shell on given folder from Package Explorer.
140+
141+
Custom commands: go to Preferences > StartExplorer > Custom Commands.
142+
143+
You can use variables as described at: <http://basti1302.github.io/startexplorer/help/05_custom_commands.html>
144+
145+
E.g., start Guake here:
146+
147+
guake -n "${resource_loc}"
148+
149+
No bindings for custom commands yet: <https://github.com/basti1302/startexplorer/issues/5>
150+
75151
### Color themes
76152

153+
#### Editor color theme
154+
77155
Best place to find color themes: <http://eclipse-color-theme.github.com/update>. It already comes with many color themes.
78156

79-
The best way is to install the Color Theme plug-in and install new plugins with General > Appearance > Color Theme
157+
The best way is to install the Eclipse Color Theme plug-in and install new plugins with General > Appearance > Color Theme
158+
159+
Otherwise to install `.epf` themes: File > Import > Preferences > Select *.epf
80160

81-
Otherwise to install epf themes: File > Import > Preferences > Select *.epf
161+
Vibrant Ink is a good choice as usual.
82162

83-
Good dark theme: <http://www.eclipsecolorthemes.org/?view=theme&id=7915>
163+
#### GUI color theme
84164

85-
For the GUI, Appearance > Classic worked best for Ubuntu Unity.
165+
For the rest of the GUI besides the editor, Appearance > Classic worked best for Ubuntu Unity.

file.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# file
22

3-
POSIX 7
3+
POSIX 7: <http://pubs.opengroup.org/onlinepubs/9699919799/utilities/file.html>
44

55
Attempts to determine file type and retrieve metadata.
66

7-
This is in general impossible,
8-
but program makes good guesses.
7+
This is in general impossible, but program makes good guesses.
98

109
echo a > a
1110
file a
@@ -14,6 +13,8 @@ Output:
1413

1514
a: ASCII text
1615

16+
As you can see it is a good quick and dirty way to determine file encoding: <http://superuser.com/questions/301552/how-to-auto-detect-text-file-encoding>
17+
1718
## L
1819

1920
Follow links:

id.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# id
2+
3+
POSIX 7: <http://pubs.opengroup.org/onlinepubs/9699919799/utilities/id.html>
4+
5+
Shows user and group ids and names.
6+
7+
Show all info for a given user:
8+
9+
u='root'
10+
id "$u"
11+
12+
For current user:
13+
14+
id
15+
16+
Effective user ID:
17+
18+
id -u
19+
20+
Effective username:
21+
22+
id -un
23+
24+
Real user ID:
25+
26+
id -ur
27+
28+
Same but for groups:
29+
30+
id -g
31+
id -gn
32+
id -gr

usermod.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# usermod
2+
3+
shadow-utils package.
4+
5+
Add or remove users to groups.
6+
7+
If you are the user, you have to logout/login again for changes to take effect.
8+
9+
Change primary group of user `u` to `g`:
10+
11+
g=1000
12+
sudo usermod -g "$g" "$u"
13+
14+
Sets exactly the supplementary groups of user `u`. Remove from non listed ones:
15+
16+
sudo usermod -G "$g" "$u"
17+
18+
Append (-a) groups `g` to supplementary groups of user `u`:
19+
20+
sudo usermod -aG "$g" "$u"
21+
22+
Change home directory of user `u` to `d`. The old contents are not moved:
23+
24+
sudo usermod -d "$d" "$u"
25+
26+
Also move home directory contents to the new home:
27+
28+
sudo usermod -md "$d" "$u"

utils.sh

-63
Original file line numberDiff line numberDiff line change
@@ -2130,39 +2130,6 @@
21302130

21312131
who
21322132

2133-
## id
2134-
2135-
# POSIX 7.
2136-
2137-
# Shows user and group ids and names.
2138-
2139-
# Show all info for a given user:
2140-
2141-
u=root
2142-
id "$u"
2143-
2144-
# For current user:
2145-
2146-
id
2147-
2148-
# Effective userid:
2149-
2150-
id -u
2151-
2152-
# Effective username:
2153-
2154-
id -un
2155-
2156-
# Real userid:
2157-
2158-
id -ur
2159-
2160-
# Same but for groups:
2161-
2162-
id -g
2163-
id -gn
2164-
id -gr
2165-
21662133
## whoami
21672134

21682135
# Print effective user name:
@@ -2300,36 +2267,6 @@
23002267
g=
23012268
sudo groupadd $g
23022269

2303-
## usermod
2304-
2305-
# Add/remove users to groups
2306-
2307-
# If you are the user, you have to logout/login again for changes to take effect.
2308-
2309-
# Change primary group of user u to g:
2310-
2311-
usermod -g $g $u
2312-
2313-
g=1000,1001
2314-
2315-
# Sets exactly the supplementary groups of user u.
2316-
# Remove from non listed ones:
2317-
2318-
usermod -G $g $u
2319-
2320-
# Append (-a) groups g to supplementary groups of user u:
2321-
2322-
usermod -aG $g $u
2323-
2324-
# Change home dir of user u to d.
2325-
# The old contents are not moved:
2326-
2327-
usermod -d $d $u
2328-
2329-
# Also move his current dir contents to new dir:
2330-
2331-
usermod -md $d $u
2332-
23332270
## passwd
23342271

23352272
# File that holds usernames and key account options,

0 commit comments

Comments
 (0)