Merge pull request #102 from terminalforlife/master
Code, Formatting Tweaks, Some Fixes, Headers, etcpull/104/head
commit
a6abb2e889
@ -1,15 +1,14 @@
|
||||
# airport
|
||||
#
|
||||
# Wireless network configuration utility.
|
||||
|
||||
# Show current wireless status information:
|
||||
# Show current wireless status information.
|
||||
airport -I
|
||||
|
||||
# Sniff wireless traffic on channel 1:
|
||||
# Sniff wireless traffic on channel 1.
|
||||
airport sniff 1
|
||||
|
||||
# Scan for available wireless networks:
|
||||
# Scan for available wireless networks.
|
||||
airport -s
|
||||
|
||||
# Disassociate from current airport network:
|
||||
sudo airport -z
|
||||
# Disassociate from current airport network.
|
||||
airport -z
|
||||
|
@ -1,23 +1,24 @@
|
||||
# apk is the tool used to install, upgrade, or delete software on a running system
|
||||
# of Alpine Linux package management
|
||||
# apk
|
||||
# Package management software for use in Alpine Linux
|
||||
|
||||
# Install a package
|
||||
apk add $package
|
||||
# Install a package, or upgrade an existing one.
|
||||
apk add [PKG]
|
||||
|
||||
# Remove a package
|
||||
apk del $package
|
||||
apk del [PKG]
|
||||
|
||||
# Update repos
|
||||
# Update index of available packages.
|
||||
apk update
|
||||
|
||||
# Upgrade all packages
|
||||
# Upgrade all installed packages.
|
||||
apk upgrade
|
||||
|
||||
# Find a package
|
||||
apk search $package
|
||||
# Find package, using glob pattern matching.
|
||||
apk search [PKG]
|
||||
|
||||
# To list all installed packages, use:
|
||||
# List all installed packages.
|
||||
apk info
|
||||
|
||||
# To determine which package a file belongs to:
|
||||
apk info --who-owns /sbin/lbu
|
||||
# Determine to which package a file belongs, akin to `dpkg -S [PATH]` in
|
||||
# Debian- and Ubuntu-based distributions of Linux.
|
||||
apk info --who-owns [PATH]
|
||||
|
@ -1,9 +1,12 @@
|
||||
# Search for package PKG. Both package names and their descriptions are searched
|
||||
# for a REGEX match; to avoid this behavior, you may use the `-n` flag, which will
|
||||
# only look for a match in the package name.
|
||||
# apt-cache
|
||||
# Query the APT cache
|
||||
|
||||
# Search for package PKG. Both package names and their descriptions are
|
||||
# searched for a REGEX match; to avoid this behavior, you may use the `-n`
|
||||
# flag, which will only look for a match in the package name.
|
||||
apt-cache search 'PKG'
|
||||
|
||||
# Regarding the above, although multiple package names may not be specified, it's
|
||||
# possible to use ERE to easily and quickly get around this limitation. Here, all
|
||||
# 3 packages (PKG1, PKG2, and PKG3) will be sought.
|
||||
# Regarding the above, although multiple package names may not be specified, -
|
||||
# it's possible to use ERE to easily and quickly get around this limitation.
|
||||
# Here, all 3 packages (PKG1, PKG2, and PKG3) will be sought.
|
||||
apt-cache search '(PKG1|PKG2|PKG3)'
|
||||
|
@ -1,2 +1,5 @@
|
||||
# List trusted GPG keys for APT.
|
||||
# apt-key
|
||||
# Command-line APT key management utility
|
||||
|
||||
# List APT keys marked as trusted.
|
||||
apt-key list
|
||||
|
@ -1,38 +1,43 @@
|
||||
# install aws cli
|
||||
# aws
|
||||
# ???
|
||||
|
||||
# Install AWS CLI, using a Python package installer. This is available in the
|
||||
# Ubuntu 16.04 repositories, so is probably available in other distributions'
|
||||
# repositories, therefore I'd recommend using that unless otherwise required.
|
||||
pip install awscli
|
||||
|
||||
# configure AWS CLI
|
||||
# Configure AWS CLI.
|
||||
aws configure
|
||||
|
||||
# describe instances in the current account
|
||||
# Describe instances in the current account.
|
||||
aws ec2 describe-instances --instance-ids i-01234567
|
||||
|
||||
# list public IP addresses of instances
|
||||
# List public IP addresses of instances.
|
||||
aws ec2 describe-instances \
|
||||
--query "Reservations[*].Instances[*].PublicIpAddress" \
|
||||
--output=text
|
||||
|
||||
# start instance with the specified id
|
||||
# Start instance with the specified ID.
|
||||
aws ec2 start-instances --instance-ids i-12345678c
|
||||
|
||||
# copy directory to S3
|
||||
# Copy directory to S3.
|
||||
aws s3 cp ${directory} s3://${bucket}/${directory} --recursive
|
||||
|
||||
# sync directory with S3
|
||||
# Sync directory with S3.
|
||||
aws s3 sync ${directory} s3://${bucket}/${directory} --exclude *.tmp
|
||||
|
||||
# list s3 buckets
|
||||
# List S3 buckets.
|
||||
aws s3 ls
|
||||
|
||||
# remove s3 bucket
|
||||
# Remove S3 bucket.
|
||||
aws s3 rb --force s3://${bucket_name}
|
||||
|
||||
# get bucket logging
|
||||
# Get bucket logging.
|
||||
aws s3api get-bucket-logging --bucket ${bucket_name}
|
||||
|
||||
# AWS cloudformation list stacks
|
||||
# AWS cloudformation list stacks.
|
||||
aws cloudformation list-stacks \
|
||||
--stack-status-filter [ CREATE_COMPLETE | UPDATE_COMPLETE | etc.. ]
|
||||
|
||||
# other useful commands:
|
||||
# Follow the below link for some other useful commands.
|
||||
# https://github.com/toddm92/aws/wiki/AWS-CLI-Cheat-Sheet
|
||||
|
@ -1,9 +1,11 @@
|
||||
# Convert documents to PDF
|
||||
# libreoffice
|
||||
# Office productivity suite
|
||||
|
||||
# Convert documents to PDF.
|
||||
libreoffice --headless --convert-to pdf *.pptx
|
||||
|
||||
# Save them to a different directory?
|
||||
# Save PDFs to a different directory?
|
||||
libreoffice --headless --convert-to pdf *.docx --outdir ~/docs/
|
||||
|
||||
# Convert files nested inside folders?
|
||||
# This uses sharkdp/fd, you could use GNU find, xargs etc.
|
||||
# Convert files nested inside folders? Uses sharkdp/fd, IE: find(1) & xargs(1).
|
||||
fd -e doc -e docx -x libreoffice --headless --convert-to pdf --outdir {//} {}
|
||||
|
@ -1,10 +1,13 @@
|
||||
# Dump $url, do not show links urls
|
||||
lynx -dump -nolist $url
|
||||
# lynx
|
||||
# Classic non-graphical (CLI) web browser
|
||||
|
||||
# Use lynx to run repeating website actions
|
||||
# For creating your keystroke file, use:
|
||||
# lynx -cmd_log yourfile
|
||||
lynx -accept_all_cookies -cmd_script=/your/keystroke-file
|
||||
# Dump [URL]; do not show link URLs.
|
||||
lynx -dump -nolist [URL]
|
||||
|
||||
# convert html to text
|
||||
# Creating your keystroke file for use with lynx(1).
|
||||
lynx -cmd_log [FILE]
|
||||
# Use above keystroke file to run repeating website actions.
|
||||
lynx -accept_all_cookies -cmd_script=[FILE]
|
||||
|
||||
# Convert HTML from STDIN to text, then dump it to STDOUT.
|
||||
lynx -force_html -stdin -dump -nolist
|
||||
|
@ -1,80 +1,78 @@
|
||||
# Send a mail with a subject, cc, and an attachment
|
||||
# mutt
|
||||
# Text-based mailreader supporting MIME, GPG, PGP and threading
|
||||
|
||||
# Send E-Mail with subject, cc, and attachment.
|
||||
mutt -s "Site Backup" -a backup.tar -c user@example.com user2@example.com
|
||||
|
||||
# Send a mail with a blind carbon copy (bcc)
|
||||
# Send E-Mail with blind carbon copy (bcc).
|
||||
mutt -s "hello" -b user2@example.com user@example.com
|
||||
|
||||
#
|
||||
# Select (tag) messages: shift+t (T)
|
||||
#
|
||||
= (string)
|
||||
~ (expression)
|
||||
#
|
||||
~b expr (message with expr in body)
|
||||
[b]body
|
||||
[B]whole message
|
||||
[f]rom
|
||||
[c]c'ed
|
||||
[C]c'ed or to
|
||||
[h]eader
|
||||
#
|
||||
~m from-to (range)
|
||||
~d from-to (date range)
|
||||
#
|
||||
~N (new messages)
|
||||
~U (unread messages)
|
||||
~R (read messages)
|
||||
~A (all messages)
|
||||
~D (deleted messages)
|
||||
~p (message to you)
|
||||
~P (message from you)
|
||||
~= (duplicated messages)
|
||||
~$ (unref messages)
|
||||
# = (string)
|
||||
# ~ (expression)
|
||||
#
|
||||
# ~b expr (message with expr in body)
|
||||
# [b]body
|
||||
# [B]whole message
|
||||
# [f]rom
|
||||
# [c]c'ed
|
||||
# [C]c'ed or to
|
||||
# [h]eader
|
||||
#
|
||||
# ~m from-to (range)
|
||||
# ~d from-to (date range)
|
||||
#
|
||||
# ~N (new messages)
|
||||
# ~U (unread messages)
|
||||
# ~R (read messages)
|
||||
# ~A (all messages)
|
||||
# ~D (deleted messages)
|
||||
# ~p (message to you)
|
||||
# ~P (message from you)
|
||||
# ~= (duplicated messages)
|
||||
# ~$ (unref messages)
|
||||
#
|
||||
# Logical operators:
|
||||
#
|
||||
AND = ~P ~N (new messages from you)
|
||||
OR = ~P | ~N (new messages of messages from you)
|
||||
() = (~= ~$) | ~N
|
||||
#
|
||||
# AND = ~P ~N (new messages from you)
|
||||
# OR = ~P | ~N (new messages of messages from you)
|
||||
# () = (~= ~$) | ~N
|
||||
#
|
||||
# DATES
|
||||
#
|
||||
DD/MM/YY
|
||||
~d 20/1/95-31/10/95 (from 20/01/95 to 31/10/95)
|
||||
~d -31/10/95 (before 31/10/95)
|
||||
~d 20/1/95- (after 20/01/95)
|
||||
~d 20/1/95 (only 20/01/95)
|
||||
~d 20/1/95*2w (two weeks around 20/01/95)
|
||||
[w]eek
|
||||
[d]day
|
||||
[m]onth
|
||||
[y]ear
|
||||
can use *(around), +(after) or -(before)
|
||||
#
|
||||
~d <1m (messages newer than 1 month)
|
||||
~d >1y (messages older than 1 year)
|
||||
~d =1d (exact one day)
|
||||
# DD/MM/YY
|
||||
# ~d 20/1/95-31/10/95 (from 20/01/95 to 31/10/95)
|
||||
# ~d -31/10/95 (before 31/10/95)
|
||||
# ~d 20/1/95- (after 20/01/95)
|
||||
# ~d 20/1/95 (only 20/01/95)
|
||||
# ~d 20/1/95*2w (two weeks around 20/01/95)
|
||||
# ^
|
||||
# [w]eek
|
||||
# [d]day
|
||||
# [m]onth
|
||||
# [y]ear
|
||||
#
|
||||
# Can use `*(around)`, `+(after)` or `-(before)`.
|
||||
#
|
||||
# ~d <1m (messages newer than 1 month)
|
||||
# ~d >1y (messages older than 1 year)
|
||||
# ~d =1d (exact one day)
|
||||
|
||||
|
||||
#
|
||||
# Keys
|
||||
#
|
||||
shift+d (D) : delete messages using pattern
|
||||
shift+t (T) : select messages using pattern
|
||||
shift+u (U) : undelete messages using pattern
|
||||
ctrl+t : un-selected messages using pattern
|
||||
#
|
||||
#
|
||||
d : delete message
|
||||
N : mark as new
|
||||
C : copy message to another folder(mailbox)
|
||||
o, O : change sort, reverse sort
|
||||
ctrl+ D, U : Deleted, Undelete a thread
|
||||
ctrl+R : mark current thread as read
|
||||
esc+t : select thread
|
||||
esc+ v, V : collapse thread, collapse all threads
|
||||
w,W : add, remove flags
|
||||
#
|
||||
T ~U ;WN ctrl+t .
|
||||
mark unread msgs, remove its new flag, unselect them
|
||||
# Keyboard shortcuts.
|
||||
#
|
||||
# shift+d (D) : Delete messages using pattern
|
||||
# shift+t (T) : Select messages using pattern
|
||||
# shift+u (U) : Un-delete messages using pattern
|
||||
# ctrl+t : de-selected messages using pattern
|
||||
# d : Delete message
|
||||
# N : Mark as new
|
||||
# C : Copy message to another folder(mailbox)
|
||||
# o, O : Change sort, reverse sort
|
||||
# ctrl+ D, U : Deleted, Undelete a thread
|
||||
# ctrl+R : Mark current thread as read
|
||||
# esc+t : Select thread
|
||||
# esc+ v, V : Collapse thread, collapse all threads
|
||||
# w,W : Add, remove flags
|
||||
# T ~U ;WN ctrl+t . : Mark unread msgs, remove its new flag, de-select them
|
||||
|
@ -1,7 +1,10 @@
|
||||
# Number lines given to `nl` via STDIN.
|
||||
# nl
|
||||
# Number lines of files
|
||||
|
||||
# Number lines given to nl(1) via STDIN.
|
||||
printf "Here\nis\nsome\nexample\ntext." | nl
|
||||
|
||||
# Number (all) lines given to `nl` via provided file(s).
|
||||
# Number (all) lines given to nl(1) via provided file(s).
|
||||
nl -b a /path/to/file
|
||||
# The above can also be achieved with `cat`, which is perhaps more portable:
|
||||
# The above can also be achieved with cat(1), which is perhaps more portable:
|
||||
cat -n /path/to/file
|
||||
|
@ -0,0 +1,4 @@
|
||||
# nodejs
|
||||
# Server-side JavaScript
|
||||
|
||||
# Duplicate sheet -- please refer instead to: cheat.sh/js
|
@ -1,14 +1,26 @@
|
||||
# Show keycodes used by Xorg
|
||||
# start xev and show only the relevant parts:
|
||||
xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
|
||||
# xev
|
||||
# Print contents of X events
|
||||
|
||||
# Alternative approach to show keycodes, with standard AWK formatting.
|
||||
# Start xev(1) and show only the relevant parts.
|
||||
xev | awk -F'[ )]+' '
|
||||
/^KeyPress/ {
|
||||
a[NR+2]
|
||||
}
|
||||
NR in a {
|
||||
printf "%-3s %s\n", $5, $8
|
||||
}
|
||||
'
|
||||
# Alternative approach to showing keycodes.
|
||||
#
|
||||
# Note that the use of `<(xev)` is process substitution, which is unavailable
|
||||
# in the Bourne Shell and its standard derivatives, nor is it available in Bash
|
||||
# with its own POSIX mode enabled.
|
||||
awk '
|
||||
/^KeyPress/ {
|
||||
A[NR+2]
|
||||
}
|
||||
NR in A {
|
||||
B=substr($7, 0, length($7) - 2)
|
||||
printf("%3d %s\n", $4, B)
|
||||
}
|
||||
/^KeyPress/ {
|
||||
A[NR+2]
|
||||
}
|
||||
NR in A {
|
||||
B=substr($7, 0, length($7) - 2)
|
||||
printf("%3d %s\n", $4, B)
|
||||
}
|
||||
' <(xev)
|
||||
|
@ -1,21 +1,20 @@
|
||||
# xsel
|
||||
#
|
||||
# X11 selection and clipboard manipulation tool.
|
||||
# Command-line tool to access X clipboard and selection buffers
|
||||
|
||||
# Use a command's output as input of the clip[b]oard (equivalent to Ctrl + C):
|
||||
# Read from STDIN and save it to the clipboard; as if `Ctrl + C`.
|
||||
echo 123 | xsel -ib
|
||||
|
||||
# Use the contents of a file as input of the clipboard:
|
||||
# A file's contents can also be provided to xsel(1x) via STDIN.
|
||||
cat file | xsel -ib
|
||||
|
||||
# Output the clipboard's contents into the terminal (equivalent to Ctrl + V):
|
||||
# Send the clipboard's contents to STDOUT; as if `Ctrl + V`.
|
||||
xsel -ob
|
||||
|
||||
# Output the clipboard's contents into a file:
|
||||
# The contents of the clipboard can be saved to a file(s). Note that the use of
|
||||
# `>` means that any existing file by the same name will be overwritten. Use
|
||||
# `>>` to instead append the data to that file.
|
||||
xsel -ob > file
|
||||
|
||||
# Clear the clipboard:
|
||||
# Clear the clipboard.
|
||||
xsel -cb
|
||||
|
||||
# Output the X11 primary selection's contents into the terminal (equivalent to a mouse middle-click):
|
||||
# Send X11 primary selection to STDOUT, as if clicking mouse's middle button.
|
||||
xsel -op
|
||||
|
Loading…
Reference in New Issue