Skip to content

Commit d15a57c

Browse files
committed
Rename index.md -> README.md.
1 parent 1b4707c commit d15a57c

File tree

22 files changed

+796
-1051
lines changed

22 files changed

+796
-1051
lines changed

README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ Important files:
99
- [ubuntu/install.sh](ubuntu/install.sh): Ubuntu install methods many programs.
1010
- [utils.sh](utils.sh): dump of many utils that fit in no other category or are not large enough to get their own file. Many POSIX utilities.
1111

12+
Documentation viewers:
13+
14+
- [man.sh](man.sh)
15+
- [info.sh](info.sh)
16+
1217
Base standards:
1318

1419
- [linux.md](linux.md): Linux, LSB.
@@ -27,7 +32,6 @@ Initialization:
2732

2833
Base topics:
2934

30-
- [compile/](compile/): compilation process, dynamic libraries.
3135
- [desktop/](desktop/): X, XDG, GNOME, KDE and related utilities.
3236
- [filesystem.md](filesystem.md): POSIX file permissions.
3337
- [file-permissions.md](file-permissions.md): filesystem, hard disks, mounting, partitions.
@@ -54,10 +58,16 @@ Generic data formats:
5458

5559
[virtual-machine.md/](virtual-machine): Vagrant, Docker.
5660

61+
Programming tools:
62+
63+
- [compile/](compile/): compilation process, dynamic libraries.
64+
- [ack.sh](ack.sh)
65+
5766
Related subjects in other repositories:
5867

5968
- [networking](https://github.com/cirosantilli/net): networking tools and protocols: HTTP, SSH, curl Apache.
6069

70+
6171
#How to search for stuff
6272

6373
If you know what you are searching for, use the following methods to search by keyword.

ack.sh

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Like find and grep, but with some features specialized to programming,
2+
# and more convenient in general.
3+
4+
# Nice filename/line/match highlight output.
5+
6+
# Ignores .git .svn, backup, swap files by default.
7+
8+
# Can detect and filter by filetype via extension and shebangs.
9+
10+
## install
11+
12+
sudo aptitude install -y ack-grep
13+
# `ack` package was already taken by a kanji converter!
14+
15+
# this begs for an alias:
16+
alias ack="ack-grep"
17+
18+
# Recursive find grep for perl_regex in python files only, detects shebangs:
19+
20+
ack --py perl_regex
21+
22+
# Adds all python files git. shebang aware:
23+
24+
ack -f --py --print0 | xargs -0 -I '{}' git add '{}'
25+
26+
# Print only include names in cpp files
27+
28+
ack --cc '#include\s+<(.*)>' --output '$1'
29+
30+
# --sh for bash
31+
32+
# `-k`: search in all known filetypes.
33+
34+
# There seems to be no way to search into *all* files.
35+
# Well, we have GNU `grep -r` for that...
36+
37+
## -f
38+
39+
# List all filenames of known types:
40+
41+
ack -f
42+
43+
## -g
44+
45+
# List files of known types that match regex:
46+
47+
ack -g '\.py$'
48+
49+
# Easter egg: bill the cat:
50+
51+
ack --thpppt
52+
53+
## combos
54+
55+
# find lines in files:
56+
57+
ack -f | xargs grep 'find'
58+
59+
# dry run replace in files with regex::
60+
61+
ack -f | xargs -lne 'print if s/a/A/g'
62+
63+
# only prints modified lines
64+
65+
# non-dry run replace in files:
66+
67+
ack -f | xargs perl -pie 's/z/Z/g'
68+

chat.sh

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# TODO convert to md.
2+
3+
# Chat utilities, specially command line ones.
4+
5+
##mseg write wall
6+
7+
# Write messages to other users on the system.
8+
9+
##mseg
10+
11+
# Enable/disable messages:
12+
13+
mseg n
14+
mseg
15+
#n
16+
mseg y
17+
mseg
18+
#y
19+
20+
##write
21+
22+
# Write to a user in a TTY:
23+
24+
u=
25+
write $u tty3
26+
27+
# Now:
28+
29+
# - type you message
30+
# - type enter, and it is sent
31+
# - hit Ctrl + D and its over
32+
33+
u=
34+
h=
35+
sudo write $h@$u tty2
36+
37+
##wall
38+
39+
# Write to all:
40+
41+
wall
42+
43+
# Type you message. It is only sent after you ctrl+d
44+
45+
# Sends to all even if disabled:
46+
47+
sudo wall
48+
49+
# Play with it:
50+
51+
#go to tty3. on ubuntu: ctrl+alt+f3
52+
#login as user u
53+
mesg y
54+
#go to tty7 (xserver). on ubuntu: ctrl+alt+f7
55+
sudo write u tty3
56+
#write
57+
#go to tty3
58+
#your message is there!
59+
60+
##talk
61+
62+
# Commandline chat program.
63+
64+
# POSIX.
65+
66+
sudo aptitude install -y talk
67+
68+
##IRC
69+
70+
#internet relay chat
71+
72+
#servers have channels
73+
74+
#log into a server, join a channel
75+
76+
#messages can be seen
77+
78+
#- by all people on channel
79+
#- certain people you write to only
80+
81+
#you cannot see read old messages
82+
#sent when you were not logged in!!
83+
84+
#it is also possible to send files to people
85+
86+
##commands
87+
88+
#intro: <http://www.irchelp.org/irchelp/irctutorial.html>
89+
90+
#full list: <http://en.wikipedia.org/wiki/List_of_Internet_Relay_Chat_commands>
91+
92+
#/connect <server>
93+
94+
##ubuntu channel
95+
96+
##register
97+
98+
xdotool type "/msg nickserv register $password $email"
99+
100+
##verify registration
101+
102+
#go to your email and get the registration code
103+
104+
regcode=
105+
xdotool type "/msg nickserv verify register $uname $regcode"
106+
107+
##clients
108+
109+
##pidgin
110+
111+
#good because integrates with other ims
112+
113+
##create account
114+
115+
#irc server + username on that server == a pidgin account
116+
117+
#add account > irc
118+
119+
#enter server username and pass
120+
121+
##join/create channel:
122+
123+
#an irc channel == a pidgin chat
124+
125+
#chats appear on the buddy list like buddies
126+
127+
#buddies > join a chat > choose server, enter a #channel_name
128+
129+
#if you don't know the name and want to list the available channels,
130+
#enter any #name, and then /list there
131+
132+
#a chat window appear, mapping to the chosen channel on chosen sever
133+
134+
#if you close the chat window, it will not be on your buddy list anymore
135+
136+
##add channel to buddy list permanently:
137+
138+
#buddies > add a group. name it "irc".
139+
140+
#buddies > show > empty groups
141+
142+
#buddies > add a chat. choose type irc, server, channel.
143+
144+
##irssi
145+
146+
#ncurses

compile/gcov.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
GCC test coverage metrics.
2+
3+
Must compile with `-ftest-coverate` to use:
4+
5+
gcc -Wall -fprofile-arcs -ftest-coverage cov.c
6+
7+
TODO usage

compile/library.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
To use a library you may need:
22

3-
- the compiled `.so` or `.a`
3+
- the compiled `.so` or `.a`
44

55
- for C and C++, the header `.h` file(s).
66

@@ -18,7 +18,7 @@ They have `.so` extension on Linux and `.dll` on windows
1818

1919
Dynamic libraries are different from static libraries (`.o` and `.a`) static libraries are put inside the executable at compile time.
2020

21-
Advantages and disadvantages of dynamic libraries over static libraries are the usual tradeoffs of share vs embbed design choices.
21+
Advantages and disadvantages of dynamic libraries over static libraries are the usual trade-offs of share vs embed design choices.
2222

2323
Advantages:
2424

@@ -46,7 +46,7 @@ Since the disadvantages are so minor, it is almost always better to use dynamic
4646

4747
#Search path
4848

49-
Find where gcc search path for both `.a` and `.so`:
49+
Find where GCC search path for both `.a` and `.so`:
5050

5151
gcc -print-search-dirs | grep '^libraries' | tr ':' $'\n'
5252

@@ -93,9 +93,9 @@ Standard: up to 3 numbers.
9393

9494
Yes, they come after the `.so` otherwise there would be ambiguity: `liba.1.so` is version 1 of `liba` or simply `lib.a.1`?
9595

96-
To link to a given version use full basename linking with verison number.
96+
To link to a given version use full basename linking with version number.
9797

98-
linking takes care of version defaults:
98+
Linking takes care of version defaults:
9999

100100
- `liba.so.1.1.1`
101101

@@ -157,15 +157,15 @@ How this information is represented is a part of the `.elf` format definition.
157157

158158
###What can be passed to -l
159159

160-
The name given to -l must be either:
160+
The name given to `-l` must be either:
161161

162162
- stripped from `lib` and `.so` part
163163

164164
Ex: `m`, for `libm.so`. *will not work for `libm.so.1` !!!!!
165165

166166
- colon + `:`full basename. Ex: `-l:libm.so.1`
167167

168-
You need to compile like this so gcc can tell if all your functions are definied.
168+
You need to compile like this so GCC can tell if all your functions are defined.
169169

170170
###Relative vs absolute
171171

@@ -243,15 +243,16 @@ View library load path:
243243

244244
cat /etc/ld.so.conf
245245

246-
Remember: after modifying this file, you must update the load file [cache][] or your changes will not be taken into effect.
246+
Remember: after modifying this file, you must update the load file cache
247+
or your changes will not be taken into effect.
247248

248249
May also include other files by adding a line to that file:
249250

250251
include /etc/ld.so.conf.d/*.conf
251252

252253
This is done by default on Ubuntu.
253254

254-
To take includes into consideration and print the actual search path, use ldconfig.
255+
To take includes into consideration and print the actual search path, use `ldconfig`.
255256

256257
So you also need to look inside included files for the libraries:
257258

@@ -338,7 +339,7 @@ Don't rely on this method for production.
338339

339340
Program that loads shared libs for other programs.
340341

341-
central part of the Linux system.
342+
Central part of the Linux system.
342343

343344
This program links to no shared libs!
344345

compression.md

+4
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ Extract `a.gz` and erase it if successful:
167167

168168
gzip -r .
169169

170+
##gz file format
171+
172+
IETF standardized format: <https://www.ietf.org/rfc/rfc1952.txt>
173+
170174
##Hardlinks
171175

172176
##Keep original
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)