Skip to content

Commit d4c6e12

Browse files
committed
Change slogan
1 parent a40d642 commit d4c6e12

21 files changed

+204
-17
lines changed

README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Linux Cheat ![logo](logo.jpg)
22

3-
Linux tutorials and cheatsheets. Minimal examples. Mostly user-land.
3+
Linux tutorials and cheatsheets. Minimal examples. Mostly user-land CLI utilities.
44

55
Includes Linux concepts and utilities that work on Linux, not necessarily in the LSB. So this is a big dump of useful things, and when something gets big / useful enough, I split to another repository.
66

@@ -60,6 +60,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
6060
1. [mountall](mountall.md)
6161
1. [pathchk](pathchk.md)
6262
1. [rsync](rsync.md)
63+
1. [rm](rm.md)
6364
1. [sync](sync.md)
6465
1. [swap partition](swap-partition.md)
6566
1. [tune2fs](tune2fs.md)
@@ -130,7 +131,6 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
130131
1. [echo](echo.sh)
131132
1. [column](column.md)
132133
1. [cut](cut.sh)
133-
1. [Eclipse](eclipse.md)
134134
1. [expand](expand.md)
135135
1. [fold](fold.md)
136136
1. [paste](paste.md)
@@ -142,6 +142,10 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
142142
1. [uniq](uniq.md)
143143
1. [uuencode](uuencode.md), `uudecode`
144144
1. [wc](wc.md)
145+
1. IDEs
146+
1. [Eclipse](eclipse.md)
147+
1. [Code::Blocks](codeblocks.md)
148+
1. [KDevelop](kdevelop.md)
145149
1. Binary data viewers
146150
1. [hd](hd.md)
147151
1. [hexdump](hexdump.md)
@@ -169,6 +173,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
169173
1. [pmap](ps.md)
170174
1. [ps](ps.md)
171175
1. [top](top.md)
176+
1. [watch](watch.md)
172177
1. psmisc
173178
1. [killall](killall.md)
174179
1. [Shebang](shebang/)
@@ -220,6 +225,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
220225
1. [HandBrake](handbrake.md)
221226
1. Trivia
222227
1. [MPEG LA](mpeg-la.md)
228+
1. [VLC](vlc.md)
223229
1. [Camera](camera.md)
224230
1. [Video4Linux](video4linux.md)
225231
1. File sharing
@@ -315,7 +321,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
315321
1. [Statistics](statistics.md)
316322
1. Packages
317323
1. [util-linux](util-linux.md)
318-
1. Simulation
324+
1. [Physics](physics.md)
319325
1. [gazebo](gazebo.md)
320326
1. Misc
321327
1. [BusyBox](busybox.md)

alternatives.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ Strict real time:
1414

1515
- <https://en.wikipedia.org/wiki/QNX>, proprietary, micro-kernel, bought by BlackBerry.
1616
- <https://en.wikipedia.org/wiki/VxWorks>, proprietary
17-
- <https://en.wikipedia.org/wiki/ECos> GPL, started by Cygnus, discontinued by Red Hat, copyright later transfered to the FSF.
17+
- <https://en.wikipedia.org/wiki/ECos> GPL, started by Cygnus, discontinued by Red Hat, copyright later transferred to the FSF.
1818
- <https://en.wikipedia.org/wiki/FreeRTOS>
19+
- <https://en.wikipedia.org/wiki/Micro-Controller_Operating_Systems> proprietary with source available
1920

2021
Dedicated OSes / firmware:
2122

audio/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Rip from DVD:
188188

189189
Automatically finds right configurations on most systems.
190190

191-
Creates dir in cur dir and saves rip out as `.ogg` in it.
191+
Creates dir in cur dir and saves rip out as `.ogg` (Vorbis) in it.
192192

193193
## Synthesis
194194

codeblocks.md

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Tested with: 13.12 Ubuntu 14.04
44

55
<http://wiki.codeblocks.org/index.php?title=Keyboard_Shortcuts>
66

7+
Not recommended. Crashes a lot.
8+
79
## Getting started
810

911
### Import projects
@@ -16,6 +18,8 @@ Tested with: 13.12 Ubuntu 14.04
1618

1719
Not possible
1820

21+
#### CMake
22+
1923
### Must have settings
2024

2125
Open default workspace at startup:
@@ -26,6 +30,12 @@ Open default workspace at startup:
2630

2731
Big as in GCC big.
2832

33+
## Jump to declaration
34+
35+
Ctrl + Shift + .
36+
37+
No mouse shortcut??
38+
2939
## Bibliography
3040

3141
<http://wiki.codeblocks.org/index.php?title=Keyboard_Shortcuts>

eclipse.md

+4
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ HTML, JavaScript, PHP: <http://download.eclipse.org/webtools/repository/indigo/>
364364

365365
#### CDT
366366

367+
#### C++
368+
369+
Hard to get working...
370+
367371
C and C++: <http://download.eclipse.org/tools/cdt/releases/indigo/>
368372

369373
For large projects, make sure that you add more memory to the VM at `Eclipse.ini` or the indexing hangs: <http://stackoverflow.com/questions/9565125/whats-the-recommended-eclipse-cdt-configuration-for-big-c-project-indexer-ta>

ffmpeg.md

+25
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ List codecs: <http://stackoverflow.com/questions/3377300/what-are-all-codecs-sup
1010

1111
## Extract raw streams
1212

13+
### VP9
14+
15+
Freedom!
16+
17+
ffmpeg -framerate 4 -pattern_type glob -i '*.jpeg' -c:v vp9 out.webm
18+
19+
TODO: quality is bad.
20+
1321
### H264
1422

1523
- <http://stackoverflow.com/questions/10380045/is-there-any-easy-way-to-extract-h-264-raw-stream-in-annexb-format>
@@ -78,6 +86,23 @@ where `I`, `B`, and `P` are defined at: <https://en.wikipedia.org/wiki/Video_com
7886

7987
From there on, Bash it up.
8088

89+
## Images to video
90+
91+
- <http://superuser.com/questions/624567/ffmpeg-create-a-video-from-images>
92+
- <http://askubuntu.com/questions/380199/converting-images-into-video>
93+
- <http://stackoverflow.com/questions/16315192/avconv-make-a-video-from-a-subset-on-images>
94+
- <https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images>
95+
96+
Just works:
97+
98+
ffmpeg -framerate 4 -pattern_type glob -i '*.jpg' -c:v libx264 out.mp4
99+
100+
### Smooth transitions
101+
102+
- <http://stackoverflow.com/questions/7565962/ffmpeg-fade-effects-between-frames>
103+
- <http://superuser.com/questions/778762/crossfade-between-2-videos-using-ffmpeg>
104+
- <http://superuser.com/questions/223678/how-to-convert-single-images-into-a-video-with-blending-transition>
105+
81106
## ffplay
82107

83108
Minimalistic video preview tool.

imagemagick.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ The first `-depth 8`, specifies it for the input, and the second for the output.
171171

172172
#### Depths that are not multiple of 8
173173

174-
TODO: what happens when depth < 8? http://stackoverflow.com/questions/10155092/how-do-i-convert-image-to-2-bit-per-pixel ImageMagick packs multiple bits per byte since it is not possible to address bits, but I don't understand exactly how. Specially, because it depends on the dimensions! E.g.;
174+
TODO: what happens when depth less than 8? http://stackoverflow.com/questions/10155092/how-do-i-convert-image-to-2-bit-per-pixel ImageMagick packs multiple bits per byte since it is not possible to address bits, but I don't understand exactly how. Specially, because it depends on the dimensions! E.g.;
175175

176176
printf "%10s" | sed 's/ /\xFF\x00/g' > f.gray
177177
convert -depth 8 -size 1x20 f.gray -depth 2 g.gray
@@ -338,4 +338,6 @@ Checkerboard:
338338
printf "%1002001s" | sed 's/ /\xFF\x00/g' > f.gray
339339
convert -depth 8 -size 1001x2002 f.gray f.png
340340

341+
## Trivia
341342

343+
- http://arstechnica.com/security/2016/05/exploits-gone-wild-hackers-target-critical-image-processing-bug/

kdevelop.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# KDevelop
2+
3+
Tested on 4.7.3.
4+
5+
Very good first impression for C++ CMake. Worked really fast, easy to find how to do the basic things that I need.
6+
7+
C / C++ focused, but other languages also supported: <http://developer.kde.org/~larrosa/visualtutorial/chapter02.html>
8+
9+
## Settings
10+
11+
- Vi input mode: Settings > Editing > Vi input mode > Use
12+
13+
## Navigate souce
14+
15+
- Import existing source: File > Import > CMake. Done. Just works!
16+
- Jump to definition: Ctrl + click.
17+
- View class hierarchy and method layout: Right click on class name > Find in class browser
18+
- Jump to previous location: Meta + Left (oh now, meta usage inside non window manager program...)
19+
- Find uses: Right click > Find uses. Shows either calls, definitions or declarations.
20+
- Next / previous tab keyboard shortcut: http://stackoverflow.com/questions/37050415/how-to-move-to-the-next-previous-right-left-file-tab-on-kdevelop-with-a-ke
21+
- Ctrl + Alt + B: toggle breakpoint on current line
22+
- Ctrl + Alt + O, type filename / symbol name: autocomplete jump to file that matches file / symbol
23+
24+
## TODO
25+
26+
- find uses of macro
27+
- send stdin to running executable from console
28+
29+
## Build and run
30+
31+
- F8: compile
32+
- Shift + F9: run
33+
34+
## Debug
35+
36+
First you must compile with debug symbols.
37+
38+
With CMake: <http://stackoverflow.com/questions/24322956/kdevelop-steps-and-breakpoints-not-working>
39+
40+
CMake manage multiple build configurations: <http://stackoverflow.com/questions/15064715/kdevelop-with-cmake-project-how-to-manage-debug-and-release-builds>
41+
42+
- F9: run in debugger mode. TODO: hitting it multiple times just stops the previous one and starts a new one?
43+
- F10: GDB next
44+
- F11: GDB step
45+
- F12: GDB finish
46+
- Continue: no default keyboard shortcut! I set it to Shift + F10.
47+
48+
Watch variable: hover it, Watch this. Could not find on right click...
49+
50+
Find the actual derived type of a pointer to a base class: TODO. For GDB only: <http://stackoverflow.com/questions/8528979/how-to-determine-if-an-object-is-an-instance-of-certain-derived-c-class-from-a>
51+
52+
Current UI for the debug pane is bad:
53+
54+
- jump to line of breakpoint on editor: <https://forum.kde.org/viewtopic.php?f=218&t=125905#p338944> No mouse method or visible indication!
55+
- cannot select multiple breakpoints at once to delete them
56+
57+
## Bibliography
58+
59+
Documentation: https://docs.kde.org/trunk5/en/extragear-kdevelop/kdevelop/index.html
60+
61+
### Reviews
62+
63+
Positive:
64+
65+
- <http://www.gnurou.org/code/kdevelop-kernel>

parallel.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GNU.
66

77
Run `echo` 100 times in parallel:
88

9-
seq 100 | parallel echo {}
9+
seq 100 | parallel echo '{}'
1010

1111
## halt
1212

physics.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Physics
2+
3+
Finite element:
4+
5+
- <https://www.quora.com/What-is-the-best-open-source-Finite-Element-Method-software>
6+
- <http://feacompare.com/>

proc-filesystem.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ The names come from several sources: some are vendor specific like Intel and AMD
210210

211211
Contains kernel parameters.
212212

213-
Those can also be modified with `sysctl`.
213+
Those can also be modified with `sysctl`. Options will be documented there.
214214

215215
## /proc/uptime
216216

ramfs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Create a tmpfs:
2626
Create a ramfs:
2727

2828
sudo mkdir -p /mnt/ramfs
29-
sudo mount -t ramfs -o size=100m ramfs /mnt/ramfs
29+
sudo mount -t ramfs -o size=300m ramfs /mnt/ramfs
3030

3131
Undo with:
3232

rm.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# rm
2+
3+
## Speed up
4+
5+
Deleting files is **way** slower than creating them.
6+
7+
I wonder if the creation order matters: if files are in a SHA pattern it's horrible!
8+
9+
- <http://askubuntu.com/questions/114969/is-there-any-faster-way-to-remove-a-directory-than-rm-rf>
10+
- <http://serverfault.com/questions/128012/how-to-make-rm-faster-on-ext3-linux>
11+
- <http://serverfault.com/questions/183821/rm-on-a-directory-with-millions-of-files/328305#328305>
12+
- <http://stackoverflow.com/questions/1795370/unix-fast-remove-directory-for-cleaning-up-daily-builds>
13+
- <http://superuser.com/questions/680119/deleting-millions-of-files>
14+
- <http://unix.stackexchange.com/questions/37329/efficiently-delete-large-directory-containing-thousands-of-files>

sysctl.md

+4
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,7 @@ All files in the `.d` get sourced.
7272
The effective hostname.
7373

7474
Normally taken from `/etc/hostname` at startup.
75+
76+
## swappiness
77+
78+
<http://askubuntu.com/questions/103915/how-do-i-configure-swappiness>

ulimit.md

+5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ Linux deals well with CPU limits since CPU usage rotates according to nice, but
111111

112112
The timeout tool aims to limit CPU and RAM for the children as well as parent: <https://github.com/pshved/timeout>
113113

114+
### CPU usage
115+
116+
- <http://stackoverflow.com/questions/386945/limiting-certain-processes-to-cpu-linux>
117+
- <http://unix.stackexchange.com/questions/151883/limiting-processes-to-not-exceed-more-than-10-of-cpu-usage>
118+
114119
## Per user limits
115120

116121
### PAM

unicode.md

+6
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ Therefore:
6464

6565
There is even a wiki with famous strategies: <http://en.wikipedia.org/wiki/Transformation_of_text>
6666

67+
- Full width characters <https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms>
68+
69+
Twice as wide as normal ASCII. Used in Asian languages like Chinese where most characters are also 2x wider than normal ASCII.
70+
71+
ABCDEFGHIJKLMNO
72+
6773
### Whitespace
6874

6975
Unicode NBSP variants: <http://en.wikipedia.org/wiki/Non-breaking_space#Width_variations>

virtualization.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ Important niche of application for VMs include:
8383

8484
## Emulation vs virtualization
8585

86-
- emulation vs virtualization: <http://stackoverflow.com/questions/6044978/full-emulation-vs-full-virtualization>
86+
<http://stackoverflow.com/questions/6044978/full-emulation-vs-full-virtualization>
8787

88-
Emulation is usually said to be software only, while virtualization uses hardware support, making it way faster.
88+
Emulation is usually said to be software only, while virtualization uses hardware support, making it way faster.
8989

90-
The x86 family has hardware features that improve performance and may be even required for certain virtualizations.
90+
The x86 family has hardware features that improve performance and may be even required for certain virtualizations.
9191

92-
Those features can be turned on or off by the BIOS, and in many modern systems they come turned off by default.
92+
Those features can be turned on or off by the BIOS, and in many modern systems they come turned off by default.
9393

94-
If you plan on using virtualization, the first thing you should do is to enable such features by going into the BIOS config (first screen shown at computer startup), and looking for a virtualization section.
94+
If you plan on using virtualization, the first thing you should do is to enable such features by going into the BIOS config (first screen shown at computer startup), and looking for a virtualization section.
9595

96-
- Docker: <https://github.com/dotcloud/docker>
96+
Docker: <https://github.com/dotcloud/docker>
9797

9898
### Hypervisor
9999

@@ -104,6 +104,14 @@ TODO vs virtualization?
104104

105105
KVM: hard to say.
106106

107+
## Cycle accurate simulation
108+
109+
Simulates speed well.
110+
111+
Public simulators do not exist for closed source chips I know of.
112+
113+
Likely because they would reveal too much internals and leak IP.
114+
107115
## File formats
108116

109117
### ovf

vlc.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# VLC
2+
3+
- `k`, `l`: move subtitles a bit forwards or backwards. Awesome!
4+
5+
## Videos with small frame-rate
6+
7+
- <https://forum.videolan.org/viewtopic.php?f=2&t=41347&p=442385#p442385>
8+
- <https://trac.videolan.org/vlc/ticket/214>

watch.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# watch
2+
3+
watch -n1 date
4+
5+
Multiple commands:
6+
7+
watch -n1 bash -c 'date;date'
8+
9+
TODO multiple commands and `sudo`. Why does not work?
10+
11+
watch -n1 bash -c 'sudo ls'

wmctrl.md

+6
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,9 @@ Many apps do that with CLI arguments, and you should prefer that method if avail
9191
wmctrl -xa gvim -b add,fullscreen
9292

9393
TODO: when I hit `Alt + Tab`, the list of applications does not show anymore on Ubuntu 15.10...
94+
95+
## Focus window opened by command
96+
97+
Non-trivial of course because there is no simple bijection between windows and executables:
98+
99+
<http://unix.stackexchange.com/questions/167379/set-focus-to-newly-open-window>

0 commit comments

Comments
 (0)