Skip to content

Commit b0cc652

Browse files
committed
bak
1 parent f688866 commit b0cc652

14 files changed

+139
-7
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
268268
1. [libnotify](libnotify.md)
269269
1. [zenity](zenity.md)
270270
1. Screenshots
271-
1. [recordMyDesktop](recordMyDesktop.md)
271+
1. [recordMyDesktop](record-my-desktop.md)
272272
1. [xwd](xwd.md)
273273
1. [Screensaver](screensaver.md)
274274
1. [IBus](ibus.md)

dot/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
Plain text graph description language and name of a program that converts `.dot` files to images.
44

5-
Graphviz project.
5+
Front-end tool of the Graphviz project, which is backed by a powerful library.
66

77
Can also describe graph appearance.

dot/bold-title.dot

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// http://stackoverflow.com/questions/6171344/graphviz-record-node-with-a-bold-title
2+
digraph i {
3+
"node" [
4+
label =<
5+
<table border="0" cellborder="1" cellspacing="0">
6+
<tr><td><b>title</b></td></tr>
7+
<tr><td>field 1</td></tr>
8+
</table>
9+
>
10+
shape = "none"
11+
];
12+
}

dot/graph.dot

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Undirected
2-
graph graphname {
1+
// Undirected.
2+
graph {
33
a -- b -- c;
44
b -- d;
55
}

dot/html.dot

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
graph {
2+
1 [label=<<b>bold</b>>]
3+
2 [label=<x<sub>sub</sub>>]
4+
1 -- 2
5+
}

dot/node-shape-point-label.dot

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// TODO how to make a graph with shape=point and labels?
2+
// - http://www.graphviz.org/content/external-labels
3+
// - http://stackoverflow.com/questions/23018684/annotation-outside-a-node-in-dot
4+
// - http://www.graphviz.org/content/how-use-xlp-attribute-positioning-external-labels-xlabel
5+
// - http://stackoverflow.com/questions/30689533/graphviz-graph-positioning-xlabels
6+
graph {
7+
node [shape=point];
8+
1 [xlabel="a"]
9+
2 [xlabel="b"]
10+
1 -- 2;
11+
}

dot/tmp.dot

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
digraph G {
2+
a [ label=<&#945;>]
3+
b [ label=<&#946;>]
4+
c [ label="I love <b>&alpha;</b> and &beta;" ]
5+
a -> b -> c
6+
}

dot/unicode.dot

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
graph {
2+
"" -- ""
3+
"α" -- "β"
4+
}

ffmpeg.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,14 @@ From there on, Bash it up.
104104
- <http://askubuntu.com/questions/380199/converting-images-into-video>
105105
- <http://stackoverflow.com/questions/16315192/avconv-make-a-video-from-a-subset-on-images>
106106
- <https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images>
107+
- <http://unix.stackexchange.com/questions/68770/converting-png-frames-to-video-at-1-fps>
108+
- <http://stackoverflow.com/questions/19267443/playback-issues-in-vlc-with-low-fps-video-from-images-using-ffmpeg>
107109

108110
Just works:
109111

110-
ffmpeg -framerate 4 -pattern_type glob -i '*.jpg' -c:v libx264 out.mp4
112+
ffmpeg -framerate 1 -pattern_type glob -i '*.png' -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
113+
114+
`-r 30` to use a standard frame rate and be more compatible, see: <http://stackoverflow.com/questions/19267443/playback-issues-in-vlc-with-low-fps-video-from-images-using-ffmpeg/41797724#41797724>
111115

112116
### Smooth transitions
113117

@@ -178,3 +182,31 @@ A few URLs that can be accessed from the browser:
178182
## udp protocol
179183

180184
An FFmpeg invention it seems: <http://stackoverflow.com/questions/27930879/what-is-ffmpegs-udp-protocol>
185+
186+
## Trim by time
187+
188+
## Cut by time
189+
190+
- <http://stackoverflow.com/questions/18444194/cutting-the-videos-based-on-start-and-end-time-using-ffmpeg/40244234>
191+
- <http://superuser.com/questions/138331/using-ffmpeg-to-cut-up-video>
192+
193+
Best command:
194+
195+
ffmpeg -i in.ogv -ss 00:00 -to 03:30 -c copy out.ogv
196+
197+
## Concatenate
198+
199+
- <http://ffmpeg.org/faq.html#How-can-I-concatenate-video-files>
200+
- <http://stackoverflow.com/questions/7333232/concatenate-two-mp4-files-using-ffmpeg>
201+
202+
Best command:
203+
204+
ffmpeg -i concat:"in1.ogv|in2.ogv" -c copy out.ogv
205+
206+
## Merge audio and video
207+
208+
<http://superuser.com/questions/277642/how-to-merge-audio-and-video-file-in-ffmpeg>
209+
210+
Yeah, this works on VLC and YouTube:
211+
212+
ffmpeg -i video.mp4 -i audio.mp3 -c copy output.mkv

imagemagick.md

+23
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ Force modified aspect ratio:
144144

145145
convert large.png -resize '50x100!' small.png
146146

147+
## Resize to fixed aspect ratio, fill extra space black
148+
149+
convert in.png -resize 800x600 -background black -gravity center -extent 800x600 out.png
150+
147151
### trim
148152

149153
Automagically remove white background.
@@ -252,6 +256,10 @@ TODO what does `-colorspace hsl` mean? Do output formats support HSL?
252256

253257
convert -threshold 50 a.jpg b.jpg
254258

259+
Operate on alpha channel only:
260+
261+
convert apple.svg -scale 512x512 -channel alpha -threshold 50% +channel apple.png
262+
255263
- `-monochrome`: seems to generate a black and white binary image with a good dithering.
256264

257265
convert -monochrome a.jpg b.jpg
@@ -260,6 +268,7 @@ TODO what does `-colorspace hsl` mean? Do output formats support HSL?
260268

261269
<http://www.imagemagick.org/Usage/quantize/#monochrome>
262270

271+
263272
### extent
264273

265274
Keep only the 50x50 central square of an image:
@@ -288,6 +297,16 @@ Horizontally:
288297

289298
convert image.png -background white -alpha remove white.png
290299

300+
### Make white also transparent
301+
302+
Raw:
303+
304+
convert in.png -transparent white out.png
305+
306+
Hard threshold:
307+
308+
convert in.png -threshold 50% -transparent white out.png
309+
291310
### GIF operations
292311

293312
GIF to several images:
@@ -341,3 +360,7 @@ Checkerboard:
341360
## Trivia
342361

343362
- http://arstechnica.com/security/2016/05/exploits-gone-wild-hackers-target-critical-image-processing-bug/
363+
364+
## SVG
365+
366+
Not very good support as of 6.8.9.

od.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Best command for computational use:
8787

8888
1 and 2 means how many bytes per block.
8989

90+
9091
Example:
9192

9293
echo -n ab | od -tx1
@@ -136,8 +137,7 @@ More precisely, there are the following cases:
136137

137138
- if the byte has a corresponding non whitespace ASCII character or space, print that character.
138139

139-
- else if the character has a corresponding backslash `\\` C escape sequence,
140-
print that sequence. Ex: 0 is `\0`.
140+
- else if the character has a corresponding backslash `\\` C escape sequence, print that sequence. Ex: 0 is `\0`.
141141

142142
- else print the octal value of the byte as in `-to1`.
143143

@@ -265,6 +265,12 @@ Output:
265265
0000048 79 20 7a 0a
266266
0000052
267267

268+
### Remove address lines
269+
270+
<http://unix.stackexchange.com/questions/192937/removing-line-numbers-from-ods-output>
271+
272+
-An
273+
268274
## N
269275

270276
Maximum number of bytes to read.

openai-gym.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# OpenAI Gym
2+
3+
<https://github.com/openai/gym/issues>, tested at `77568accd7f698ae67937da0099fa58a037a96fd`.
4+
5+
True getting started:
6+
7+
python examples/agents/random.py
8+
9+
Minimal example: <https://github.com/cirosantilli/gym/tree/random-agent-minimize-print>
10+
11+
Shows GUI, and videos of runs dumped to `tmp`.
12+
13+
Human controlled agent:
14+
15+
python examples/agents/keyboard_agent.py
16+
17+
but it does not have frame rate limiting, so it is useless.
18+
19+
Your first intelligent player:
20+
21+
python examples/agents/cem.py
22+
23+
but the interface is dedicated for the pole game.
24+
25+
TODO: make a minimal interface that adapts to any game. This seems to be the case: <https://github.com/openai/universe-starter-agent/blob/master/README.md>

recordMyDesktop.md renamed to record-my-desktop.md

+4
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ Most useful command:
1616
- save output to `out.ogv`, `out-1.ogv`, ...
1717

1818
Use if from a drop-down terminal like Guake so in the 2 seconds you can make it disappear.
19+
20+
Global shortcuts: <http://askubuntu.com/questions/200952/what-is-a-desktop-recorder-with-global-shortcuts>
21+
22+
Screen area selection: <http://askubuntu.com/questions/156606/how-can-i-accurately-select-an-area-of-screen-to-record-when-using-recordmydeskt>

unicode.md

+4
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,7 @@ Also, it contains NUL characters all over for ASCII, which requires greater care
149149
## Largest common Unicode gliph
150150

151151
<https://www.quora.com/What-are-the-coolest-Unicode-characters/answer/Ciro-Santilli-%E5%85%AD%E5%9B%9B%E4%BA%8B%E4%BB%B6-%E6%B3%95%E8%BD%AE%E5%8A%9F-%E7%BA%B3%E7%B1%B3%E6%AF%94%E4%BA%9A-%E5%A8%81%E8%A7%86>
152+
153+
## Math simulation
154+
155+
<https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts>

0 commit comments

Comments
 (0)