Created
January 7, 2012 02:12
-
-
Save CodeSturgeon/1573498 to your computer and use it in GitHub Desktop.
Admin Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo $HOSTNAME booting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOME=/root/admin_scripts/ | |
@reboot ~/boot_note.sh | |
@daily ~/gentoo/glsa_test.sh | |
@daily ~/gentoo/sync_and_download.sh | |
@weekly ~/gentoo/listworld_and_mirrorselect.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
/usr/bin/glsa-check -t all 2>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Shutdown fancy output from tools | |
TERM=plain | |
export TERM | |
# Make sure we using the best current mirrors | |
/usr/sbin/mirrorselect -q -s5 > /dev/null | |
# List all possible upgrade packages with detail | |
emerge -lpu --deep world | |
# FIXME read the news |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
df /home | tail -n 1 | awk '{if (($4/$2)*100 < 10) print "Space used on /home: " $5 " (" ($4/(1024^2)) " GiB free)" }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Sync portage | |
emerge --sync --quiet >/dev/null 2>&1 | |
# Download all the files I'm likely to need for updates | |
emerge -uDF --quiet world >/dev/null 2>&1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# WARNING: This is a work in progress... do not use | |
# requires genkernel and perhaps gentoolkit | |
# find most recent kernel name | |
KVERSION=`find /usr/src/ -maxdepth 1 -type d -name 'linux-*' | sort | tail -n 1` | |
# select most recent kernel | |
eselect kernel set $KVERSION | |
# install current running config | |
zcat /proc/config.gz > /usr/src/linux/.config | |
# compile and install most recent kernel | |
# no-clean : assume I want anything already compiled to be re-used | |
# menuconfig : just in case I want to change something or look it over | |
genkernel --menuconfig --bootloader=grub --install --no-clean --oldconfig --mountboot all | |
# update grub (or give instructions) if needed | |
# FIXME update for failback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment