Compare commits

..

2 Commits

Author SHA1 Message Date
6ff322a929 fixed 2024-08-09 22:05:45 -07:00
955a9f10f3 added some new scripts 2024-08-09 15:11:07 -07:00
4 changed files with 103 additions and 11 deletions

View File

@@ -1,16 +1,13 @@
#/bin/bash #/bin/bash
#Zebra #Zeb H.
#Dell MD1200 Fan Silencing Script. #Dell MD1200 Fan Silencing Script.
#MD1200 must be connected to a serial port using a Dell Password Reset Cable.
#P/N CT109 0MN657
#set TTY Flags #set TTY Flags
stty -F /dev/ttyS1 38400 raw -echoe -echok -echoctl -echoke stty -F /dev/ttyS1 38400 raw -echoe -echok -echoctl -echoke
#Run 12 times, sleeping 5 seconds in between (total runtime: 1 min) #Run 12 times, sleeping 5 seconds in between (total runtime: 1 min)
#Comment the for loop out if you only want to run once. I set it to run for 1 min so I could crontab it.
for i in $(seq 1 12) for i in $(seq 1 12)
do do

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# #
# A fork of brezlord's fan control script. https://github.com/brezlord/iDRAC7_fan_control # https://github.com/brezlord/iDRAC7_fan_control
# A simple script to control fan speeds on Dell generation 12 PowerEdge servers. # A simple script to control fan speeds on Dell generation 12 PowerEdge servers.
# If the inlet temperature is above $TEMP_THRESHOLD C enable iDRAC dynamic control and exit program. # If the inlet temperature is above $TEMP_THRESHOLD C enable iDRAC dynamic control and exit program.
# If inlet temp is below $TEMP_THRESHOLD C set fan control to manual and set fan speed to predetermined value. # If inlet temp is below $TEMP_THRESHOLD C set fan control to manual and set fan speed to predetermined value.
@@ -9,8 +9,8 @@
# Variables # Variables
IDRAC_IP="" IDRAC_IP=""
IDRAC_USER="" IDRAC_USER="root"
IDRAC_PASSWORD="" IDRAC_PASSWORD="pass"
# Fan speed in % # Fan speed in %
SPEED0="0x00" SPEED0="0x00"
SPEED5="0x05" SPEED5="0x05"

View File

@@ -0,0 +1,97 @@
#!/bin/bash
#Zebra
#Linux Onboarding Oneshot script for izebra networks.
#Installs fish, starship, and sets up some shell tweaks that are nice to have.
#Check script is running as root
if [ "$EUID" -ne 0 ]
then echo "Please run as Root"
exit 1
fi
#define variables
fishconfig="https://git.izebra.net/izebra_projects/rmm-scripts/raw/branch/main/config-files/config.fish"
starshipconfig="https://git.izebra.net/izebra_projects/rmm-scripts/raw/branch/main/config-files/starship.toml"
#Add fish shell repo and install
echo Installing fish...
sudo apt-add-repository --yes ppa:fish-shell/release-3
sudo apt update
sudo apt install fish -y
#Copy fish config file to root and all users under /home/
echo Downloading Fish Config File. Storing in $HOME/.config/fish/config.fish
wget -O "$HOME/.config/fish/config.fish" $fishconfig
# Iterate over each user's home directory, including /root
for homedir in /root /home/*; do
if [ -d "$homedir" ]; then
# Ensure .config directory exists
echo Creating dir structure for $homedir
mkdir -p "$homedir/.config"
mkdir -p "$homedir/.config/fish"
# Copy starship.toml to the user's .config directory
echo copying fish config to $homedir/.config/fish/config.fish
cp -f "$HOME/.config/fish/config.fish" "$homedir/.config/fish/config.fish"
# Set ownership to the user of the home directory
echo Taking ownership of file under UID $homedir
chown -R $(basename "$homedir"):"$(id -gn $(basename "$homedir"))" "$homedir/.config/"
# Optional: Set permissions to 0644 (readable by owner and group, readable by others)
echo setting file perms
chmod 0644 "$homedir/.config/fish/config.fish"
fi
done
#install pyenv
curl https://pyenv.run | bash
#Download starship and copy config file to root and all users under /home/
echo Downloading starship installer to $HOME/starship.sh
wget -O $HOME/starship.sh https://starship.rs/install.sh
chmod +x $HOME/starship.sh
sh $HOME/starship.sh --force
rm $HOME/starship.sh
wget -O "$HOME/.config/starship.toml" $starshipconfig
# Iterate over each user's home directory, including /root
for homedir in /root /home/*; do
if [ -d "$homedir" ]; then
# Ensure .config directory exists
echo Creating directories for $homedir
mkdir -p "$homedir/.config"
# Copy starship.toml to the user's .config directory
echo Copying config file to $homedir/.config/starship.toml
cp -f "$HOME/.config/starship.toml" "$homedir/.config/starship.toml"
# Set ownership to the user of the home directory
echo Setting ownership for $homedir
chown -R $(basename "$homedir"):"$(id -gn $(basename "$homedir"))" "$homedir/.config"
# Optional: Set permissions to 0644 (readable by owner and group, readable by others)
chmod 0644 "$homedir/.config/starship.toml"
fi
done
#Change default shell to fish
echo Changing default shell to fish
# Minimum UID for regular user accounts (adjust as necessary)
MIN_UID=1000
# Loop through all users in /etc/passwd
while IFS=: read -r username _ uid _ _ homedir _; do
# Skip system accounts and users without a home directory
if [[ $uid -ge $MIN_UID && -d $homedir ]]; then
echo "Changing shell for user: $username"
sudo chsh -s /usr/bin/fish "$username"
if [ $? -ne 0 ]; then
echo "Failed to change shell for user: $username"
fi
else
echo "Skipping system account or user without home directory: $username"
fi
done < /etc/passwd
chsh -s /usr/bin/fish

View File

@@ -1,12 +1,10 @@
Conglomeration of PowerShell And Bash scripts to be used in tandem with an RMM<br /> Conglomeration of PowerShell scripts to be used in tandem with an RMM<br />
<!-- COPY ME <li></li> --> <!-- COPY ME <li></li> -->
<ul> <ul>
<li>activitystats.ps1 - Returns Activity Status of User in console (Run as User)</li> <li>activitystats.ps1 - Returns Activity Status of User in console (Run as User)</li>
<li>battery-status.ps1 - Returns Battery Status of Laptops in console</li> <li>battery-status.ps1 - Returns Battery Status of Laptops in console</li>
<li>das_fanctl.sh - Forces Dell MD1200 to be quiet.</li>
<li>disable-touchscreen.ps1 - Disables Touch screen devices</li> <li>disable-touchscreen.ps1 - Disables Touch screen devices</li>
<li>fan_control.sh - Custom fancurve script for a Dell 12th Gen server.</li>
<li>installExtension.ps1 - Force the installation of a chrome/edge/firefox extension</li> <li>installExtension.ps1 - Force the installation of a chrome/edge/firefox extension</li>
<li>installUblock.ps1 - Forces the installation of uBlock origin on Chrome and Edge.</li> <li>installUblock.ps1 - Forces the installation of uBlock origin on Chrome and Edge.</li>
<li>izebra-linux-oneshot.sh - Installs Fish and applies some shell tweaks that are useful</li> <li>izebra-linux-oneshot.sh - Installs Fish and applies some shell tweaks that are useful</li>