Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 [HOWTO], FAQ, Guides

views
     
kons
post Jun 20 2007, 09:16 AM

Конс
Group Icon
Moderator
6,142 posts

Joined: Oct 2004



Delete really lots of files

Sometimes rm command can't handle too many files.
Another neat way to do it is to try this:-

CODE
find . -name "*" -print | xargs rm


Replace * with the file names to match

It can be further tweaked to do recursive delete.


Added on June 25, 2007, 11:52 pmClear history of all typed command

CODE
history -c


This post has been edited by kons: Jun 25 2007, 11:52 PM
kons
post Jan 29 2008, 01:49 PM

Конс
Group Icon
Moderator
6,142 posts

Joined: Oct 2004



Linux clock runs too fast on VPC

http://support.microsoft.com/kb/918461

Set clock=pit to the kernel boot line in grub.conf


Added on February 18, 2008, 6:28 pmGenerate Artificial Load in Linux.

touch test; i=10; while ((i--)); do while [ -e test ]; do echo $RANDOM > /dev/null; done & done

i=x, where x is the load.
i=10 would generate load avg of 10
i=20 would generate load avg of 20

To stop, just rm -f test.


This post has been edited by kons: Oct 23 2008, 09:28 AM
kons
post Oct 23 2008, 09:28 AM

Конс
Group Icon
Moderator
6,142 posts

Joined: Oct 2004



Simulate DHCP request without changing the physical IP on the eth (Testing DHCP service only)

CODE
dhclient -1 -s 192.168.48.2 -cf /dev/null -pf /tmp/test.pid -sf /tmp/s eth1


-1 = do it one time
-s = dhcp server
-cf = config file
-pf = pid file
-sf = script file
eth1 = interface

If failed, returns exit code 2
kons
post Oct 24 2008, 04:35 PM

Конс
Group Icon
Moderator
6,142 posts

Joined: Oct 2004



Checking number of connection entries

One way to limit p2p is to install ip_conntrack modules and iptables connlimit modules.
connlimit module can block the number of connections that the end-user can get at one time, if you set it to 100, that means the end-users can only connect to 100 host at a time, which is fine for web surfing but for p2p, it is too restrictive.
connlimit will limit those ip_conntrack entries in ESTABLISHED state only.

To check the number of connections that an end-user has:

CODE
cat /proc/net/ip_conntrack|grep ESTABLISHED|cut -d '=' -f2|sort|uniq -c|sort -nr|head -n 20





 

Change to:
| Lo-Fi Version
0.0132sec    0.55    7 queries    GZIP Disabled
Time is now: 29th March 2024 - 03:39 PM