mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-12-23 03:02:52 +01:00
bashrc & zshrc: add functions to set sysctl...
...how I want.
This commit is contained in:
parent
78695eb73c
commit
d4b917a3e9
30
bashrc
30
bashrc
@ -816,6 +816,36 @@ else
|
||||
#unset CXX
|
||||
fi
|
||||
|
||||
# Function to temporarily set sysctl options which I want and echo how to
|
||||
# set them permanently
|
||||
function sysctl-mikaela() {
|
||||
set -x
|
||||
sysctl kernel.core_pattern=%e-%p-%h.core
|
||||
sysctl vm.swappiness=1
|
||||
echo 'echo kernel.core_pattern = %e-%p-%h.core >> /etc/sysctl.conf'
|
||||
echo 'echo vm.swappiness = 1 >> /etc/sysctl.conf'
|
||||
set +x
|
||||
}
|
||||
|
||||
# Function to permanently set sysctl options which I want.
|
||||
function sysctl-mikaela-run() {
|
||||
set -x
|
||||
echo 'echo kernel.core_pattern = %e-%p-%h.core >> /etc/sysctl.conf'
|
||||
echo 'echo vm.swappiness = 1 >> /etc/sysctl.conf'
|
||||
sysctl -p
|
||||
set +x
|
||||
}
|
||||
|
||||
# Function to undo sysctl-mikaela
|
||||
function sysctl-undo-mikaela() {
|
||||
set -x
|
||||
sysctl kernel.core_pattern=core
|
||||
sysctl vm.swappiness=60
|
||||
echo 'echo kernel.core_pattern = %e-%p-%h.core >> /etc/sysctl.conf'
|
||||
echo 'echo vm.swappiness = 1 >> /etc/sysctl.conf'
|
||||
set +x
|
||||
}
|
||||
|
||||
# .custom
|
||||
if [ -f ~/.custom ]; then
|
||||
source ~/.custom
|
||||
|
30
zshrc
30
zshrc
@ -789,6 +789,36 @@ else
|
||||
#unset CXX
|
||||
fi
|
||||
|
||||
# Function to temporarily set sysctl options which I want and echo how to
|
||||
# set them permanently
|
||||
function sysctl-mikaela() {
|
||||
set -x
|
||||
sysctl kernel.core_pattern=%e-%p-%h.core
|
||||
sysctl vm.swappiness=1
|
||||
echo 'echo kernel.core_pattern = %e-%p-%h.core >> /etc/sysctl.conf'
|
||||
echo 'echo vm.swappiness = 1 >> /etc/sysctl.conf'
|
||||
set +x
|
||||
}
|
||||
|
||||
# Function to permanently set sysctl options which I want.
|
||||
function sysctl-mikaela-run() {
|
||||
set -x
|
||||
echo 'echo kernel.core_pattern = %e-%p-%h.core >> /etc/sysctl.conf'
|
||||
echo 'echo vm.swappiness = 1 >> /etc/sysctl.conf'
|
||||
sysctl -p
|
||||
set +x
|
||||
}
|
||||
|
||||
# Function to undo sysctl-mikaela
|
||||
function sysctl-undo-mikaela() {
|
||||
set -x
|
||||
sysctl kernel.core_pattern=core
|
||||
sysctl vm.swappiness=60
|
||||
echo 'echo kernel.core_pattern = %e-%p-%h.core >> /etc/sysctl.conf'
|
||||
echo 'echo vm.swappiness = 1 >> /etc/sysctl.conf'
|
||||
set +x
|
||||
}
|
||||
|
||||
|
||||
# Source files for miscannellious modifications.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user