14 November 2022
26 January 2022
How to break all lines into 78 character long all at once in vim?
(Author: Sherman Chen)
Method 1
========
:set textwidth=78
gggqG
"gg" takes you to the first line, "gq" is the format operator and "G" the motion that jumps to the last line.
Method 2
========
:set textwidth=78
:1,$g/.*/normal jgwap
Method 3
========
1. :set linebreak
to recover those broken words at the end of each line into whole words.
2. :set textwidth=78
3. Find a line which is longer than 78 characters, say line #3. Move the cursor to that line minus one, i.e. 3 - 1 = 2.
4. qaj$aa Backspace Escape q
5. See how many lines the file contains totally, say, 100.
6. gg
7. 100@a Enter
All the lines will become 78 character long now.
Method 4 (which has improved Method 3)
========
1. :set linebreak
to recover those broken words at the end of each line into whole words.
2. :set textwidth=78
3. Move the cursor to any line which is longer than 78 characters.
4. qa$aa Backspace Escape q
5. :%normal @a
All the lines will become 78 character long now.
(END)
22 February 2017
Restrict SFTP (SSH) users to home folder
Subsystem sftp internal-sftp
# This section must be placed at the very end of sshd_config
Match Group sftponly
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
$ groupadd sftponly
$ usermod steve -g sftponly
$ usermod steve -s /bin/false
$ usermod steve -d /folder
$ service ssh restart
Write failed: Broken pipe Couldn't read packet: Connection reset by peer
25 October 2012
How to check size limit of an email message size and size limit of an email box storage in Exchange Server?
Organization Configuration | Hub Transport | Global Settings | Transport Settings. Right-click Transport Settings. Select Properties.
2. Size limit of an email box storage.
Organization Configuration | Mailbox | Database Management | Mailbox Database. Right-click Mailbox Database. Select Properties | Limits.
30 May 2012
How to limit a group of users and let them be ONLY able to send to and receive from another group of users?
Hi,
We can configure transport rule to restrict send messages.
Apply rule to messages
from a member of team1@xxx.com
Delete the message without notifying anyone
except when the message is sent to member of team2@xxx.com /except when any of the recipients in the To field is a member ofteam2@xxx.com.
We can use Message Delivery Restriction settings to restrict to receive messages.
1. Right click on team1@xxx.com and properties.
2. Navigate to "Message Delivery Restriction".
3. Select only senders in the following list.
4. Add team2@xxx.com to the list.
Regards,
Xiu