, compose, print execute programs via entries in the mailcap file
see also :
view - see - compose - print - update-mime
edit, compose and print versions are
just aliases that default to the view, edit, compose, and
print actions (respectively).
add an example, a script, a trick and tips
Use vim to edit ANY text on Linux
It would depend on what file manager you are using, but most of
them you can usually add some sort of right-click menu item to
"Open in Vim".
I use Dolphin for KDE4. To add menu items (called service menus) you
create a .desktop file in your service menus folder. In my system
this resides in
/usr/share/kde4/services/ServiceMenus but it may
vary for your system.
Create the file
open_in_vim.desktop with the
[Desktop Action openInVim]
Name=Open in Vim
Restart Dolphin (or Konqueror) and you should see this option
when you right-click on a file.
If you would also like to be able to open folders in vim, then
change the mime type to
If you would prefer to have "Open in Vim" appear under the
Actions menu then remove the line,
Granted, it's not intuitive, but you don't have to pay money in
order to do it!
Tool like Media File Segmenter for Linux
Try ffmpeg. It's
powerful & cross-platform. It may already exist in your linux
distro. To copy 2 minutes of video after the first and convert
from mpg to ts:
ffmpeg -vcodec copy -ss 00:01:00 -t 00:03:00 \
-i input.mpg -vcodec copy -acodec copy \
-f mpegts output.ts
It's a good choice if you have lots of videos in essentially
random formats. It's a 'swiss army knife' for video.
If you are starting with mpeg, you could also try mpegtx, which
includes a variety of mpeg tools including a splitter. Easier
IMHO than ffmpeg to split. To split a file into 10 chunks each
with a basename of 'chunk':
mpgtx -10 input.mpg -b chunk
You may also be able to use VLC as a
splitter, but I never have. There are topics discussing it, however.
Irfanview nearest equivalent for linux
The standard answer is GIMP of course. But you might also like ImageMagick for
Change first byte of file in Linux?
You can do something like
echo -ne \\xFF | dd conv=notrunc
bs=1 count=1 of=YOURFILE, replacing FF with your hex
value. Try it first though :)
How can I edit a file if there is no vi, vim, joe, etc?
Did you wipe out /bin or something? Otherwise maybe you could
hack something together with the text utilities in the GNU Coreutils that should be standard on a
Vim press ENTER to continue
Command-line video concatenation and recompression?
My best bet is ffmpeg. It is powerful enough to do what you want.
Cheat Engine for Mac OS X or Linux
Mac OS X
There is a Mac port for Cheat Engine available for download
Scanmem is a simple interactive debugging
utility for Linux, used to locate the address of a variable in
a running process. This can be used for the analysis or
modification of a hostile process on a compromised machine, for
reverse engineering, or as a "pokefinder" to cheat at video
GameConqueror is a GUI for scanmem, aims to
provide more features than scanmem, and CheatEngine-alike
Ubuntu / Debian
available in the default Debian repositories and the Ubuntu
They can be installed with the command:
sudo apt-get install scanmem gameconqueror
scanmem can be installed with the command:
sudo yum install scanmem
gameconqueror is not packaged for RPM.
The source code for
gameconqueror is available here.
It can be compiled like other Linux source software.
In vim's visual mode (type "v"), how do I select multiple lines?
Same as normal mode; use
<n>G to go to a
How to copy remote machines text to local machines clipboard through SSH?
If you enable X forwarding then
xclip can do this.
xclip -i -selection clipboard somefile
Could less show the viewed proportion of text file?
Do you mean like with the
Modifiying a file in editor automatically
Notepad++ allows scripts and macros, it is also opensource, so
you could easily change the "Save" command to run the script,
with a little bit of elbow grease.
How can the Table of Contents in a PDF file be edited?
PDF is an image format. There is no storage of the contents of
the table, only a "picture" of it. It can only be edited if the
PDF's OCR can read the table as text, which is unlikely. You will
need to use another application to create the table and then
convert it to PDF.
VIM Editor: File Enconding and Line Endings
" Stick with the UTF-8 encoding.
" Encoding used for the terminal.
let &termencoding = &encoding
" Encoding used in buffers, registers, strings in expressions, "viminfo"
" file, etc.
" Encoding used for writing files.
" Use both Unix and DOS file formats, but favor the Unix one for new files.
NOTE: The merit of the last line is that both
formats are displayed correctly in Vim buffer. For example, if
dos files that you would open in Vim from
now on would be cluttered with
^M symbols at line
^M is nothing else, but
\r which Vim, in this case, would fail to interpret
properly. Therefore, it is strongly recommended to keep
fileformats as shown above. Don't worry, any new
files that you create will be using
unix format by
default (as stated in the comment above).
If you encounter some file with
dos format and want
to convert it into
unix, then type the following:
(or any of its aliases) will use the given action to process
each mime-type/file in turn. Each file is specified as its
mime-type, its encoding (e.g. compression), and filename
together, separated by colons. If the mime-type is omitted,
an attempt to determine the type is made by trying to match
the file’s extension with those in the
mime.types files. If the encoding is omitted, it will
also be determined from the file’s extensions.
Currently supported encodings are gzip (.gz),
bzip (.bz), bzip2 (.bz2), and compress
(.Z). A filename of "-" can be used to mean
"standard input", but then a mime-type must
user’s files (~/.mailcap; ~/.mime.types) and the
system files (/etc/mailcap; /etc/mime.types) are searched in
turn for information.
extract-mail-attachment msg.txt | see image/tiff:gzip:-
All options are in the form --<opt>=<value>.
Performs the specified action
on the files. Valid actions are view, cat
(uses only "copiousoutput" rules and sends output
to STDOUT) , compose, composetyped,
edit and print. If no action is specified, the
action will be determined by how the program was called.
Turns on extra information to
find out what is happening.
"copiousoutput" directive and sends output to
Displays the found command
without actually executing it.
run-mailcap (and its aliases) is in the public domain (the
only true "free").
(and its aliases) was written by Brian White