Really the sysfs and /proc filesystems are worlds of magic and fantasy. Each day I discover a new trick using this filesystems. So, I decided to post a short summary of my favorites ones. Enjoy and feel free to add your tricks in comments, maybe we can a /proc and /sys knownledge database in a post
1. Scanning for LUNs in attached FC
echo "- - -" > /sys/class/scsi_host/hostX/scan
2. CPU hotplug
echp 0 > /sys/devices/system/cpu/cpuX/online
Obviously when run echo 1, put the CPU online again
3. Enable dmesg timestamp
echo Y > /sys/modules/prinkt/parameters/time
4. Restore a removed file when is still in use
cat /proc/pid/fd/descriptor number > /tmp/myfile_restored
5. Get the IO operations for a process:
cat /proc/pid/io
The syscr and the syscw are the accumulated read and write IO operations that process do where running.
6. Increase size of IO scheduler queue:
echo 10000 > /sys/block/device/queue/nr_request
7. Get the current IO scheduler enabed to a specific device:
cat /sys/block/device/queue/scheduler
8. Get the threads of pdflush process which are running:
cat /proc/sys/vm/nr_pdflush_threads
9. Set the percentage threshold for memory to start to flushd data to disk:
echo XX > /proc/sys/vm/dirty_background_ratio
10. Set the sleep time for pdflush checking (in centisecs):
echo XXX > /proc/sys/vm/dirty_writeback_centisecs
11. Set the time to live for a data in buffer, when raises, data will commit to disk (in centisecs):
echo XXX > /proc/sys/vm/dirty_expire_centisecs
hario 1:58 am on 15 May 2008 Permalink |
OMG! The configuration file is a good reason not to use pkgcore… yet
I took a quick look at Pkgcore recently, but for now Paludis is doing a good job for me, so I will stick with it at least until a saner configuration syntax is added to Pkgcore – and no, the Portage compatibility is not enough for me, hehe.
Donnie Berkholz 8:45 am on 17 May 2008 Permalink |
I don’t even use pkgcore.conf, just the existing make.conf from portage.
ajdiaz 4:22 pm on 17 May 2008 Permalink |
Wel, I want to manage my repositories using pkgcore directly, without layman (only for testing
) and I think that need pkgcore.conf to do it.
Am i right to do so?
Brian Harring 4:34 am on 6 December 2008 Permalink |
The ini format you used is pretty damn low level- frankly there isn’t any reason to drop down to that level unless you actually need to do something fairly crazy.
Even then, you can intermix formats easily enough- in other words you could do an ini override of make.conf for example.
Either way, ini is not the intended format for majority of users- it’s pretty much the intended format for if you need to do something fairly hanky (remote configuration, complex cache setups, etc).