Last active
February 13, 2025 11:42
-
-
Save acosonic/17c75d8a110dab17cf126e35860c6015 to your computer and use it in GitHub Desktop.
Ubuntu decrapifier
This file contains hidden or 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 | |
#this script is intended to decrapify your Ubuntu, stuff like turn off unattended upgrades... | |
echo 'some of this should be done as root' | |
echo 'creating pubip' | |
# Ensure the directory exists | |
mkdir -p /root/scripts | |
# Write the script content to the file | |
cat << 'EOF' > /root/scripts/pubip.sh | |
#!/bin/bash | |
dig +short myip.opendns.com @resolver1.opendns.com | |
EOF | |
# Make the script executable | |
chmod +x /root/scripts/pubip.sh | |
# Create a symbolic link | |
ln -sf /root/scripts/pubip.sh /usr/bin/pubip | |
echo 'Fix keyboard shortcuts' | |
gsettings set org.gnome.desktop.input-sources xkb-options [] #remove left ctrl shift | |
gsettings set org.gnome.mutter overlay-key 'Super_L' | |
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ new-tab '<Control><Shift>t' | |
echo 'Reduce high gnome-shell CPU usage, this as user setting: also try wayland...' | |
gsettings set org.gnome.desktop.interface clock-show-seconds false | |
echo 'making alias scl for systemctl' | |
ln -s /usr/bin/systemctl /usr/bin/scl | |
echo 'turning off unattended upgrades' | |
sudo sed -i 's/"1"/"0"/g' /etc/apt/apt.conf.d/20auto-upgrades | |
apt remove update-notifier | |
echo 'Increasing swap size to 8GB' | |
swapoff -a | |
dd if=/dev/zero of=/swapfile bs=1G count=8 | |
chmod 0600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
echo 'Fixing chrome not ignoring SSL errors' | |
sed -i 's/google-chrome-stable/google-chrome-stable --ignore-cerfiticate-errors/g' /usr/share/applications/google-chrome.desktop | |
echo 'Unlimited bash console history' | |
#https://stackoverflow.com/questions/9457233/unlimited-bash-history | |
echo 'stopping your eyes from bleeding by changing default Midnight Commander theme' | |
wget -P $HOME/.local/share/mc/skins/ https://raw.githubusercontent.com/wang95/mc-skins/master/skins/yadt256.ini | |
sed -i 's/skin=.*/skin=yadt256/g' $HOME/.config/mc/ini | |
echo 'Increse the number of damn open files so Chrome doesn't crash on Password manager...' | |
echo 'DefaultLimitNOFILE=65535' >> /etc/systemd/user.conf | |
sh -c 'sysctl fs.inotify.max_user_watches=524288 && sysctl -p' | |
echo 'To make sudo work without password use this' | |
echo 'echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER' | |
echo 'making damn scrollbars wider' | |
cat << 'EOF' | tee ~/.config/gtk-3.0/gtk.css | |
/* Adding the buttons on the edges (if you don't need them, skip the next 4 lines) | |
*/ | |
.scrollbar { | |
-GtkScrollbar-has-backward-stepper: 1; | |
-GtkScrollbar-has-forward-stepper: 1; | |
} | |
/* Scrollbar trough squeezes when cursor hovers over it. Disabling that | |
*/ | |
.scrollbar.vertical:hover:dir(ltr), | |
.scrollbar.vertical.dragging:dir(ltr) { | |
margin-left: 0px; | |
} | |
.scrollbar.vertical:hover:dir(rtl), | |
.scrollbar.vertical.dragging:dir(rtl) { | |
margin-right: 0px; | |
} | |
.scrollbar.horizontal:hover, | |
.scrollbar.horizontal.dragging, | |
.scrollbar.horizontal.slider:hover, | |
.scrollbar.horizontal.slider.dragging { | |
margin-top: 0px; | |
} | |
/* Slider widens to fill the scrollbar when cursor hovers over it. Making it permanent | |
*/ | |
.scrollbar.slider.vertical:dir(ltr):not(:hover):not(.dragging) { | |
margin-left: 0px; | |
} | |
.scrollbar.slider.vertical:dir(rtl):not(:hover):not(.dragging) { | |
margin-right: 0px; | |
} | |
.scrollbar.slider.horizontal:not(:hover):not(.dragging) { | |
margin-top: 0px; | |
} | |
.scrollbar { | |
-GtkRange-slider-width: 10; | |
} | |
.scrollbar.vertical slider, | |
scrollbar.vertical slider { | |
min-height: 150px; | |
min-width: 30px; | |
} | |
.scrollbar.horizontal.slider, | |
scrollbar.horizontal slider { | |
min-width: 30px; | |
min-height: 10px; | |
} | |
.scrollbar.vertical.slider:hover, | |
scrollbar.vertical:hover slider { | |
min-width: 30px; | |
} | |
.scrollbar.horizontal.slider:hover, | |
scrollbar.horizontal:hover slider { | |
min-height: 10px; | |
} | |
EOF | |
echo "make ls list all files" | |
# Define the alias to be added | |
ALIAS='alias ls="ls -a"' | |
# Check if .bashrc exists | |
if [ ! -f ~/.bashrc ]; then | |
echo "Error: .bashrc file not found!" | |
exit 1 | |
fi | |
# Check if the alias is already in .bashrc | |
if grep -Fxq "$ALIAS" ~/.bashrc; then | |
echo "Alias already exists in .bashrc." | |
else | |
# Append the alias to .bashrc | |
echo "$ALIAS" >> ~/.bashrc | |
echo "Alias added to .bashrc." | |
fi | |
# Optionally, source the .bashrc to apply changes immediately | |
source ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment