Hot answers tagged

9

LVM is not overkill if you have 17 partitions. (IMHO) As for the partition limit, it just happens to be the default. Probably no one expected that many partitions on a device that used to have only a few megs. /usr/src/linux/Documentation/devices.txt: 179 block MMC block devices 0 = /dev/mmcblk0 First SD/MMC card ...


8

Apply the changes directly to a running process if you have prlimit installed (comes with util-linux-2.21) prlimit --pid <pid> --<limit>=<soft>:<hard> for example prlimit --pid 12345 --nofile=1024:2048 Refer here


6

The timeout command will do this for you, i.e. timeout 10s command It will kill command after 10 seconds. Instead of s for seconds, you can also use m for minutes, h for hours or d for days.


5

You would not necessarily see error messages in your systems log, when chromium is overstepping some limits. Try starting chromium from a terminal (rather than clicking on icon), so that you can see any potential error messages in the terminal. What you are describing seems to be similar to this bugreport. The solution should be to increase the limits ...


5

I'm not sure if this is the one-and-done solution, but it worked for me. I had to create my "LVM" with striping options. lvcreate -L 217T -i2 -I64 -n lv_share VolGroup See 4.4.2. Creating Striped Volumes. Then I had to mount it with the -o inode64 option, as Mark mentioned. See 8.2. Mounting an XFS File System.


4

nice / renice nice is a great tool for 'one off' tweaks to a system. nice COMMAND cpulimit cpulimit if you need to run a CPU intensive job and having free CPU time is essential for the responsiveness of a system. cpulimit -l 50 COMMAND cgroups cgroups apply limits to a set of processes, rather than to just one cgcreate -g cpu:/cpulimited cgset -r ...


4

Probably a limit of the terminal device line discipline internal line editor buffer. You should be able to enter long lines by pressing Ctrl+D in the middle of it (so the currently entered part be sent to cat and the line editor flushed), or by disabling that line editor altogether. For instance, if using zsh: STTY=-icanon cat > file Note that then ...


3

I assume you're not describing your real-world scenario: not only do you want to copy hundreds of thousands of files, but you want to sleep for hundreds of thousands of seconds... wtf?!? Anyway: while IFS= read -r file1 IFS= read -r file2 do cp "$file1" "${file1##*/}-backup" cp "$file2" "${file2##*/}-backup" sleep 1 done < inputFile


3

You could use pv: </mnt/nfs/image.img pv -L 5m >/dev/sda The -L flag limits the throughput to 5 megabytes per second. pv also writes to the stdout so you have to redirect to the target with >.


2

Spicificly for setrlimit Here are some of the more usefull command options that you may wish to look into; pulled'em from the man pages. RLIMIT_NOFILE Specifies a value one greater than the maximum file descriptor number that can be opened by this process. RLIMIT_NPROC The maximum number of processes (or, more precisely on Linux, threads) that can ...


2

Open files limit is per process. An user can have multiple processes that total FD count can be greater than open files limit. From setrlimit(3) man page: RLIMIT_NOFILE Specifies a value one greater than the maximum file descriptor number that can be opened by this process. Attempts (open(2), pipe(2), dup(2), etc.) to exceed this limit yield ...


1

The groups defined with the @group syntax in the limits.conf file can match groups defined in any group database back-end, i.e. files (/etc/group), nis, ldap, and whatever else nsswitch.conf might support. Assigning a group to an ldap user entry is not done by locating his/her entry somewhere in the hierarchy (like under ou=student in your question) but by ...


1

Logrotate has the rotate parameter that specifies how many logs to save.


1

Sorry: I have not noticed the "txt file" with the "hundreds thousands of lines". This is just a naif solution... for a in test*; do ls -l $a; if [[ $((i++ % 2)) != 0 ]]; then sleep 1; fi; done Update: Explanation and (partially update to txt file with filenames). ...reformating: for a in `cat file.txt` do cp "$a" "$a-backup" ## REPLACE ...


1

Split urls into one file per host. Then run 'parallel -j5' on each file. Or sort urls and insert a delimiter '\0' when a new host is met, then split on '\0' and remove '\0' while passing that as a block to a new instance of parallel: sort urls.txt | perl -pe '(not m://$last:) and print "\0";m://([^/]+): and $last=$1' | parallel -j10 --pipe --rrs -N1 ...


1

ulimit is trying to increase the the maximum usage of those resources above that configured for the entire system by sysctl. Furthermore it's not actually possible to configure Linux with an unlimited number of some resources, such as open files. Note that unlimiting all resources is not a good idea -- do you really want a few gigabytes of core dump should ...


1

For a large or a considerable range of ip's my recommendation for you is use ipset If want to block an entire country ip block you can use the geoip module for iptables.


1

If you're using systemd, you can set some additional options in a .service file. The complete list of the options you can set is described here. Below is a short example that shows how to use this feature of systemd: # cat /etc/systemd/system/qbittorrent-nox.service [Unit] Description=qbittorrent-nox Documentation=man:qbittorrent-nox ...



Only top voted, non community-wiki answers of a minimum length are eligible