Skip to main content

finish script fedora 19


#!/bin/sh

PWD=`pwd`
DATE=`date +%Y%m%d`
ARCH=`uname -p`
RELEASE=`cat /etc/redhat-release | awk '{ print $3 }'`

# ******************************
# Add the admin Group and local Users - if not already there.
# Set passwd to "Passw0rd" with a Zero
# ******************************
if [ -d /home/jradtke ]
then
  echo "mv /home/jradtke /home/jradtke.${DATE} "
  mv /home/jradtke /home/jradtke.${DATE}
fi

getent group admin >/dev/null || groupadd -g 6969 admin
getent group jradtke >/dev/null || groupadd -g 2025 jradtke
getent passwd jradtke >/dev/null || useradd -g 2025 -u 2025 -G admin -s /bin/bash -c "James Radtke" -d /home/jradtke -p '<encr passwd here>' jradtke


# UPDATE THE SUDOERS FILE
cat << EOF >> /etc/sudoers

## ALIASES
Host_Alias      CRASHHOSTS = neo,neo.matrix.private,cypher
User_Alias      CRASHUSERS = jradtke
Cmnd_Alias      CRASHCMNDS = /usr/bin/systemctl restart ntpd.service, /bin/cat /etc/shadow
Cmnd_Alias      CRASHDOALL = ALL

## SUDO COMMANDS
CRASHUSERS ALL = NOPASSWD: /bin/su -
CRASHUSERS CRASHHOSTS = NOPASSWD: CRASHCMNDS, CRASHDOALL

# Added for local admins
%admin  ALL=(ALL)       NOPASSWD: ALL
EOF

# ******************************
# Update REPOs
# ******************************
yum -y install yum-plugin-fastestmirror

# INSTALL ALL THE GOOD STUFF (RPMFUSION)
# http://rpmfusion.org/Configuration/
# First, install the basic repo's
yum -y localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

# Second, install the release-specific repo's
yum -y localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${RELEASE}.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${RELEASE}.noarch.rpm

# Add Google stuff
wget https://dl-ssl.google.com/linux/linux_signing_key.pub
rpm --import linux_signing_key.pub

case $ARCH in
  i386)
    rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
# Google - i386
cat << EOF >> /etc/yum.repos.d/google-i386.repo
[google]
name=Google - i386
baseurl=http://dl.google.com/linux/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
EOF
  ;;
  x86_64)
    yum -y install http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
# Google - x86_64
cat << EOF > /etc/yum.repos.d/google-x86_64.repo
[google64]
name=Google - x86_64
baseurl=http://dl.google.com/linux/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
EOF
  ;;
  *)
    echo "ERROR: Unsupported Architecture: $ARCH"
  ;;
esac

# ******************************
# Install Packages
# ******************************
# Install "system-esque" type stuff
yum -y install sysfsutils iotop sysstat git intltool nmap autofs policycoreutils-gui gnome-rdp rdesktop tomboy openssh-askpass ntpd spice-gtk-python eclipse eclipse-pydev python-lxml spice-client spice-xpi wireshark wireshark-gnome

#yum -y install  virt-viewer virt-manager
yum -y install gcc kernel-headers kernel-devel
yum -y install google-chrome-stable
yum -y install flash-plugin

# Enable non-encrypted DVD
yum -y install libdvdread libdvdnav gstreamer-plugins-ugly gstreamer-plugins-bad lsdvd gstreamer-ffmpeg
#libdvdcss

# Audio Packages (Amarok rocks... Banshee is better)
#yum -y install banshee banshee-community-extensions banshee-devel
#yum -y install amarok
#yum -y install rhythmbox
yum -y install gnome-do-plugins-rhythmbox pidgin-rhythmbox rhythmbox-equalizer gstreamer gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly phonon-backend-gstreamer gstreamer1-libav gstreamer1-plugins-ugly gstreamer1-plugins-bad-freeworld


#yum -y install audacious audacious-plugins lame twolame libvorbis-devel
#yum -y install gpodder

# Video Players
yum -y install xine-lib xine-lib-extras-freeworld
yum -y install mplayer smplayer
# Video CODECS
yum -y install vlc

# Install Java
yum -y install java-*-openjdk icedtea-web libreoffice

# ******************************
# Update GRUB - This image should work for everyone.
#   I have a boot splash that I like to use
# ******************************
cp /etc/default/grub /etc/default/grub.orig
find /home/ -name splash-tree.tga -exec cp {} /boot/grub \;
case $RELEASE in
  18|19)
    echo "Fedora 18|19 grub updates go here mang..."
    echo "Update /boot/grub2/themes/system/theme.txt"
    echo "Run this: grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg"
    yum -y install grub2-starfield-theme-2.00-22.fc19.x86_64


cat << EOF >> /etc/default/grub
GRUB_GFXMODE=1600x900x16
GRUB_THEME="/boot/grub2/themes/system/theme.txt"
EOF
    sed -i -e '1i#grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg' /etc/default/grub
  ;;
  17)
cat << EOF >> /etc/default/grub
# Custom stuff
GRUB_DISABLE_RECOVERY="true"
GRUB_SAVEDEFAULT="true"
GRUB_GFXMODE=1600x900x16
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_BACKGROUND=/boot/grub2/Fedora_DJ.jpg
EOF

# Insert comments into the grub file so that I can remember how to create an updated GRUB
sed -i -e '1i# grub2-mkconfig -o /boot/grub2/grub.cfg' /etc/default/grub
sed -i -e '2i# grub2-mkfont --output=/boot/grub2/unicode.pf2 /usr/share/fonts/dejavu/DejaVuSansMono.ttf' /etc/default/grub
# create a new GRUB
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkfont --output=/boot/grub2/unicode.pf2 /usr/share/fonts/dejavu/DejaVuSansMono.ttf
  ;;
  *)
    echo "No grub update going to happen today"
  ;;
esac

mkdir -p /home/shared/Pictures/Wallpapers /home/shared/Pictures/Icons
chown -R jradtke:users /home/shared
yum -y install pidgin docky expect

# Install Packages for Conky (and conky-manager) and nixnote
yum -y install conky hddtemp lm_sensors p7zip p7zip-plugins openssl-static


# ******************************
# UPDATE THE ENTIRE MACHINE
# ******************************
yum clean all
yum -y update

# Jazz up Gnome 3 shell
yum -y update glibc audit
yum -y install gnome-shell-extension*

yum -y install ccsm gnome-tweak-tool gnome-common gnome-theme-curvylooks gnome-themes-legacy gnome-shell-theme-atolm gnome-shell-theme-elementary gnome-shell-theme-gaia gnome-shell-theme-orta gnome-shell-theme-smooth-inset gnome-shell-extension-alternative-status-menu.noarch gnome-shell-extension-systemMonitor.noarch gnome-shell-extension-user-theme verne-backgrounds-gnome gnome-shell-extension-weather gnome-shell-extension-calc gnome-shell-extension-auto-move-windows gnome-shell-extension-apps-menu verne-backgrounds-extras-gnome verne-backgrounds-gnome system-switch-displaymanager-gnome gnome-video-arcade gnome-shell-theme-* gnome-applet-sensors gnome-applets
yum -y install xscreensaver xscreensaver-extras-gss xscreensaver-gl-* gnome-screensaver


yum -y install plymouth-*
plymouth-set-default-theme spinfinity

# App for managing shortcuts
yum -y install alacarte
echo "run /usr/bin/gsettings set org.gnome.shell.clock show-date true"
echo "run /usr/bin/gsettings set org.gnome.shell.calendar show-weekdate true"

exit 0

Comments

Popular posts from this blog

P2V using dd for KVM-QEMU guest

Preface: I have certainly not exhaustively tested this process.  I had a specific need and found a specific solution that worked. Situation:  I was issued a shiny new laptop running Red Hat Enterprise Linux 7 (with Corp VPN, certs, Authentication configuration, etc...)  The image was great, but I needed more flexibility on my bare metal.  So, my goal was to P2V the corporate image so I could just run it as a VM. * Remove corporate drive and install new SSD * install corp drive in external USB-3 case * Install RHEL 7 on new SSD * dd old drive to a disk-image file in a temp location which will be an image which is the same size as your actual drive (unless you have enough space in your destination to contain a temp and converted image) * convert the raw disk-image to a qcow file while pushing it to the final location - this step should reduce the disk size - however, I believe it will only reduce/collapse zero-byte blocks (not just free space - i.e. if you de...

Extending SNMP to run arbitrary shell script

Why are we here... This is not likely something I would have pursued under normal circumstances.  I happen to be working for a customer/client who is not afforded a lot of flexibility to accomplish their goals.  In this case, the rigor is justified.  They have to sometimes be fairly creative with how they solve problems. In this case they would like to utilize an existing snmp implementation to execute a command (or shell script) on a remote system.  They came to me with the idea of using Net-SNMP extend. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sect-System_Monitoring_Tools-Net-SNMP-Extending.html NOTE:  This is NOT a good implementation strategy in the "real world"  it will simply allow you to test the functionality.  There are a TON of security implications which would need to be taken in to consideration. Implementation Steps: [root@rh7tst01 ~]# yum -y install net-snmp net-snmp-utils ...

RHN Satellite Server (spacewalk) repomd.xml not found

"repomd.xml not found" If you add a channel, or if your RHN cache gets corrupted, and one of your guests complains that it cannot find repomd.xml for jb-ews-2-x86_64-server-5-rpm (for example) - you need to rebuild your repodata cache. Normally this is an automated job - which is exemplified by the fact that you have obviously built out your entire Satellite environment and never had to do any of the steps you are about to do. So - some prep work: Open 3 terminals to your Satellite Server and run: # Term 1 cd /var/cache/rhn watch "ls -l | wc -l" # Term 2 pwd cd /var/log/rhn tail -f rhn_taskomatic_daemon.log # Term 3 satellite-sync --channel=jb-ews-2-x86_64-server-5-rpm Once the satellite-sync has completed, you >should< see the count increment by one.  If you are unlucky (like me) you will not. You then need to login to the Satellite WebUI as the satellite admin user. Click on the Admin tab (at the top) Task Schedules (on the left) fin...