commit cdc90f83e716ff3ceb61fbb547e88eae478f90c6 Author: Andrew Schott Date: Sat Apr 15 10:05:08 2023 -0500 First upload! diff --git a/README.md b/README.md new file mode 100644 index 0000000..dafdd51 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# scripts + +Schotty's personal scripts. Feel free to use, but expect to modify some/all of them to work for you \ No newline at end of file diff --git a/akmod-rebuild-all.sh b/akmod-rebuild-all.sh new file mode 100755 index 0000000..d608002 --- /dev/null +++ b/akmod-rebuild-all.sh @@ -0,0 +1,6 @@ +#!/bin/bash +echo "Building modules for all installed kernels." +for kernel in /usr/src/kernels/*; do + kernel=$(basename $kernel) + /usr/sbin/akmods --force --kernels $kernel +done diff --git a/asus laptop/bar_key_fix.sh b/asus laptop/bar_key_fix.sh new file mode 100755 index 0000000..306ec56 --- /dev/null +++ b/asus laptop/bar_key_fix.sh @@ -0,0 +1,2 @@ +#!/bin/bash +xmodmap -e "keycode 94 = backslash bar" diff --git a/cert-expiry.sh b/cert-expiry.sh new file mode 100755 index 0000000..7fdd5df --- /dev/null +++ b/cert-expiry.sh @@ -0,0 +1,43 @@ +#!/bin/bash +#: <<'END' +# RHEL/Fedora rigs +RHELHOSTS=("www.schotty.com" "matrix.schotty.com" "shadow.schotty.com") +for rhel in "${RHELHOSTS[@]}" + do + echo "╔═══════════════════════════════════════════════════════════════════════════════════════╗" + echo -e "║Host :" $rhel "\t\t\t\t\t\t\t║" + expiry=$( + echo $rhel | + xargs -n 1 bash -c ' \ + openssl s_client -connect $0:443 2> /dev/null | \ + openssl x509 -noout -enddate | \ + cut -d = -f 2 | \ + xargs -I {} echo {} $0 ') + expiry="${expiry:0:24}" + echo -e "║SSL Cert Expiry :" ${expiry} "\t\t\t\t\t\t║" + echo -e "║System Status :" `ssh $rhel "uptime | awk -F'[a-z]:' '{ print $2}'"` "\t║" + echo -e "║Updates :" `ssh $rhel "sudo yum -y list updates | wc -l"`\ + "\t\t\t\t\t\t\t\t\t║" + echo -e "╚═══════════════════════════════════════════════════════════════════════════════════════╝" + done +#END +# Debian based rigs +DEBIANHOSTS=("mx.andrewschott.com") +for debian in "${DEBIANHOSTS[@]}" + do + echo "╔═══════════════════════════════════════════════════════════════════════════════════════╗" + echo -e "║Host :" $debian "\t\t\t\t\t\t\t║" + expiry=$( + echo $debian | + xargs -n 1 bash -c ' \ + openssl s_client -connect $0:443 2> /dev/null | \ + openssl x509 -noout -enddate | \ + cut -d = -f 2 | \ + xargs -I {} echo {} $0 ') + expiry="${expiry:0:24}" + echo -e "║SSL Cert Expiry :" ${expiry} "\t\t\t\t\t\t║" + echo -e "║System Status :" `ssh $debian "uptime | awk -F'[a-z]:' '{ print $2}'"` "\t║" + echo -e "║Updates :" `ssh $debian "sudo apt update > /dev/null 2>&1;sudo apt-get -s upgrade | grep -P \"\\d\\K upgraded\" | cut -d \" \" -f1" `\ + "\t\t\t\t\t\t\t\t\t║" + echo -e "╚═══════════════════════════════════════════════════════════════════════════════════════╝" + done diff --git a/check-ssl-expiry.sh b/check-ssl-expiry.sh new file mode 100755 index 0000000..3f029a2 --- /dev/null +++ b/check-ssl-expiry.sh @@ -0,0 +1,8 @@ +#/bin/bash + +SERVERLIST=("shadow.schotty.com" "schotty.com" "gitlab.schotty.com" "mx.andrewschott.com") + +for i in ${SERVERLIST[*]}; do + echo | openssl s_client -servername $i -connect $i:443 2>/dev/null | openssl x509 -noout -subject -enddate + echo + done diff --git a/clockscript.sh b/clockscript.sh new file mode 100755 index 0000000..bca54ce --- /dev/null +++ b/clockscript.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +while sleep 1 +do + DATE=$(date) + tput bold + echo "${DATE} " + tput cuu 2 + tput sgr0 +done \ No newline at end of file diff --git a/cxg_backup.sh b/cxg_backup.sh new file mode 100755 index 0000000..3ae3966 --- /dev/null +++ b/cxg_backup.sh @@ -0,0 +1,42 @@ +#!/bin/bash +## +## Crossover Bottle Mass Backup Utility -- Bash edition. +## +## Written by Andrew Schott ( with help from bashscripts.org ) +## Send any questions to andrew@schotty.com + +## +## v1.1 -- Fixed paths for Crossover 11 +## v1.0 -- Initial release. +## + +## Set backup file directories. +CXOBACKUPDIR="$HOME/cxobackup/" + +## Set default CX bottle directories. +CXODIR="$HOME/.cxoffice" + +## Create backup directories if they do not exist. +[ -d "$CXOBACKUPDIR" ] || mkdir "$CXOBACKUPDIR" + +## Perform backup of .cxoffice +for bottle in $CXODIR/*/ +do +if [[ "$bottle" = "$CXODIR/desktopdata/" ]] + then echo Skipping $bottle as it is a CX directory/file + elif [[ "$bottle" = "$CXODIR/installers/" ]] + then echo Skipping $bottle as it is a CX directory/file + elif [[ "$bottle" = "$CXODIR/tie/" ]] + then echo Skipping $bottle as it is a CX directory/file + elif [[ "$bottle" = "$CXODIR/cxoffice.conf" ]] + then echo Skipping $bottle as it is a CX directory/file + elif [[ "$bottle" = "$CXODIR/usage.log" ]] + then echo Skipping $bottle as it is a CX directory/file + else { + echo Archiving $bottle + /opt/cxoffice/bin/cxbottle --bottle "$bottle" --tar "${bottle%/}.cxarchive" + mv "${bottle%/}.cxarchive" "$CXOBACKUPDIR" + echo Archival of $bottle completed and moved to $CXOBACKUPDIR + } +fi +done diff --git a/dkmsall_openrazer.sh b/dkmsall_openrazer.sh new file mode 100755 index 0000000..3357ae0 --- /dev/null +++ b/dkmsall_openrazer.sh @@ -0,0 +1,8 @@ +#!/bin/bash +MODULE=openrazer-driver +MODULE_VERSION=3.5.1 + +for KERNEL in [ls /lib/modules/] + do + dkms build openrazer-driver/$MODULE_VERSION -k $KERNEL + done diff --git a/git_updatewowrepos.sh b/git_updatewowrepos.sh new file mode 100755 index 0000000..e284a8f --- /dev/null +++ b/git_updatewowrepos.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +RETAIL="/home/andrew/Games/wine/blizzard_games/World of Warcraft/_retail_/Interface/AddOns" +CLASSIC="/home/andrew/Games/wine/blizzard_games/World of Warcraft/_classic_/Interface/AddOns" +CLASSIC_ERA="/home/andrew/Games/wine/blizzard_games/World of Warcraft/_classic_era_/Interface/AddOns" + +echo $RETAIL +echo $CLASSIC +echo $CLASSIC_ERA + +func_DONE () { + + tput cuu1 + tput cuf 40 + tput rev + tput smso + tput bold + #tput setb 42 + #tput setf 30 + echo "DONE" + tput sgr0 +} + +echo "Updating Retail addons git repo" +{ + cd "$RETAIL" + git add . + git commit -m "Updated addons." + git push +} &> /dev/null +func_DONE + +echo "Updating Classic addons git repo" +{ + cd "$CLASSIC" + git add . + git commit -m "Updated addons." + git push +} &> /dev/null +func_DONE + +echo "Updating Classic Era addons git repo" +{ + cd "$CLASSIC_ERA" + git add . + git commit -m "Updated addons." + git push +} &> /dev/null +func_DONE diff --git a/install-crossover.sh b/install-crossover.sh new file mode 100755 index 0000000..18707b5 --- /dev/null +++ b/install-crossover.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# Root check +clear > /dev/null +echo -e "Determining root ..." +[ `whoami` = root ] || { sudo "$0" "$@"; exit $?; } + +#Install Dependencies +echo -e "Installing Crossover package dependencies for 32 bit libraries." +yum -y install lshw pciutils redhat-lsb-core libv4l.i686 fontconfig.i686 libXcomposite.i686 libXinerama.i686 libgphoto2.i686 libxml2.i686 libxslt.i686 openldap.i686 sane-backends-libs.i686 mesa-dri-drivers.i686 isdn4k-utils.i686 gsm.i686 gstreamer-plugins-base.i686 lcms2.i686 mesa-libOSMesa.i686 libtiff.i686 gnutls.i686 > /dev/null + +#Install Symlinks for TIFF and Mesa support +echo -e "Installing symlinks for TIFF and MESA support." +ln -s /usr/lib/libtiff.so.5.2.0 /usr/lib/libtiff.so.4 > /dev/null +ln -s /usr/lib/libOSMesa.so.8.0.0 /usr/lib/libOSMesa.so.6 > /dev/null + +#Install CX +echo -e "Installing latest Crossover Linux RPM." +yum -y install http://crossover.codeweavers.com/redirect/crossover.rpm > /dev/null + +#Tell the user to install their respective video drivers +echo -e "Updating PCI ID database." +update-pciids > /dev/null + +#Retrieve display info +hw=`lshw -short -class Display` + +#Set display search patterns +nvidia="(NVIDIA|GeForce|Quadro)" +amd="(AMD|ATI|FireGL|Radeon)" +intel="(Intel|INTEL)" + +#Determine display manufacturer +nv_detected=`echo $hw | grep -ciE $nvidia` +amd_detected=`echo $hw | grep -ciE $amd` +intel_detected=`echo $hw | grep -ciE $intel` + +echo nv $nv_detected +echo amd $amd_detected +echo intel $intel_detected + +#Set OS search patterns +el="(RedHat|CentOS|Springdale|Scientific)" +fedora="(Fedora)" + +#Determine LSB OS and release +lsb_os=`lsb_release -i` +lsb_release=`lsb_release -r` +lsb_el6="(6|6.1|6.2|6.3|6.4|6.5|6.6)" +lsb_el7="(7|7.1)" + +#Determine OS and release +echo Determining OS and relase information +el_detected=`echo $lsb_os | grep -ciE $el` +el6_detected=`echo $lsb_release | grep -ciE $lsb_el6` +el7_detected=`echo $lsb_release | grep -ciE $lsb_el7` +fedora_detected=`echo $lsb_os | grep -ciE "$fedora"` + +#NVIDIA test +if [ $nv_detected == 1 ] + then + tput setaf 2 + echo -e "NVIDIA graphics card found" + tput sgr0 + echo -e "Determining OS..." + if [ $el_detected == 1 ] + then + echo -e "Enterprise Linux detected. Installing EPEL and ELRepo for drivers" + rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org > /dev/null + if [ $el6_detected == 1 ] + then + yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm > /dev/null + yum -y install http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm > /dev/null + fi + if [ $el7_detected == 1 ] + then + yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm > /dev/null + yum -y install http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm > /dev/null + fi + #Install nvidia-detect and install proper kmod, proper xorg bits, proper 32bit xorg bits and nuke off x11-glamor as it is incompatible with the nvidia driver. + yum -y install nvidia-detect > /dev/null + yum -y install `nvidia-detect` nvidia-x11-drv nvidia-x11-drv-32bit > /dev/null + echo -e "As part of the NVIDIA driver installation you must take care of glamorgl, in this case we are removing it. If you wish to keep it, and instead disable it, say NO to the install below." + read -p "Press Enter or Return to continue with the process and choose to remove the packages or not." "mainmenuinput" + yum remove xorg-x11-glamor + fi + + if [ $fedora_detected == 1 ] + then + echo -e "Fedora Linux detected. For driver installation process, please visit http://rpmfusion.org/Howto/nVidia for more information." + fi +fi + +#AMD test +if [ $amd_detected == 1 ] + then + tput setaf 1 + echo -e "AMD graphics card found.\n\nThis installer is not smart enough to know how to install drivers for your device." + echo -e "Anaconda and Xorg should be using the Radeon driver. If your card is supported in the Catalyst proprietary driver, you would be advised to look into that." + echo -e "\nFor EL Installs :" + echo -e "http://elrepo.org/tiki/kmod-fglrx or" + echo -e "http://elrepo.org/tiki/kmod-fglrx-legacy" + echo -e "for installation instructions." + echo -e "\nFedora is currently not supported at the time the script is written, and you are best served with the Radeon driver." + echo -e "Sorry for any inconvenience." + tput sgr0 +fi + +#Intel test +if [ $intel_detected == 1 ] + then + tput setaf 4 + echo 'Intel graphics card found. No drivers needed as of the time of writing of this script.' + tput sgr0 +fi diff --git a/kexec/kexec-latest.sh b/kexec/kexec-latest.sh new file mode 100755 index 0000000..7585a3c --- /dev/null +++ b/kexec/kexec-latest.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -x + +NEWEST_KERNEL_VERSION="$( + rpm --query --queryformat='%{VERSION}-%{RELEASE}.%{ARCH}\n' kernel \ + | sort --version-sort --reverse \ + | head --lines=1 +)" +kexec --load --append="`cat /proc/cmdline`" \ + --initrd="/boot/initramfs-$NEWEST_KERNEL_VERSION.img" \ + "/boot/vmlinuz-$NEWEST_KERNEL_VERSION" diff --git a/kexec/kexec-reboot.sh b/kexec/kexec-reboot.sh new file mode 100755 index 0000000..d528d21 --- /dev/null +++ b/kexec/kexec-reboot.sh @@ -0,0 +1,115 @@ +#!/bin/sh + +set -e +[ -n "$BASH" ] && set -o pipefail +set -u + +# defaults +wait=10 +detach_wait=3 + +usage() { + cat << EOF +Usage: kreboot [option ...] [kernel|boot-index] +Options are: + --wait, -w N wait N seconds before reboot (default $wait) + --nowait don't wait, reboot immediately + --detach Schedule reboot and return. Suitable to remote reboot. + --help, -h show this help message + --kargs, k additional kernel arguments + +Example: + $0 0 Boot kernel with index 0 +EOF + exit $1 +} + +uerr() { + echo "ERROR: $*" 2>&1 + echo + usage 1 +} + +# Check that all programs we need are available, exit if not +# (relying on 'set -e' and hash returning non-zero for errors) +hash grubby kexec systemctl + +# Process options and arguments +target='' +kargs='' +while test $# -gt 0; do + case $1 in + -w|--wait) + if [ "$#" -lt 2 ]; then + uerr "Option $1 requires an argument" + fi + wait=$2 + if ! printf "%f" $wait > /dev/null 2>&1; then + uerr "Option $1 argument not a number" + fi + shift + ;; + --nowait) + wait=0 + ;; + --detach) + detach=yes + ;; + --detach_wait) + if [ "$#" -lt 2 ]; then + uerr "Option $1 requires an argument" + fi + detach_wait=$2 + if ! printf "%f" $detach_wait > /dev/null 2>&1; then + uerr "Option $1 argument not a number" + fi + shift + ;; + -h|--help) + usage 0 + ;; + -k|--kargs) + kargs=$2 + shift + ;; + -*) + uerr "Unrecognized option: $1" + ;; + *) + if [ -n "$target" ]; then + uerr "Extra arguments: $*" + fi + target=$1 + ;; + esac + shift +done + +if [ -z "$target" ]; then + if ! target=$(grubby --default-kernel); then + # grubby prints error to stdout + echo "grubby: $target" 1>&2 + exit 1 + fi +fi + +if ! info=$(grubby --info=$target); then + # grubby prints error to stdout + echo "grubby: $info" 1>&2 + exit 1 +fi +eval $(echo "$info" | sed "s|^\(\S*\)=\([^'\"].*\)$|\1='\2'|") + +echo Booting $title... +if [ "$wait" -ne 0 ]; then + echo Press Ctrl-C within $wait seconds to cancel + sleep $wait +fi +kexec -l "$kernel" --initrd="$initrd" --command-line="root=$root $args $kargs" + +if [ -z "detach" ]; then + systemctl kexec +else + setsid bash -c "sleep $detach_wait; systemctl kexec" &>/dev/null < /dev/null & +fi +` diff --git a/kexec/kexec.py b/kexec/kexec.py new file mode 100644 index 0000000..925ab75 --- /dev/null +++ b/kexec/kexec.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# From http://code.activestate.com/recipes/491277-kexec-the-newest-linux-kernel/ +import sys +import os +import subprocess +import fnmatch +import rpm + +def newest_kernel_and_initrd(): + ts = rpm.TransactionSet() + p = max(ts.dbMatch('name', 'kernel')) + k = [ x for x in p['filenames'] + if fnmatch.fnmatch(x, '/boot/vmlinuz-*') ][0] + #The initrd is not owned by the kernel rpm but generated in the %post script + i = '/boot/initrd-%s.img' % k[len('/boot/vmlinuz-'):] + return (k, i) + +def kexec(kernel, initrd, cmdline=None): + if cmdline == None: + cmdline = file('/proc/cmdline').read()[:-1] # strip newline + r = subprocess.call(['/sbin/kexec', '-l', kernel, + '--initrd=%s' % initrd, + '--command-line=%s' % cmdline]) + if r != 0: + raise Exception('kexec returned %d' % r) + +def program_name(): + return os.path.basename(sys.argv[0]) + +def main(): + (k, i) = newest_kernel_and_initrd() + sys.stderr.write('%s: loading ("%s", "%s")\n' % (program_name(), k, i)) + kexec(k, i) + sys.stderr.write('%s: reboot to load new kernel\n' % program_name()) + +if __name__ == '__main__': + main() diff --git a/kexec/kexec.sh b/kexec/kexec.sh new file mode 100755 index 0000000..87ff6ac --- /dev/null +++ b/kexec/kexec.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Force root +[ `whoami` = root ] || { sudo "$0" "$@"; exit $?; } + +latestkernel=`ls -t /boot/vmlinuz-* | sed "s/\/boot\/vmlinuz-//g" | head -n1` +echo "kernel current: $(uname -r)" +echo "kernel target: ${latestkernel}" +echo "" +echo "Arming kexec..." +#kexec -l /boot/vmlinuz-${latestkernel} --initrd=/boot/initramfs-${latestkernel}.img --append="`cat /proc/cmdline`" +kexec -l /boot/vmlinuz-${latestkernel} --initrd=/boot/initramfs-${latestkernel}.img --reuse-cmdline +echo "" +read -p "Press [Enter] key to start new kernel..." +#systemctl start kexec.target +kexec -e diff --git a/oomox.sh b/oomox.sh new file mode 100755 index 0000000..f6c3446 --- /dev/null +++ b/oomox.sh @@ -0,0 +1 @@ +sh /home/andrew/workspace/git_repos/oomox/gui.sh diff --git a/osupdater.sh b/osupdater.sh new file mode 100755 index 0000000..8adab7a --- /dev/null +++ b/osupdater.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +# Universal updater by Andrew Schott andrew@schotty.com +# Will detect and update via various packaging formats for distros I currently use. + +# Globals +# edit as needed to set colors and soforth +# presuming echo thus tput is chosen here as default\ + +# tput text formatting +# bold=bold dim=dimmed +# rev=reverse bel=bell sound +# smul=underline on rmul=underline off +# setaf=foreground setab=background +# sgr0=clear +# +# Colors +# 0 Black 1 Red 2 Green 3 Yellow +# 4 Blue 5 Magenta 6 Cyan 7 White +# +# Default is +# * green for a true finding +# * yellow for a false finding +# * clear at the end to resume normal output for said command's output + +CMD_NOTIFY="tput rev bold setaf 7 setab 0" +CMD_TRUE="tput rev bold setaf 2 setab 0" +CMD_FALSE="tput rev bold setaf 1 setab 7" +CMD_CLEAR="tput sgr0" + +echo $($CMD_NOTIFY)"Looking for native package managers"$($CMD_CLEAR) + +# apt -- Debian and derivatives +if `which apt &> /dev/null 2>&1` +then + echo $($CMD_TRUE)"Found apt. Updating: ($(which apt))"$($CMD_CLEAR) + sudo apt udate -y + sudo apt upgrade -y +else + echo $($CMD_FALSE)"apt not found/needed"$($CMD_CLEAR) +fi + +# dnf -- RHEL 8+, Fedora, Openmandriva, and derivatives +if `which dnf &> /dev/null 2>&1` +then + echo $($CMD_TRUE)"Found dnf. Updating: ($(which dnf))"$($CMD_CLEAR) + sudo dnf --refresh --skip-broken --nobest -y update +else + echo $($CMD_FALSE)"dnf not found/needed"$($CMD_CLEAR) +fi + +# pacman -- arch & arch derivatives +if `which pacman &> /dev/null 2>&1` +then + echo $($CMD_TRUE)"Found pacman. Updating: ($(which pacman))"$($CMD_CLEAR) + sudo pacman -Syu +else + echo $($CMD_FALSE)"pacman not found/needed"$($CMD_CLEAR) +fi + +# yum -- RHEL 7 > (Ignored if dnf is present) +if `which yum &> /dev/null 2>&1` && ! `which dnf &> /dev/null 2>&1` +then + echo $($CMD_TRUE)"Found yum. Updating: ($(which yum))"$($CMD_CLEAR) + sudo yum --refresh --skip-broken --nobest -y update +else + echo $($CMD_FALSE)"yum not found/needed"$($CMD_CLEAR) +fi + +# urpmi -- Mageia +if `which urpmi &> /dev/null 2>&1` && ! `which dnf &> /dev/null 2>&1` +then + echo $($CMD_TRUE)"Found urpmi. Updating: ($(which urpmi))"$($CMD_CLEAR) + sudo urpmi --auto-update -y +else + echo $($CMD_FALSE)"urpmi not found/needed"$($CMD_CLEAR) +fi + +# zypper -- SuSE products +if `which zypper &> /dev/null 2>&1` +then + echo $($CMD_TRUE)"Found zypper. Updating: ($(which zypper))"$($CMD_CLEAR) + sudo zypper in -y +else + echo $($CMD_FALSE)"zypper not found/needed"$($CMD_CLEAR) +fi + +echo $($CMD_NOTIFY)"Looking for sandboxed package managers"$($CMD_CLEAR) + +# flatpak +if `which flatpak &> /dev/null 2>&1` +then + echo $($CMD_TRUE)"Found flatpak. Updating: ($(which flatpak))"$($CMD_CLEAR) + flatpak update --user -y + sudo flatpak update -y +else + echo $($CMD_FALSE)"flatpak not found/needed"$($CMD_CLEAR) +fi + +# snap +if `which snap &> /dev/null 2>&1` +then + echo $($CMD_TRUE)"Found snap. Updating: ($(which snap))"$($CMD_CLEAR) + sudo snap refresh -y +else + echo $($CMD_FALSE)"snap not found/needed"$($CMD_CLEAR) +fi diff --git a/red hat specific/initial-setup.sh b/red hat specific/initial-setup.sh new file mode 100755 index 0000000..e952044 --- /dev/null +++ b/red hat specific/initial-setup.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# written by Andrew Schott +# Credits -- fedorafaq.org fedoraforums.org fedoraproject.org redhat.com google.com + +rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm + +yum -y install yum-plugin* + +yum -y install java-1.6.0-openjdk-plugin flash-plugin nspluginwrapper.x86_64} pulseaudio-libs.i386 alsa-plugins-pulseaudio.i386 libcurl.i386 mozplugger evince totem-mozplugin ntfs-3g libdvdcss libdvdnav totem-xine xine-lib-extras-freeworld totem-backend xine gstreamer-plugins-ugly audacious-plugins-freeworld-mp3 alsa-plugins-pulseaudio control-center-extra ntfs-config ccsm emerald-themes compizconfig-backend-gconf fusion-icon-gtk emerald compiz-fusion compiz-fusion-gnome libcompizconfig compiz-gnome compiz-bcop compiz compizconfig-python compiz-fusion-extras compiz-fusion-extras-gnome system-config* openoffice.org-core openoffice.org-{base,impress,writer,calc} + +mozilla-plugin-config -i -g -v + +yum -y install wget + +rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm +yum -y install flash-plugin.i386 diff --git a/red hat specific/install-depot-multisystem.sh b/red hat specific/install-depot-multisystem.sh new file mode 100755 index 0000000..4c3c5f4 --- /dev/null +++ b/red hat specific/install-depot-multisystem.sh @@ -0,0 +1,176 @@ +#! /bin/bash +#exec >& >(tee -a /tmp/debog-install-depot-multisystem.txt) + +# │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ +# │ install-depot-multisystem.sh │ +# │ écrit par François Fabre │ +# │ MultiSystem LiveUSB │ +# │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ + +#Mr Fabre François @frafa +#E-Mail: liveusb@gmail.com En Français SVP ! +#http://liveusb.info/ + +#License: GNU General Public License (GPL) +#Ce programme est un logiciel libre: vous pouvez le redistribuer +#et/ou le modifier selon les termes de la "GNU General Public +#License", tels que publiés par la "Free Software Foundation"; soit +#la version 2 de cette licence ou (à votre choix) toute version +#ultérieure. +# +#Ce programme est distribué dans l'espoir qu'il sera utile, mais +#SANS AUCUNE GARANTIE, ni explicite ni implicite; sans même les +#garanties de commercialisation ou d'adaptation dans un but spécifique. +# +#Se référer à la "GNU General Public License" pour plus de détails. +# +#Vous devriez avoir reçu une copie de la "GNU General Public License" +#en même temps que ce programme; sinon, écrivez a la "Free Software +#Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA". +#http://www.gnu.org/licenses/gpl-howto.fr.html + +#Sous Kde en boot livecd Activer depôt universe et installer zenity +if [ "$(sudo -A cat grep '^%admin ALL=(ALL) NOPASSWD: ALL' /etc/sudoers 2>/dev/null)" ]; then +echo +if [ "$(which software-properties-kde)" ]; then +sudo software-properties-kde --enable-component universe +if [ ! "$(which zenity)" ]; then +xterm -title 'Install zenity' -e "sudo apt-get update && sudo apt-get install -q -y zenity" +fi +fi +fi + +#quelques test... +errorlist=() +testlist="apt-get sudo lsb_release tee zenity nohup xterm dpkg" +for i in ${testlist} +do +if [ ! "$(which "$i")" ]; then +errorlist=(${errorlist[@]} $i) +fi +done +#Stop si +if [ "$(echo "${errorlist[@]}")" ]; then +echo -e "\033[1;47;31m Error: ${errorlist[@]} \033[0m" +miseenforme="${errorlist[@]}" +zenity --error --text "Error: ${miseenforme}" 2>/dev/null +exit 0 +fi + +#si pas sudo! +if [ ! "$SUDO_USER" ]; then +msg1="L'installation de multisystem necessite les droits d'administrateur." +msg2="Installing multisystem requires administrator rights." +if [ "$(echo $LANG | grep -i "fr_FR.utf")" ]; then +zenity --info --text "${msg1}" +else +zenity --info --text "${msg2}" +fi +xterm -e "sudo "$0"" +exit 0 +fi + +#chmod 777 /media +if [ "$(stat -c %a /media)" != "777" ]; then +chmod 777 /media +fi + +#Rajouter test si deja installé sortie! +if [ "$(dpkg -l | grep 'ii multisystem')" ]; then +msg1="multisystem est déjà installé!" +msg2="multisystem is already installed!" +if [ "$(echo $LANG | grep -i "fr_FR.utf")" ]; then +zenity --info --text "${msg1}" +else +zenity --info --text "${msg2}" +fi +exit 0 +fi + +#verifier que user appartiens au group disk +if [ ! "$(grep ^disk /etc/group | grep "$SUDO_USER")" ]; then +usermod -a -G disk "$SUDO_USER" +fi + +#verifier que user appartiens au group adm +if [ ! "$(grep ^adm /etc/group | grep "$SUDO_USER")" ]; then +usermod -a -G adm "$SUDO_USER" +fi + +#Activer depôt universe +if [ "$(which software-properties-gtk)" ]; then +#Sous Gnome +software-properties-gtk -e universe +elif [ "$(which software-properties-kde)" ]; then +#Sous Kde +software-properties-kde --enable-component universe +fi + +#Pour Ubuntu hardy il faut activer en + le depot hardy-backport +if [ "$(lsb_release -cs)" == "hardy" ]; then +echo +#Sous Gnome +if [ "$(which software-properties-gtk)" ]; then +software-properties-gtk -e hardy-backport +#Sous Kde +elif [ "$(which software-properties-kde)" ]; then +software-properties-kde --enable-component hardy-backport +fi +fi + +#Ajouter le depôt +if [ ! "$(grep '^deb http://liveusb.info/multisystem' /etc/apt/sources.list 2>/dev/null)" ]; then +vardeb="## Depôt MultiSystem\ndeb http://liveusb.info/multisystem/depot all main" +echo -e "$vardeb" | tee -a "/etc/apt/sources.list" +fi + +#Ajouter clé publique pour apt +sudo -u "$SUDO_USER" wget -q http://liveusb.info/multisystem/depot/multisystem.asc -O- | apt-key add - + +#Recharger les sources +apt-get update + +#Installer le paquet multisystem +apt-get install -y --force-yes multisystem +apt-get -f install -y + +#Verifier que est bien installé +if [ ! "$(dpkg -l | grep 'ii multisystem')" ]; then +msg1="Une erreur est survenue" +msg2="An error occurred" +if [ "$(echo $LANG | grep -i "fr_FR.utf")" ]; then +zenity --error --text "${msg1}" +else +zenity --error --text "${msg2}" +fi +exit 0 +fi + +#Rendre executable fusermount pour bases Debian ! +chmod +x "/usr/bin/fusermount" 2>/dev/null +chmod +x "/bin/fusermount" 2>/dev/null + +#Modifs pour lmde! +if [ "$(stat -c "%a" $(which fusermount))" = "4754" ]; then +chmod 755 $(which fusermount) +fi +if [ "$(stat -c "%a" /media)" -lt "755" ]; then +chmod 755 /media +fi +if [ "$(stat -c "%G" "$HOME/.local")" = "root" ]; then +sudo chown $SUDO_USER:$SUDO_USER -R "$HOME"/.local +fi + +#message +msg1="Dorénavant pour lancer le script veuillez utiliser\nle Menu: /Applications/Accessoires/MultiSystem." +msg2="Now to start the script please use\nthe menu: / Applications/Accessoires/MultiSystem." +if [ "$(echo $LANG | grep -i "fr_FR.utf")" ]; then +zenity --info --text "${msg1}" +else +zenity --info --text "${msg2}" +fi + +#lancer gui +nohup sudo -u "$SUDO_USER" -i "/usr/local/share/multisystem/gui_multisystem.sh"& +sleep 1 +exit 0 diff --git a/red hat specific/pyyum-update b/red hat specific/pyyum-update new file mode 100755 index 0000000..5e2d5a7 --- /dev/null +++ b/red hat specific/pyyum-update @@ -0,0 +1,12 @@ +#!/bin/bash +# init +function pause(){ + read -p - +} +clear +echo Running Yum .... + +beesu yum update +echo -e '\E[5;32;47m'" Press any key to close window and return to program. " +pause + diff --git a/red hat specific/rpm cheat sheet.pdf b/red hat specific/rpm cheat sheet.pdf new file mode 100644 index 0000000..f605310 Binary files /dev/null and b/red hat specific/rpm cheat sheet.pdf differ diff --git a/red hat specific/rpmcheatsheet.html b/red hat specific/rpmcheatsheet.html new file mode 100644 index 0000000..eff6815 --- /dev/null +++ b/red hat specific/rpmcheatsheet.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/restartkde5.sh b/restartkde5.sh new file mode 100755 index 0000000..bb1f51c --- /dev/null +++ b/restartkde5.sh @@ -0,0 +1,2 @@ +#!/bin/bash +kquitapp5 plasmashell && kstart plasmashell diff --git a/weatherscript.sh b/weatherscript.sh new file mode 100755 index 0000000..1d479f4 --- /dev/null +++ b/weatherscript.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +while sleep 15m +do + clear + pwy +done