unbind C-b
### change default prefix to screen prefix C-a
set -g prefix C-a
set -g status-bg black
set -g status-fg white
set-window-option -g window-status-current-bg white
set-window-option -g window-status-current-fg black
set-window-option -g window-status-current-attr bold
set -g status-left '#[fg=colour80](#S) #(whoami) '
set -g status-justify centre
bind-key C-a last-window
bind-key C-c new-window
bind-key space next-window
bind-key bspace previous-window
bind a send-prefix
### set mouse on with prefix+m and off with prefix+M
bind m \
set -g mouse on \;\
display 'Mouse: ON'
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts
2019-01-09
tmux vs screen
I was a big fan of screen but against RHEL8 I have to move on tmux.
Is is ok, by my finger memory have been adjusting to screen configuration, so there is a .tmux.conf with screen binding.
2011-06-22
LINUX BASH
Set
| set -x | Display commands and their arguments as they are executed. +x turn off |
| set -v | Display shell input lines as they are read. +v turn off |
Params
| $? | error code |
| $# | a number of params |
| $@ | list params |
| $* | list params |
| $0 | script name |
| $1 | param nr 1 |
| $$ | process ID |
Keybindings
| S-M-$ | complete variable |
|---|---|
| S-< | first command in history |
| C-p | previous command in history |
| C-n | next command in history |
| S-> | last command in history |
| C-e | jump to EOL |
| C-a | jump to BOL |
| M-f | jump forward a word |
| M-b | jump back a world |
| C-u | delete from BOL to cursor |
| C-k | delete from cursor to EOL |
| M-d | delete word forward from cursor |
| C-w | delete word backward from cursor |
Variable manipulation
- (command1; command2;…) #command inside brackeds are lauched in subshell with new process id(childs)
subshell variables are recognized in subshell only
- ${var}
- ${#var} #a number of variable var characters
| command | output | desc |
|---|---|---|
| export var=(el1 el2 el3); echo ${var[1]} | val2 | the second element var variable, which is a list |
| export var=(el1 el2 el3); echo ${#var[1]} | 4 | a number of chars in the second element |
| export var=(el1 el2 el3); echo ${#var[@]} | 3 | list size |
| export var=12345; echo ${var:-text} | if var was set the output is var value, if not the output is text, var is not change | |
| export var=12345; echo ${var:=text} | if var was set the output is var value, if not the output is text, var is changed to text | |
| export var=12345; echo ${var:?text} | if var was set the output is var value, if not the output is text to the error output | |
| export var=12345; echo ${var:+text} | if var was set the output is text, var is not change | |
| export var=12345; echo ${var:1:3} | 234 | get second element (first is 0) and next 3 |
| export var=12345; echo ${var#12} | 345 | remove elements based on schema 12 from the begining |
| export var=12345; echo ${var%45} | 123 | remove elements based on schema 45 from the end |
| export var=12345; echo ${var/34/ab} | 12ab5 | substitute elements by pattern 34 to ab anywhere |
| export var=12345; echo ${var/#12/ab} | ab123 | substitute elements by pattern 12 to ab from the beggining |
| export var=12345; echo ${var/%45/ab} | 123ab | substitute elements by pattern 45 to ab from the end |
Array
- Array=(el01 el02 el03)
- element at the table is matched by [] symbol and by ${Array[0]}
- iteration: for i in ${Array[@]};do echo $i; done
Buildin variables and commands
| zmienna | desc |
|---|---|
| BASH_SUBSHELL | subshell nr |
| SECONDS | amount of time running script |
| FUNCNAME | fuction name |
| DIRSTACK | current dir |
| LINENO | currend row |
| : | true |
| PWD | current dir |
| CDPATH | cd command path |
| TMOUT | logout after [sec] of inactivity |
Debug
| bash -n [script] | set -n | check without run |
| bash -x [script] | set -x | debug |
Range variable
- function inherits variables from script
- script do not inherit variable from function
- script inherit variable from for loop
Function
- {} #anonymous function, variables from script
- in {} there is the block of code which output might be redirect to file {} > output.file,
block of code from {} is not placed in subshell like for ()
Test
[[
- less suprises, safer to use, but it is not portable, not POSIX only bash,
regexp matching, it is a keyword, not a program
- string comparision:
<, >, =, ==, !=
- integer comparison:
-lt, -le, -eq, -ge, -gt, -ne
- conditional evaluation:
&&, ||
- expression grouping:
(…)
[
- right side must be quote ex. if [ -z "$variable ], is sysnonym for test but
requires a final ], it is a program /usr/bin/[
- string comparision:
\<, \>, =, !=
- integer comparison:
-lt, -le, -eq, -ge, -gt, -ne
files
| -f file | true if file exists and is a regular file |
| -e file | true if file exists |
| -d file | true if file exists and is a directory |
strings
| -z string | true if the length of string is zero |
| -n string | true if the length of string is non-zero |
using
- [ c1 ] ||/&& [ c2 ]
- both alternatives are different ex:
c1 c2 and OK is run and FAIL is not run or OK is not run or FAIL is run
Getopts
| variable | description |
|---|---|
| OPTIND | Holds the index to the next argument to be processed. This is how getopts "remembers" its own status between invocations. Also usefull to shift the positional parameters after processing with getopts. OPTIND is initially set to 1, and needs to be re-set to 1 if you want to parse anything again with getopts |
| OPTARG | This variable is set to an argument for an option found by getopts, but if the option is unknown it contains the option flag. |
| OPTERR | (Values 0 or 1) Indicates if Bash should display error messages generated by the getopts builtin. The value is initialized to 1 on every shell startup - so be sure to always set it to 0 if you don't want to see annoying messages! |
- getopts OPTSTRING VARNAME [ARGS…]
OPTSTRING tells getopts which options to expect and where to expect arguments (see below) VARNAME tells getopts which shell-variable to use for option reporting ARGS tells getopts to parse these optional words instead of the positional parameters
- commands without any args - nothing happened? Right. getopts didn't see any valid or invalid options (letters preceeded by a dash),
so it wasn't triggered.
- commands without any flags - nothing happened? The very same case: getopts didn't see any valid or invalid options
(letters preceeded by a dash), so it wasn't triggered.
- invalid options don't stop the processing: If you want to stop the script, you have to do it yourself (exit in the right place)
- multiple identical options are possible: If you want to disallow these, you have to check manually (e.g. by setting a variable or so)
OPTSTRING
- When you want getopts to expect an argument for an option, just place a : (colon) after the proper option flag.
- If the very first character of the option-string is a : (colon), which normally would be nonsense
because there's no option letter preceeding it, getopts switches to the mode "silent error reporting".
In productive scripts, this is usually what you want (handle errors yourself and don't get disturbed by annoying messages).
ARGS
- The getopts utility parses the positional parameters of the current shell or function by default (which means it parses "$@").
You can give your own set of arguments to the utility to parse. Whenever additional arguments are given after the VARNAME parameter,
getopts doesn't try to parse the positional parameters, but these given words.
A call to getopts without these additional arguments is equivalent to explicitly calling it with "$@".
Calculate
- echo $((2+3))
Return status
- last command at function or script determe exit status, thisis bash return value
- exit status might be at range 0-255
Commands
| eval | change string from variable to command ex. i="ls"; eval $i |
| source | from command line run script, from script working as #include (same as dot-command) |
| exec | do not create fork but create new shell process, go out from script |
| true,false | return 0 as exit status of error |
| help [bash_command] | help for bash commands ex. help eval |
Output
ex 1: command > /dev/null 2>&1
- redirect standard output /dev/stdout to /dev/null
- redirect standard error /dev/stderr to device point at standard output /dev/stdout, so to /dev/null
Summarize: all output is redirect to /dev/null
ex 2: command 2>&1 > /dev/null
- redirect error output /dev/stderr to device point at standard output /dev/stdout
- redirect standard ouptut /dev/stdout to /dev/null but error output /dev/stderr
is still redirected to /dev/stdout
Summarize: /dev/stdout to /dev/null and /dev/stderror to previous /dev/stdout
Printf
- printf "%-30s%s" "hello" $VAR
Colors in directory
- dircolors -p ~/.dircolors
- eval `/usr/bin/dircolors -b ~/.dircolors`
- alias dir="dir –color"
- alias ls="ls –color"
color symbols
| desc | atrybut | |
|---|---|---|
| none | 00 | |
| bold | 01 | |
| underscore | 04 | |
| blink | 05 | |
| reverse | 07 | |
| concealed | 08 | |
| font kolor | background color | |
| black | 30 | 40 |
| red | 31 | 41 |
| green | 32 | 42 |
| yellow | 33 | 43 |
| blue | 34 | 44 |
| magenta | 35 | 45 |
| cyan | 36 | 46 |
| white | 37 | 47 |
Etykiety:
bash,
linux,
programming
2011-02-16
LINUX NETWORK
Turn off NetworkManager:
- chkconfig NetworkManager off
- systemclt disable NetworkManager.service
Setting gateway:
/etc/sysconfig/network
NETWORKING=yes HOSTNAME=[hostname] GATEWAY=[IP]
Bonding module:
/etc/modprobe.d/bond.conf
alias bond0 bonding options bond0 miimon=100 mode=1
Setting ordinary interfaces:
/etc/sysconfig/network-scripts/ifcfg-[dev_name]
DEVICE=[dev_name] BOOTPROTO=none HWADDR=AA:AA:AA:AA:AA:AA ONBOOT=yes MASTER=bond0 SLAVE=yes NM_CONTROLLED=no
Setting bond interfaces
/etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0 BOOTPROTO=none ONBOOT=yes IPADDR=[IP] NETMASK=[MASK] IPV6INIT=no NM_CONTROLLED=no
iwlist
- iwlist [interface] frequency
WIFI - wpa_supplicant
wpa_passphrase
- wpa_passphrase "[ssid]" "[passphrase]" #generating psk key which is used by wpa_supplicant.conf
wpa_supplicant.conf
/etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="leny"
#psk="[opentext_passphrase]"
psk=[psk_from_wpa_passphrase]
scan_ssid=1
proto=WPA2 #WPA RSN
priority=1
scan_ssid=1 #if ssid is hidden
#key_mgmt=WPA-EAP
#key_mgmt=WPA-PSK
}
lanunch wifi steps:
- ip link set [dev_name] up
- iw [dev_name] scan
- wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -Dwext -i[dev_name] -B #run as daemon (-B flag)
- dhclient [dev_name]
- ip addr show [dev_name]
- route add default gw [IP]
Etykiety:
bonding,
linux,
network,
wpa_supplicant
2010-12-21
LINUX INFO
Table of Contents
1 Commands
| n | next the same level |
| p | previous |
| ] | next deeper |
| [ | previous |
| t | top |
| d | directory |
| l | last |
| r | other way of last |
| L | history |
| m | menu |
| tab | positions in menu |
| f | reference |
| s | search |
| i | index |
| g | go to node |
| n | move to the "next" node of this node |
| p | move to the "previous" node of this node |
| m | pick menu item specified by name (or abbreviation), picking a menu item causes another node to be selected |
| d | go to the Info directory mode |
| < | go to the top node of this file |
| > | go to the final node in this file |
| [ | go backward one node, considering all nodes as forming one sequence |
| ] | go forward one node, considering all nodes as forming one sequence |
| tab | move cursor to next cross-reference or menu item |
| M-TAB | move cursor to previous cross-reference or menu item |
| f | follow a cross reference. Reads name of reference |
| l | move back in history to the last node you were at/td> |
| r | move forward in history to the node you returned from after using l |
| L | go to menu of visited nodes |
| T | go to table of contents of the current Info file |
2010-04-16
LINUX PASSWORD POLICY
Table of Contents
1 Password strength:
- check pam module pam_cracklib.so in /lib/security
- edit /etc/pam.d/system-auth
- password requisite pam_cracklib.so try_first_pass retry=3 minlen=8 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1
retry attempts to pick new password minlen min password length ucredit upper case -1 means at least 1 lcredit lower case ocredit special character dcredit digit
- password requisite pam_cracklib.so try_first_pass retry=3 minlen=8 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1
2 Password duration:
- For new accounts default settings are in /etc/login.defs
- Settings for current accounts are in /etc/shadow but we edit by command chage
2.1 chage
| chage -l [user] | check settings for user |
| chage -E "YYYY-MM-DD" [user] | set date when account expire, -1 means never |
| chage -M [nr] [user] | set maximum number of days between password change from last password change, -1 means never expire |
| chage -d "YYYY-MM-DD" [user] | set last password change |
| chage -W [nr] [user] | number of days of warning before password expires |
| chage -i [nr] [user] | set password inactive, when account is blocked after password expire |
3 Password repeat history:
- edit /etc/pam.d/system-auth
- password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=2
remember number of password in history file /etc/security/opasswd
- password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=2
4 Login attempts:
- check pam module pam_tally2.so in /lib/security
- edit /etc/pam.d/system-auth
- auth required pam_tally2.so deny=3 unlock_time=60 lock_time=5
deny number of attempts to log without deny unlock_time time in sec when next login attempt perform lock_time time in sec when delay every failed login attempt - all logs about login attempts are in /var/log/tallylog but we edit by command pam_tally2
- auth required pam_tally2.so deny=3 unlock_time=60 lock_time=5
4.1 pam_tally2
| pam_tally2 -u [user] | check failed login attempts |
| pam_tally2 -r -u [user] | reset failed login attempts |
Etykiety:
linux,
password,
password policy
2009-10-23
LINUX PACKAGES
Packages
| RPM | YUM | DPKG | DESCRIPTION |
|---|---|---|---|
| rpm -q –changelog [package] | changelog | ||
| rpm -U/-i –test [package].rpm | test before install | ||
| rpm -qa –last | head | installation time of last packages | ||
| rpm -ql [package] | dpkg -L [package] | file list installed by package | |
| rpm -qf [file] | yum provides [file] | dpkg -S [file] | package name which is owner of file |
| rpm -qi [package] | yum info [package] | dpkg -s [package] | info |
| rpm -q [package] | dpkg-query -W [package] | package version | |
| rpm -qa | yum list installed | dpkg –list | installed packages |
| yum list [package] | available packages in repository (about 15000), or package version in repo | ||
| rpm -q –whatrequires [package] | package needs | ||
| rpm -q –provides [package] | search missing libs, files | ||
| rpm -q –whatprovides libc.so.6 | yum list provides [shared_obj] | ||
| yum whatprovides "\*bin/[file]" | search in which package is file | ||
| yum whatprovides libpthread* | |||
| yum list extras | unoficial repo packages list | ||
| rpm -qR [pakiet] | yum deplist [pakiet] | dependency list | |
| yum check-update | update check | ||
| yum list updates | |||
| rpm -qp –scripts [package].rpm | scripts check | ||
| rpm -qlp [package].rpm | rpm content check | ||
| yum -C | using cache | ||
| yum search [string] | search by names, descriptions, summaries | ||
| yum list [string]\* | search by [string] | ||
| yum history | |||
| yum-complete-transaction | complete transaction after power crash etc. | ||
| yum-complete-transaction –cleanup-only | clean transaction without resume the aborted transactions | ||
| yum clean all | remove all traces of the version from /var/cache/yum | ||
| yum –releasever=[release_nr_to_sync] distro-sync | |||
| yum –rebuilddb | rebuild rpm database, recreate database index |
yum history
| yum history list | last 20 transactins |
| yum history list all | all transactions |
| yum history list [ID] | |
| yum history info [ID] | all info about transaction |
| yum history package-list [package_name] |
Action column
| D | Downgrade | At least one package has been downgraded to an older version. |
| E | Erase | At least one package has been removed. |
| I | Install | At least one new package has been installed. |
| O | Obsoleting | At least one package has been marked as obsolete. |
| R | Reinstall | At least one package has been reinstalled. |
| U | Update | At least one package has been updated to a newer version. |
Altered column
| < | Before the transaction finished, the rpmdb database was changed outside Yum. |
| > | After the transaction finished, the rpmdb database was changed outside Yum. |
| * | The transaction failed to finish. |
| # | The transaction finished successfully, but yum returned a non-zero exit code. |
| E | The transaction finished successfully, but an error or a warning was displayed. |
| P | The transaction finished successfully, but problems already existed in the rpmdb database. |
| s | The transaction finished successfully, but the –skip-broken command line option was used and certain packages were skipped. |
Misc
| rpmreaper | tool for removing packages and find dependencies |
|---|---|
| package-cleanup –orphans | unsupported packages |
| yumdownloader [package] | get rpm package |
| yumdownloader –source [package] | getsource package |
| rpm2cpio [package].rpm | cpio -idv | unpack rpm2cpio |
| rpm2cpio [package].rpm | cpio -t | what is inside rpm |
| yum grouplist | zainstalowane i dostepne grupy |
| yum groupinstall '[group]' | instalacja grupy |
| yum groupinfo '[group]' | |
| yum groupremove '[group]' | |
| yum –downloadonly update | download only |
| rpm –querytags | show all tags |
| rpm -qa –queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | |
| rpm -qa –queryformat "%{NAME}-%{VERSION}-%{RELEASE}\t%{INSTALLTIME:date}" | |
| rpm -qa –queryformat "%-40{NAME}%-20{VERSION}%-20{RELEASE}%{INSTALLTIME:date}\n" |
Remarks
- For RPM repos main database is located in /var/lib/rpm, it is BerkleyDB.
2009-08-13
LINUX LVM
Table of Contents
1 Create LVM partition
1.1 Create LVM partition:
- fdisk /dev/[disk]
- change partition type from LINUX to LVM
1.2 Initialize LVM partition:
- pvcreate /dev/[disk_partiton1] /dev/[disk_partition2]
-
verifycommands:
- pvs
- pvdisplay
1.3 Create LVM group:
- vgcreate [group_name] /dev/[disk_partition1] /dev/[disk_partition2]
-
verify commands:
- vgs
- vgdisplay
1.4 Create logical volumes which is attached to group:
- lvcreate -L[size]M -n [vol_name] [group_name]
-
verify commands:
- lvs
- lvdisplay
1.5 Volume format:
- mkfs.ext3 [lv_name_from_lvdisplay]
2 Snapshot
2.1 Desc
- Snapshot covers process of writing block to special area before writing to this block, so if you want to make changes to block at first you must copy this block to special area
- So it is neccesary to set volume snapshot size, and when it will be full the snapshot is broken
2.2 Steps
-
lvcreate -s -L[size]G -n [lv_snap] /dev/[vg_name]/[lv_2snap] -
dd if=/dev/[vg_name]/[lv_snap] of=[file_name].img-
The size of file is similar to "
lvdisplay /dev/[vg_name]/[lv_snap]" - If snapshot size is oversized the warning is "input/ouput error"
-
The size of file is similar to "
-
lvcreate -n [lv_new] -L[size_bigger_then_above] [vg_name]- It is possible to expand by resize2fs
-
dd if=[file_name].img of=/dev/[vg_name]/[lv_new] -
lvremove /dev/[vg_name]/[lv_snap]
3 Move data inside group
-
pvs -
pvmove /dev/sd... -
pvs
4 Remove disk from group
-
lvreduce [vg_name] /dev/sd...
5 Add disk to group
-
pvcreate /dev/sd... -
pvs -
vgextend [vg_name] /dev/sd...
6 Reduce volume size
-
umount... -
e2fsck -f /dev/[vg_name]/[lv_name] -
resize2fs /dev/[vg_name]/[lv_name] [nr]G -
lvreduce -L[nr]G /dev/[vg_name]/[lv_name] -
mount...
7 Extend volume size
-
lvextend /dev/[vg_name]/[lv_name] -
e2fsck -f /dev/[vg_name]/[lv_name] -
resize2fs /dev/[vg_name\/[lv_name]
8 Activate group
-
vgscan -
vgchange -ay
9 Extend partition
- fdisk
- d #remove partition
- n #make a new one with start section at the same point
2009-07-24
LINUX MUTT
Table of Contents
2 .muttrc
-
http://dev.mutt.org/trac/wiki/ConfigLits
CONFIGURATION DESCRIPTION set move=no dont ask about moving message to mbox set imap_user = imap username set imap_pass = imap password set folder = main folder like "imaps://[hostname]" set ssl_starttls = yes set smtp_url = url lik smtp://[hostname]:25/ set smtp_pass = "$imap_pass" set spoolfile = "+INBOX" set realname = name set from = name set record = folder for outgoing messages set copy = no copy outgoing messages to above folder set pager_stop = yes do not move to the next message during reading my_hdr From: <mail@domain> set header #my_hdr CC: <mail@domain> my_hdr Reply-to: <mail@domain> my_hdr User-Agent: Mutt set header_cache=~/.hcache set file for source headers source /[path]/[filename] split config for many files set date_format="%b-%d %H:%M:%S" set index_format="%-4C%-5Z%-17d%-30a%s" index format auto_view text/html bind index "q" noop bind index "x" exit save-hook '~s [title]' "$folder/[folder]" set filter for saving directory alias [alias] email@domain set alias recipients, during sending put TAB color header brightyellow default "^date:" header coloers color header brightred default "^from:" color header white default "^to:" color header white default "^cc:" color header brightyellow red "^subject:" color status white black
3 OS mode
| mutt -f imap://[IMAP_server]/inbox | logon to IMAP server |
4 Main mode (index)
| COMMAND | DESCRIPTION |
|---|---|
| source [config_file] | reload config |
| $ | run command, save mailbox, refresh |
| @ | show sender address |
| o | sort |
| enter | show message |
| d | mark to delete |
| D | mark to delete based on regexp |
| u | unmark delete |
| U | unmark delete based on regexp |
| r | reply |
| g | reply all |
| m | send |
| = | first message |
| k | previous message |
| f | next message |
| j | next message |
| * | last message |
| n | message nr [n] |
| C-g | clean command line |
| c | change directory, ? - directory list |
| s | save message |
| v | show attachement |
| w | set flag |
| W | unset flag |
| t | tag message |
| T | tag messag based on regexp |
4.1 index_format
- default: %4C %Z %{%b %d} %-15.15L (%4l) %s
- my: set index_format="%-5Z%-17d%-30a%s"
-
set date_format="%m-%d %H:%M:%S" #zgodne z strftime
%a address of the author %b filename of the original message folder (think mailBox) %B the list to which the letter was sent, or else the folder name (%b). %c number of characters (bytes) in the message %C current message number %d date and time of the message in the format specified by ``date_format'' converted to sender's time zone %D date and time of the message in the format specified by ``date_format'' converted to the local time zone %e current message number in thread %E number of messages in current thread %f entire From: line (address + real name) %F author name, or recipient name if the message is from you %i message-id of the current message %l number of lines in the message %L If an address in the To or CC header field matches an address defined by the users ``lists'' command, this displays "To <list-name>", otherwise the same as %F. %m total number of message in the mailbox %M number of hidden messages if the thread is collapsed. %N message score %n author's real name (or address if missing) %O (_O_riginal save folder) Where mutt would formerly have stashed the message: list name or recipient name if no list %s subject of the message %S status of the message (N/D/d/!/r/*) %t `to:' field (recipients) %T the appropriate character from the $to_chars string %u user (login) name of the author %v first name of the author, or the recipient if the message is from you %y `x-label:' field, if present %Y `x-label' field, if present, and (1) not at part of a thread tree, (2) at the top of a thread, or (3) `x-label' is different from preceding message's `x-label'. %Z message status flags
5 Message mode(pager)
| i | exit |
| [SPC] | next page |
| - | prev page |
| v | attach |
6 Flags
| FLAG | DESCRIPTION |
|---|---|
| D | mark to delete |
| N | new, not read |
| O | old, but not read |
| * | marked |
| P | PGP included |
| r | replied to |
| + | message only for you |
| T | message for you with CC field |
| C | you are at CC field |
| F | message from you |
| L | massage from subscribe list |
7 Tagging
| T | tag message based on regexp |
| ;(semi-colon) | apply operation form tagged messages |
| W | change flag |
8 Keybinding
-
edit muttrc ex.
bind index "q" noop #means not bind "q" key with index mode
9 Patterns for messages
| ~A | all messages |
| ~b EXPR | messages which contain EXPR in the message body |
| ~B EXPR | messages which contain EXPR in the whole message |
| ~c USER | messages carbon-copied to USER |
| ~C EXPR | message is either to: or cc: EXPR |
| ~D | deleted messages |
| ~d [MIN]-[MAX] | messages with ``date-sent'' in a Date range |
| ~E | expired messages |
| ~e EXPR | message which contains EXPR in the ``Sender'' field |
| ~F | flagged messages |
| ~f USER | messages originating from USER |
| ~g | PGP signed messages |
| ~G | PGP encrypted messages |
| ~h EXPR | messages which contain EXPR in the message header |
| ~k | message contains PGP key material |
| ~i ID | message which match ID in the ``Message-ID'' field |
| ~L EXPR | message is either originated or received by EXPR |
| ~l | message is addressed to a known mailing list |
| ~m [MIN]-[MAX] | message in the range MIN to MAX *) |
| ~n [MIN]-[MAX] | messages with a score in the range MIN to MAX *) |
| ~N | new messages |
| ~O | old messages |
| ~p | message is addressed to you (consults $alternates) |
| ~P | message is from you (consults $alternates) |
| ~Q | messages which have been replied to |
| ~R | read messages |
| ~r [MIN]-[MAX] | messages with ``date-received'' in a Date range |
| ~S | superseded messages |
| ~s SUBJECT | messages having SUBJECT in the ``Subject'' field. |
| ~T | tagged messages |
| ~t USER | messages addressed to USER |
| ~U | unread messages |
| ~v | message is part of a collapsed thread. |
| ~x EXPR | messages which contain EXPR in the `References' field |
| ~y EXPR | messages which contain EXPR in the `X-Label' field |
| ~z [MIN]-[MAX] | messages with a size in the range MIN to MAX *) |
| ~= | duplicated messages (see $duplicate_threads) |
10 Keybinding patterns
| \t | tab |
| <tab> | tab |
| \r | carriage return |
| \n | newline |
| \e | escape |
| <esc> | escape |
| <up> | up arrow |
| <down> | down arrow |
| <left> | left arrow |
| <right> | right arrow |
| <pageup> | Page Up |
| <pagedown> | Page Down |
| <backspace> | Backspace |
| <delete> | Delete |
| <insert> | Insert |
| <enter> | Enter |
| <return> | Return |
| <home> | Home |
| <end> | End |
| <space> | Space bar |
| <f1> | function key 1 |
| <f10> | function key 10 |
2009-06-03
LINUX VSFTPD
before run check module path in file /etc/pam.d/vsftpd
vsftpd.conf
vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
#xferlog_enable=YES #wlaczenie logowania
xferlog_std_format=NO
#xferlog_file=/var/log/vsftpd.log
vsftpd_log_file=/var/log/vsftpd.log
#log_ftp_protocol=YES
connect_from_port_20=YES
#idle_session_timeout=600
#data_connection_timeout=120
#nopriv_user=ftpsecure
ftpd_banner=Welcome to ftp server
chroot_local_user=YES
secure_chroot_dir=/usr/share/empty
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/vsftpd.chroot_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd.ftpusers
# for users that are denied.
pam_service_name=vsftpd
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd/vsftpd.user_list
#enable for standalone mode
listen=YES
tcp_wrappers=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
#xferlog_enable=YES #wlaczenie logowania
xferlog_std_format=NO
#xferlog_file=/var/log/vsftpd.log
vsftpd_log_file=/var/log/vsftpd.log
#log_ftp_protocol=YES
connect_from_port_20=YES
#idle_session_timeout=600
#data_connection_timeout=120
#nopriv_user=ftpsecure
ftpd_banner=Welcome to ftp server
chroot_local_user=YES
secure_chroot_dir=/usr/share/empty
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/vsftpd.chroot_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd.ftpusers
# for users that are denied.
pam_service_name=vsftpd
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd/vsftpd.user_list
#enable for standalone mode
listen=YES
tcp_wrappers=YES
2009-04-03
LINUX SCREEN
Table of Contents
1 OS commands
| screen -ls | session list |
| screen -r [session] | attach to active session |
| screen -x | attach multiply users to active session |
| screen -dmS [session] [app] | run app without start screen |
2 Screen Commands
| COMMAND | DESCRIPTION |
|---|---|
| C-a d | deatach |
| C-a " | window list |
| C-a w | window list |
| C-a :number [0-9] | change window nr |
| C-a A | change window name |
| C-a shift+n | show window nr |
| C-a c | new window |
| C-a k | kill window |
| C-a [0-9] | go to window nr |
| C-a [SPC] | next window |
| C-a [BPC] | previous window |
| C-a C-a | last active window |
| C-a [ESC] | turn on mode scrollback/copy |
| [SPC] | start/stop buffer copy |
| C-a ] | paste from buffer |
| C-a ? | help |
| C-a : | command line |
3 .screenrc
startup_message off
deflogin off
defnonblock 5
termcapinfo xterm*|rxvt* 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
termcapinfo xterm*|rxvt* ti@:te@
#defbce "on"
vbell off
altscreen on
bindkey -k F1 prev
bindkey -k F2 next
bind ^v screen -t ROOT su -
hardstatus alwayslastline
hardstatus string '%{= KM}[ %{G}%H %{M}][%= %{c}%?%-Lw%?%{C}(%{C}%n*%f%t%{C})%{c}%?%+Lw%?%? %=%{M}][%{G} %c %{M}]'
defscrollback 1024
screen 0