Millet Porridge

English version of https://corvo.myseu.cn

0%

Linux Tips (II)

Debugging Multi-File Projects with GDB

Use b file_name:line_number to debug:

1
(gdb) break [<file-name>:]<line-num>

A Simple Python HTTP File Server

Create an http server with Python; it can serve as a simple downloader

1
2
3
4
5
# First switch to the directory where the files live

# Start the service
> python2 -m SimpleHTTPServer
> python3 -m http.server

Then you can download directly with wget or aria2, e.g.

1
> wget http://139.129.8.126:8000/lineage-15.0-20171004-BETA-3.0-oneplus2.zip

Using Tmux

  • A simple tmux setup (vi key bindings)

See the gist

  • Nested tmux: add this setting

StackOverFlow solution

1
bind-key b send-prefix

In the second level, Ctrl-b b enters command mode.

  • tmux session saving

tmux session saving

xscast

GitHub

  • A powerful terminal screenshot tool that can display keystrokes — friendly for viewers

out.th.gif

Also, in its config kfinish, i.e. Ctrl-Insert, means finishing the screenshot. Believe it or not, the README doesn’t even say how to quit.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# file location ~/.xscastrc
# the id that comes from `xinput --list'
xinput_id='10'
# dzen config
dh=20
dpad=20
dfont=monospace
dalign=l
dfg='#ffffff'
dbg='#000000'
dbar=yes
delay=0
# keybindings (in the same format as xscast output)
kfinish='C-Ins'
kclear='Ins'
# other examples: C-S-F1, A-n, C-R, F11

Text to ASCII

  • Text to ASCII Art Generator

TAAG

1
2
3
4
5
6
___________                        _________                      __  .__    .__                 
\__ ___/__.__.______ ____ / _____/ ____ _____ _____/ |_| |__ |__| ____ ____
| | < | |\____ \_/ __ \ \_____ \ / _ \ / \_/ __ \ __\ | \| |/ \ / ___\
| | \___ || |_> > ___/ / ( <_> ) Y Y \ ___/| | | Y \ | | \/ /_/ >
|____| / ____|| __/ \___ > /_______ /\____/|__|_| /\___ >__| |___| /__|___| /\___ /
\/ |__| \/ \/ \/ \/ \/ \//_____/

Jumping Back from Vim Help

  • When using vim we often consult the help docs, but after opening a link in the docs we don’t know how to jump back
1
2
3
4
Jump to a subject:  Position the cursor on a tag (e.g. bars) and hit CTRL-].  
With the mouse: ":set mouse=a" to enable the mouse (in xterm or GUI).
¦ Double-click the left mouse button on a tag, e.g. ¦bars¦.
Jump back: Type CTRL-T or CTRL-O. Repeat to go further back.

CTRL-] jumps forward; CTRL-O/CTRL-T jump back.