I have such a pdf opened by Okular with Facing pages view mode (center first page).
I want to get all the two-pages view pictures, so manually crop them one by one.
How could extract them to pictures with combining two pages as single one?
I have a file which contain 64895 characters
In [95]: !wc -c 07.org
64895 07.org
How could I get the character at position 60000?
I'd like to find all the files suffix with .md
or .org
find ~ -iregex ".*\.md$"
find ~ -iregex ".*\.org$"
How could combine them?
The Quick Tile Window keyboard shortcut Super+Arrow left makes the window in focus occupy the left half of the screen. Super+Arrow right makes the focused window occupy the right half.
By using these two shortcuts, two windows occupy space in a 1:1 ratio.
How can I modify these shortcuts to have the left window occupy 45% and the right window 55%?
According to this question, How can I convert a series of images to a PDF from the command line on linux?, ImageMagick can convert multiple images to a single PDF.
How could I reverse the operation and convert a PDF of several pages to multiple images?
I have tried the following command, but I got the errors shown:
$ convert test.pdf test-%02.png
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
convert-im6.q16: no images defined `test-%02.png' @ error/convert.c/ConvertImageCommand/3258.
gs
was installed:
$ gs --version
9.26
Ubuntu version:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco
I try to set Bing's Picture of the Day as default Wallpaper.
It did not work as expected.
The other provides
My machine info:
$ neofetch --stdout
------------
OS: Ubuntu 19.04 x86_64
Host: MacBookPro11,1 1.0
Kernel: 5.0.0-31-generic
Uptime: 1 hour, 53 mins
Packages: 2374 (dpkg), 4 (snap)
Shell: bash 5.0.3
Resolution: 2560x1600
DE: KDE
WM: KWin
Theme: Breeze [KDE], Breeze [GTK3]
Icons: breeze [KDE], breeze [GTK3]
CPU: Intel i5-4258U (4) @ 2.900GHz
GPU: Intel Haswell-ULT
Memory: 2703MiB / 3850MiB
I am working on KDE plasma 5.
When strike Alt+Tab to switch applications, they are displayed on the left side of the screen.
How could enable them to be displayed on the center of screen like in Gnome?
The Task Switcher settings don't provide such an option.
Upon trying to start dropbox, it prompts
$ dropbox start
Starting Dropbox...
The Dropbox daemon is not installed!
Run "dropbox start -i" to install the daemon
Following the instructions,
$ dropbox start -i
Starting Dropbox...Traceback (most recent call last):
File "/usr/bin/dropbox", line 1443, in start
download()
File "/usr/bin/dropbox", line 294, in download
import gi
ModuleNotFoundError: No module named 'gi'
Then tried to install gi
$ pip install gi
Collecting gi
Could not find a version that satisfies the requirement gi (from versions: )
No matching distribution found for gi
The version:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco
When try to install dropbox from command line, I read the commands
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
what does -
mean here? is it previous directory?
Usually, I jump to a directory using a cumbersome way
$ cd ~/*/*/*/2.Mathematics
the */*/*
is clumsy,
How could get it down with recursive globing
$ cd ~/**/2.Mathematics
-bash: cd: /home/me/**/2.Mathematics: No such file or directory
I tested the single quote and double quotes in sed
me@host:~:
$ echo "front" | sed "s/front/back/"
back
me@host:~:
$ echo "front" | sed 's/front/back/'
back
They performed identically, but I remembered to read there exist differences between them months ago.
Google search not helpful with keywords "single quotes and double quotes in sed".
They are not identically, right?
Every time starting the machine, I run the following program:
$ cat start.sh
#! /bin/bash
google-chrome &> /dev/null &
lantern &> /dev/null &
xdg-open . &> /dev/null &
emacs &> /dev/null &
code ~/Programs/ &> /dev/null &
xdg-open ~/Reference/topic_regex.md &> /dev/null &
Cumbersome &> /dev/null &
...
How could I shorten the logic?
Upon checking the process status, I read many strange status
D
I
I<
R+
Rl
S
S+
S<
Sl
Sl+
SLl
SLl+
SN
SNsl
S<s
Ss
Ss+
S<sl
Ssl
Ssl+
STAT
Tl
I learned I (idle,) R(running) , Sleep, but have no ideas the combinations of S+
S<
,
What do they mean? What kind of material should be consult with ?
The read
builtin command has -e
option
-e Use Readline to handle input. This permits input editing in the same
manner as the command line.
What's Readline
in the specification:
$ man readline
No manual entry for readline
$ man Readline
No manual entry for Readline
There are no details of readline.
The the simpler form of a function is:
name () { commands return }
I find no difference in a function with and without return.
Suppose the minimal code:
step_forward (){
echo "step one;"
return
}
turn_around() {
echo "turn around."
return
}
step_forward
turn_around
Run and check the exit status:
$ bash testing.sh
step one;
turn around.
$ echo $?
0
Run it again after commenting out return
$ bash testing.sh
step one;
turn around.
$ echo $?
0
In what circumstances should a function end with a return?
A function is defined as:
do_something () {
do it
}
I could understand its name 'do_something' and the curly bracket to encapsulate the actions code, but am unable to get the idea what's the purpose of ()
here, since there are no named parameters in Bash scripts. It might be better and straightforward to define it as
do_something {
do it
}
Which does not conflict with its current syntax, and even more declares that there are no named parameters. What's the usage of ()
here?
Command grep
will print a line when the line contains a string that matches an expression, which is not handy to search for specifed content.
For instance, I have vocabulary files with formatting
**word**
1. Definition:
2. Usage
3. Others
I'd like to retrieve all the words to make a wordlist within files
grep '\*\*[^*]*\*\*'
Returns the bulk of the content.
How to use grep
to catch only the word
?
Run Command ls
on Current Directory and get the output:
$ ls
Applications Documents Library Music Public
Desktop Downloads Movies Pictures
I'd like to enumerate them like:
1. Applications
2. Desktop
3. Documents
4. Downloads
5. Library
6. Movies
7. Music
8. Pictures
9. Public
This could be achieved using less
in an intermediate way
ls | less -N
How to enumerate them in a straightforward way?