Showing posts with label Limit. Show all posts
Showing posts with label Limit. Show all posts

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

https://bensmann.no/restrict-sftp-users-to-home-folder/

Here is a guide for setting up SFTP users who’s access is restricted to their home directory.
Add the following to the end of the /etc/ssh/sshd_config file:
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
This means that all users in the ‘sftponly’ group will be chroot’d to their home directory, where they only will be able to run internal SFTP processes.
Now you can create the group sftponly by running the following command:
$ groupadd sftponly
Set a user’s group:
$ usermod steve -g sftponly
To deny SSH shell access, run the following command:
$ usermod steve -s /bin/false
And set the user’s home directory:
$ usermod steve -d /folder
Finally, you probably need to restart SSH
$ service ssh restart
The SSH part should now be in order, but you should make sure that file permissions also are correct. If the chroot environment is in a user’s home directory both /home and /home/username MUST be owned by root and should have permissions along the lines of 755 or 750.
In other words, every folder leading up to and including the home folder must be owned by root, otherwise you will get the following error after logging in:
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?

1. Size limit of an email message.

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?

http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/7a12dd3a-ab9e-41a5-af42-6087be993559/

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