From e9e6c8269714c0a16ec177a8b5bac19afbdcdc2f Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Tue, 11 Nov 2014 08:55:10 +0200 Subject: [PATCH] bashrc & zshrc: fix #48 --- bashrc | 21 +++------------------ zshrc | 21 +++------------------ 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/bashrc b/bashrc index b1936f8a..93017c38 100644 --- a/bashrc +++ b/bashrc @@ -811,18 +811,13 @@ if hash clang++ 2>/dev/null; then export CXX=clang++ fi -# Function to temporarily set sysctl options which I want and echo how to -# set them permanently +# Function to temporarily set sysctl options which I want function sysctl-mikaela() { set -x sysctl kernel.core_pattern=%e-%p-%h.core sysctl vm.swappiness=1 sysctl net.ipv6.conf.eth0.use_tempaddr=2 sysctl net.ipv6.conf.wlan0.use_tempaddr=2 - echo 'echo kernel.core_pattern = %e-%p-%h.core >> /etc/sysctl.conf' - echo 'echo vm.swappiness = 1 >> /etc/sysctl.conf' - echo 'sysctl net.ipv6.conf.eth0.use_tempaddr=2' - echo 'sysctl net.ipv6.conf.wlan0.use_tempaddr=2' echo 'If network-manager is used, see /etc/NetworkManager/system-connections/' set +x } @@ -832,23 +827,13 @@ function sysctl-mikaela-run() { set -x echo kernel.core_pattern = %e-%p-%h.core >> /etc/sysctl.conf echo vm.swappiness = 1 >> /etc/sysctl.conf - echo 'sysctl net.ipv6.conf.eth0.use_tempaddr=2' - echo 'sysctl net.ipv6.conf.wlan0.use_tempaddr=2' + echo sysctl net.ipv6.conf.eth0.use_tempaddr=2 >> /etc/sysctl.conf + echo sysctl net.ipv6.conf.wlan0.use_tempaddr=2 >> /etc/sysctl.conf sysctl -p echo 'If network-manager is used, see /etc/NetworkManager/system-connections/' 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 -} - # Add GitHub pull requests to fetched things via http://git.io/-C-0oQ github-add-pulls() { git config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*' diff --git a/zshrc b/zshrc index f066492f..89e5e530 100644 --- a/zshrc +++ b/zshrc @@ -789,18 +789,13 @@ if hash clang++ 2>/dev/null; then export CXX=clang++ fi -# Function to temporarily set sysctl options which I want and echo how to -# set them permanently +# Function to temporarily set sysctl options which I want function sysctl-mikaela() { set -x sysctl kernel.core_pattern=%e-%p-%h.core sysctl vm.swappiness=1 sysctl net.ipv6.conf.eth0.use_tempaddr=2 sysctl net.ipv6.conf.wlan0.use_tempaddr=2 - echo 'echo kernel.core_pattern = %e-%p-%h.core >> /etc/sysctl.conf' - echo 'echo vm.swappiness = 1 >> /etc/sysctl.conf' - echo 'sysctl net.ipv6.conf.eth0.use_tempaddr=2' - echo 'sysctl net.ipv6.conf.wlan0.use_tempaddr=2' echo 'If network-manager is used, see /etc/NetworkManager/system-connections/' set +x } @@ -810,23 +805,13 @@ function sysctl-mikaela-run() { set -x echo kernel.core_pattern = %e-%p-%h.core >> /etc/sysctl.conf echo vm.swappiness = 1 >> /etc/sysctl.conf - echo 'sysctl net.ipv6.conf.eth0.use_tempaddr=2' - echo 'sysctl net.ipv6.conf.wlan0.use_tempaddr=2' + echo sysctl net.ipv6.conf.eth0.use_tempaddr=2 >> /etc/sysctl.conf + echo sysctl net.ipv6.conf.wlan0.use_tempaddr=2 >> /etc/sysctl.conf echo 'If network-manager is used, see /etc/NetworkManager/system-connections/' 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 -} - # Add GitHub pull requests to fetched things via http://git.io/-C-0oQ github-add-pulls() { git config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*'