mirror of https://github.com/cheat/cheat.git
updated emacs, ffmpeg. branched org-mode. added slack.
This commit is contained in:
parent
eff042d50b
commit
0a54b2a2ff
|
@ -0,0 +1,3 @@
|
|||
# Extract contents of a .deb file
|
||||
$ ar vx foo.deb # -> data.tar.gz
|
||||
$ tar xf data.tar.gz
|
|
@ -3,7 +3,7 @@
|
|||
Indent Select text then press TAB
|
||||
Cut CTRL-w
|
||||
Copy ALT-w
|
||||
Paste CTRL-y
|
||||
Paste ("yank") CTRL-y
|
||||
Search/Find CTRL-s
|
||||
Replace ALT-% (ALT-SHIFT-5)
|
||||
Save CTRL-x CTRL-s
|
||||
|
@ -11,7 +11,7 @@
|
|||
Undo CTRL-x u
|
||||
Highlight all text CTRL-x h
|
||||
Directory listing CTRL-x d
|
||||
Cancel a command ESC ESC ESC
|
||||
Cancel a command CTRL-g
|
||||
Font size bigger CTRL-x CTRL-+
|
||||
Font size smaller CTRL-x CTRL--
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
|||
|
||||
# Other stuff
|
||||
|
||||
Open a shell ALT-x eshell
|
||||
Open a shell ALT-x shell
|
||||
Goto a line number ALT-x goto-line
|
||||
Word wrap ALT-x toggle-word-wrap
|
||||
Spell checking ALT-x flyspell-mode
|
||||
|
@ -39,32 +39,9 @@
|
|||
Compile some code ALT-x compile
|
||||
List packages ALT-x package-list-packages
|
||||
|
||||
# Sudoing within eshell
|
||||
|
||||
By default when using the sudo command within eshell you'll just
|
||||
get "permission denied" messages. To overcome that type:
|
||||
|
||||
alias sudo '*sudo $*'
|
||||
|
||||
# Line numbers
|
||||
|
||||
To add line numbers and enable moving to a line with CTRL-l:
|
||||
|
||||
(global-set-key "\C-l" 'goto-line)
|
||||
(add-hook 'find-file-hook (lambda () (linum-mode 1)))
|
||||
|
||||
# Org-mode
|
||||
|
||||
To begin org-mode ALT-x org-mode
|
||||
Table column separator Vertical/pipe character
|
||||
Reorganize table TAB
|
||||
Section heading *
|
||||
Open/collapse section TAB
|
||||
Open/collapse All CTRL-TAB
|
||||
Export in other file formats (eg HTML,PDF) CTRL-c CTRL-e
|
||||
|
||||
To make org-mode automatically wrap lines:
|
||||
|
||||
(add-hook 'org-mode-hook
|
||||
'(lambda ()
|
||||
(visual-line-mode 1)))
|
||||
|
|
|
@ -2,7 +2,14 @@
|
|||
ffmpeg -i path/to/file.ext
|
||||
|
||||
# Convert all m4a files to mp3
|
||||
for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -ab 320k "${f%.m4a}.mp3"; done
|
||||
for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -vn -b:a 320k "${f%.m4a}.mp3"; done
|
||||
|
||||
# Convert video
|
||||
# -g : GOP, for searchability
|
||||
ffmpeg -i input.ext -vcodec vp9 -acodec libopus -b:v 21000k -b:a 320k -g 150 -threads 4 output.ext
|
||||
|
||||
# Convert image sequence to video
|
||||
ffmpeg -r 18 -pattern_type glob -i '*.png' -b:v 21000k -s hd1080 -vcodec vp9 -an -pix_fmt yuv420p -deinterlace output.ext
|
||||
|
||||
# Listen to 10 seconds of audio from a video file
|
||||
#
|
||||
|
@ -10,3 +17,4 @@ for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -ab 320k "${f%.m4a}.mp3"; d
|
|||
# -t : seconds to cut
|
||||
# -autoexit : closes ffplay as soon as the audio finishes
|
||||
ffmpeg -ss 00:34:24.85 -t 10 -i path/to/file.mp4 -f mp3 pipe:play | ffplay -i pipe:play -autoexit
|
||||
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
Begin org-mode ALT-x org-mode
|
||||
Save CTRL-x CTRL-s
|
||||
Export in other file formats (eg HTML,PDF) CTRL-c CTRL-e
|
||||
|
||||
# Outline
|
||||
|
||||
Section heading *
|
||||
New headline ALT-return
|
||||
Move headline up or down ALT-up_arrow/down_arrow
|
||||
Adjust indent depth of headline ALT-left_arrow/right_arrow
|
||||
Open/collapse section TAB
|
||||
Open/collapse All CTRL-TAB
|
||||
|
||||
# To-Do Lists
|
||||
|
||||
Mark list item as TODO ** TODO
|
||||
Cycle through workflow SHIFT-left_arrow/right_arrow
|
||||
Show only outstanding TODO items CTRL-c CTRL-v
|
||||
|
||||
# Tables
|
||||
|
||||
Table column separator Vertical/pipe character
|
||||
Reorganize table TAB
|
||||
Move column ALT-left_arrow/right_arrow
|
||||
Move row ALT-up_arrow/down_arrow
|
||||
|
||||
# Styles
|
||||
|
||||
*bold*
|
||||
/italic/
|
||||
_underlined_
|
||||
=code=
|
||||
~verbatim~
|
||||
+strike-through+
|
||||
|
||||
# Heading
|
||||
|
||||
Header -*- mode: org -*-
|
||||
|
||||
# .emacs
|
||||
|
||||
To make org-mode automatically wrap lines:
|
||||
|
||||
(add-hook 'org-mode-hook
|
||||
'(lambda ()
|
||||
(visual-line-mode 1)))
|
|
@ -0,0 +1,27 @@
|
|||
# Create a Slackware package from a structured directory and sub-tree
|
||||
$ cd /path/to/pkg/dir
|
||||
$ su - c 'makepkg --linkadd y --chown n $foo-1.0.3-x86_64-1_tag.tgz'
|
||||
|
||||
|
||||
# Install a Slackware package
|
||||
installpkg foo-1.0.3-x86_64-1.tgz
|
||||
|
||||
# Install a Slackware package to non-standard location
|
||||
ROOT=/path/to/dir installpkg foo-1.0.4-noarch-1.tgz
|
||||
|
||||
# Create backup of files that will be overwritten when installing
|
||||
tar czvf /tmp/backup.tar.gz $(installpkg --warn foo-1.0.4-noarch-1.tgz)
|
||||
|
||||
|
||||
# Upgrade a Slackware package including files only in new version
|
||||
upgradepkg --install-new foo-1.0.6-noarch-1.tgz
|
||||
|
||||
# Upgrade a Slackware package even if version is the same
|
||||
upgradepkg --reinstall foo-1.0.4-noarch-1.tgz
|
||||
|
||||
|
||||
# Remove a Slackware package
|
||||
removepkg foo-0.2.8-x86_64-1
|
||||
|
||||
# Remove a Slackware package, retaining a backup (uninstalled) copy
|
||||
removepkg -copy foo-0.2.8-x86_64-1 # -> /var/log/setup/tmp/preserved_packages/foo...
|
|
@ -0,0 +1,5 @@
|
|||
# List contents of RPM
|
||||
rpm2cpio foo.rpm | cpio -vt
|
||||
|
||||
# Extract contents of RPM
|
||||
rpm2cpio foo.rpm | cpio -vid
|
|
@ -0,0 +1,32 @@
|
|||
# Sync to newest SlackBuild.org tree
|
||||
sport r
|
||||
|
||||
# Search (fuzzy) SlackBuild tree for packages foo and BaR
|
||||
sport s foo bar
|
||||
|
||||
# Operate from alternate build tree
|
||||
SBOPATH=/path/to/tree sport s foo
|
||||
|
||||
# View info and README of BaR (not fuzzy)
|
||||
sport c foo BaR
|
||||
|
||||
# Build a package
|
||||
sport i --build-only foo
|
||||
|
||||
# Build and install package foo and BaR
|
||||
sport i foo BaR
|
||||
|
||||
# Build and install package from current directory
|
||||
sport i .
|
||||
|
||||
# Upgrade instead of install
|
||||
INSTALLER=upgradepkg sport i foo
|
||||
|
||||
# Build dependency list for baz
|
||||
echo "foo BaR" >> /tmp/baz.list
|
||||
|
||||
# Install list of packages from file
|
||||
sport i $(< /tmp/baz.list)
|
||||
|
||||
# Check if package is installed
|
||||
sport k foo
|
|
@ -0,0 +1,14 @@
|
|||
# Trash foo and bar
|
||||
trash foo bar
|
||||
|
||||
# Trash "foo bar"
|
||||
trash foo\ bar
|
||||
|
||||
# List files in trash
|
||||
trash -v --list
|
||||
|
||||
# Restore foo from trash
|
||||
trash --restore foo
|
||||
|
||||
# Empty trash
|
||||
trash --empty
|
Loading…
Reference in New Issue