Skip to content

Instantly share code, notes, and snippets.

@jrichardsz
Last active October 17, 2023 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrichardsz/0713d1c3859f883215336eee3fd698e1 to your computer and use it in GitHub Desktop.
Save jrichardsz/0713d1c3859f883215336eee3fd698e1 to your computer and use it in GitHub Desktop.
configure linux desktop with elementary

auto mount on boot

sudo blkid sudo nano /etc/fstab UUID= /mnt/ntfs ntfs defaults 0 2

enable bluetooth

https://superuser.com/a/1705855/881022

modify settings

default shell background

gsettings get io.elementary.terminal.settings  background

'rgba(46, 46, 46, 0.95)'

change shell background

gsettings set io.elementary.terminal.settings  background "rgba(37, 46, 50, 1.0)"

Add the following files to this location /usr/share/applications/ with *.desktop as extension

Example: /usr/share/applications/firefox.desktop

firefox

[Desktop Entry]
Encoding=UTF-8
Name=Mozilla Firefox
GenericName=Web Browser
Comment=Browse the Web
Exec=/foo/firefox/firefox
Icon=/foo/firefox/browser/chrome/icons/default/default128.png
Terminal=false
Type=Application
Categories=Application;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;
StartupNotify=True

eclipse

[Desktop Entry]
Comment=Eclipse
Terminal=false
Name=Eclipse
Exec=/home/jane/Apps/eclipse/eclipse
Icon=/home/jane/Apps/eclipse/icon.xpm
Type=Application

postman

[Desktop Entry]
Encoding=UTF-8
Name=Postman
GenericName=Postman
Comment=Postman
Exec=/home/jane/Apps/Postman/Postman
Icon=/home/jane/Apps/Postman/app/icons/icon_128x128.png
Terminal=false
Type=Application
Categories=Application;
StartupNotify=True

references

# bash backup_from_list.sh /from/list.txt /to
backup_list_location="$1"
backup_list_destiny="$2"
start_time=$SECONDS
while read folder; do
echo "$folder"
cp "$folder" "$backup_list_destiny" -r
done <"$backup_list_location"
elapsed=$(( SECONDS - start_time ))
eval "echo Elapsed time: $(date -ud "@$elapsed" +'$((%s/3600/24)) days %H hr %M min %S sec')"
cd /tmp
#############
# Install Atom
#############
curl -sL https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
sudo apt-get update
sudo apt-get install atom
#############
# Install Docker
#############
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
xenial \
stable"
sudo apt-get update
sudo apt-get install docker-ce
#############
# ssh agent
#############
ssh-keygen
# to github, bitbucket, gitlab, etc
cat $HOME/.ssh/id_rsa.pub
# fast start!
eval `ssh-agent` && ssh-add $HOME/.ssh/id_rsa
# or advanced start
# add to /etc/environment
# https://gist.github.com/jrichardsz/f407739fbfc91c6387b28f638500fb85
#!/bin/bash
now=$(date '+%Y-%m-%d_%H-%M-%S')
sudo cp /etc/apt/sources.list /etc/apt/sources-$now.orig
#############
# Utils
#############
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt-get install software-properties-common -y
#############
# ssh agent
#############
echo ""
echo ""
echo ""
echo ""
echo ""
ssh-keygen
cat $HOME/.ssh/id_rsa.pub
eval `ssh-agent` && ssh-add $HOME/.ssh/id_rsa
echo "#######"
echo "firefox"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6DCF7707EBC211F
sudo apt update
sudo apt install firefox -y
echo "#######"
echo "chrome"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o google-chrome-stable_current_amd64.deb
sudo apt-get install -y fonts-liberation
sudo dpkg -i google-chrome-stable_current_amd64.deb
echo "#######"
echo "node"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
echo "#######"
echo "docker"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --batch --yes --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo groupadd docker
sudo gpasswd -a $USER docker
newgrp docker
echo "#######"
echo "sublime"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sublimehq-archive.gpg
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
echo "#######"
echo "tmp workspace"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
sudo sed -i '1 i\mkdir -p /tmp/workspace' /etc/profile
echo "#######"
echo "flameshot"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt install flameshot -y
echo "#######"
echo "opera"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
curl https://download3.operacdn.com/pub/opera/desktop/89.0.4447.71/linux/opera-stable_89.0.4447.71_amd64.deb -o opera-stable.deb
sudo dpkg -i opera-stable.deb
echo "#######"
echo "gimp"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt install gimp -y
echo "#######"
echo "ffmpeg"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt install ffmpeg -y
echo "#######"
echo "simple screen recorder"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt-add-repository ppa:maarten-baert/simplescreenrecorder -y
sudo apt-get update
sudo apt-get install simplescreenrecorder -y
echo "#######"
echo "libre office"
echo "#######"
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt install libreoffice -y
#!/bin/bash
set -e
progress=$HOME/install_progress.txt
now=$(date '+%Y-%m-%d_%H-%M-%S')
if [ ! -f "$progress" ]; then
touch "$progress"
fi
install_list="init
ssh
install_firefox
install_chrome
install_node
install_docker
install_sublime
configure_tmp_workspace
install_flameshot
install_opera
install_gimp
install_ffmpeg
install_screen_recorder
install_libreoffice
install_vlc"
function init {
sudo cp /etc/apt/sources.list /etc/apt/sources-$now.orig
sudo apt-get update
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt-get install software-properties-common curl -y
echo "init" >> $progress
}
function ssh {
echo ""
echo ""
echo ""
echo ""
echo ""
ssh-keygen
cat $HOME/.ssh/id_rsa.pub
eval `ssh-agent` && ssh-add $HOME/.ssh/id_rsa
echo "ssh" >> $progress
}
function install_firefox {
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6DCF7707EBC211F
sudo apt update
sudo apt install firefox -y
echo "install_firefox" >> $progress
}
function install_chrome {
echo ""
echo ""
echo ""
echo ""
echo ""
curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o google-chrome-stable_current_amd64.deb
sudo apt-get install -y fonts-liberation
sudo dpkg -i google-chrome-stable_current_amd64.deb
echo "install_chrome" >> $progress
}
function install_node {
echo ""
echo ""
echo ""
echo ""
echo ""
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
echo "install_node" >> $progress
}
function install_docker {
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --batch --yes --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
ubuntu_dist_id=$(lsb_release -cs)
http_code_response_ubuntu_dist_id=$(curl -s -o /dev/null -w "%{http_code}" "https://download.docker.com/linux/ubuntu/dists/${ubuntu_dist_id}/stable/")
if [[ "$http_code_response_ubuntu_dist_id" == "200" ]]
then
echo "ubuntu dist id was found"
else
echo "ubuntu dist id was not found: $ubuntu_dist_id"
echo "default will be: bionic"
ubuntu_dist_id="bionic"
fi
echo "ubuntu_dist_id=$ubuntu_dist_id"
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$ubuntu_dist_id stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
{ # try
sudo groupadd docker
} || { # catch
echo "" # save log for exception
}
sudo gpasswd -a $USER docker
newgrp docker
echo "install_docker" >> $progress
}
function install_sublime {
echo ""
echo ""
echo ""
echo ""
echo ""
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sublimehq-archive.gpg
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
echo "install_sublime" >> $progress
}
function configure_tmp_workspace {
echo ""
echo ""
echo ""
echo ""
echo ""
sudo sed -i '1 i\mkdir -p /tmp/workspace' /etc/profile
echo "configure_tmp_workspace" >> $progress
}
function install_flameshot {
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt install flameshot -y
echo "install_flameshot" >> $progress
}
function install_opera {
echo ""
echo ""
echo ""
echo ""
echo ""
# get latet from here https://download3.operacdn.com/pub/opera/desktop/
curl https://download3.operacdn.com/pub/opera/desktop/89.0.4447.71/linux/opera-stable_89.0.4447.71_amd64.deb -o opera-stable.deb
sudo dpkg -i opera-stable.deb
echo "install_opera" >> $progress
}
function install_gimp {
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt install gimp -y
echo "install_gimp" >> $progress
}
function install_ffmpeg {
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt install ffmpeg -y
echo "install_ffmpeg" >> $progress
}
function install_screen_recorder {
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt-add-repository ppa:maarten-baert/simplescreenrecorder -y
sudo apt-get update
sudo apt-get install simplescreenrecorder -y
echo "install_screen_recorder" >> $progress
}
function install_libreoffice {
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt install libreoffice -y
echo "install_libreoffice" >> $progress
}
function install_vlc {
echo ""
echo ""
echo ""
echo ""
echo ""
sudo apt install vlc -y
echo "install_vlc" >> $progress
}
## script init
while IFS= read -r installer_name; do
echo "#######"
echo "$installer_name"
echo "#######"
if grep -q "$installer_name" "$progress"; then
echo " already installed"
else
$installer_name
fi
done <<< "$install_list"

docker rerepository notfound

Err:3 https://download.docker.com/linux/ubuntu jolnir Release

Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

fix

use this deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu bionic stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment