Last active
March 30, 2025 04:21
-
-
Save TwistingTwists/f7a5e66a54c180a22b31edf574188d6a to your computer and use it in GitHub Desktop.
default setup for a new ubuntu machine
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
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="$HOME/.oh-my-zsh" | |
ZSH_THEME="powerlevel10k/powerlevel10k" | |
plugins=(git asdf git cp ubuntu zsh-fzf-history-search zsh-syntax-highlighting zsh-autosuggestions) | |
source $ZSH/oh-my-zsh.sh | |
. ~/.asdf/asdf.sh | |
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. | |
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh | |
fpath+=${ZDOTDIR:-~}/.zsh_functions | |
source ~/.aliases | |
# bun completions | |
[ -s "~/.bun/_bun" ] && source "~/.bun/_bun" | |
# bun | |
export BUN_INSTALL="$HOME/.bun" | |
export PATH="$BUN_INSTALL/bin:$PATH" |
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
wget https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce-rootless-extras_23.0.3-1~ubuntu.22.04~jammy_amd64.deb | |
wget https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-compose-plugin_2.6.0~ubuntu-jammy_amd64.deb | |
wget https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/containerd.io_1.6.9-1_amd64.deb | |
wget https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce-cli_23.0.3-1~ubuntu.22.04~jammy_amd64.deb | |
wget https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce_23.0.3-1~ubuntu.22.04~jammy_amd64.deb | |
sudo apt install ./docker-ce-rootless-extras_20.10.24~3-0~ubuntu-jammy_amd64.deb -y | |
sudo apt install ./containerd.io_1.6.9-1_amd64.deb -y | |
sudo apt install ./docker-ce-cli_23.0.3-1~ubuntu.22.04~jammy_amd64.deb -y | |
sudo apt install ./docker-ce_23.0.3-1~ubuntu.22.04~jammy_amd64.deb -y | |
sudo apt install ./docker-compose-plugin_2.6.0~ubuntu-jammy_amd64.deb -y |
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
# erlang specific dependencies | |
sudo apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python3-clang automake autoconf libncurses5-dev | |
# then move and install via asdf |
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
cd ./.git/hooks | |
ln -s -f ../../.hooks/pre-commit ./pre-commit | |
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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see https://i3wm.org/docs/userguide.html for a complete reference! | |
set $mod Mod1 | |
set $sup Mod4 | |
# Font for window titles. Will also be used by the bar unless a different font | |
# is used in the bar {} block below. | |
font pango: MesloLGS NF 10 | |
# This font is widely installed, provides lots of unicode glyphs, right-to-left | |
# text rendering and scalability on retina/hidpi displays (thanks to pango). | |
#font pango:DejaVu Sans Mono 8 | |
# Start XDG autostart .desktop files using dex. See also | |
# https://wiki.archlinux.org/index.php/XDG_Autostart | |
exec --no-startup-id dex --autostart --environment i3 | |
# The combination of xss-lock, nm-applet and pactl is a popular choice, so | |
# they are included here as an example. Modify as you see fit. | |
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the | |
# screen before suspend. Use loginctl lock-session to lock your screen. | |
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork | |
# NetworkManager is the most popular way to manage wireless networks on Linux, | |
# and nm-applet is a desktop environment-independent system tray GUI for it. | |
exec --no-startup-id nm-applet | |
# Use pactl to adjust volume in PulseAudio. | |
set $refresh_i3status killall -SIGUSR1 i3status | |
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status | |
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status | |
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status | |
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status | |
# brightness set using light in Ubuntu | |
bindsym XF86MonBrightnessUp exec --no-startup-id light -A 5 # increase screen brightness | |
bindsym XF86MonBrightnessDown exec --no-startup-id light -U 5 # decrease screen brightness | |
# key binding for lock screen | |
bindsym Control+Mod1+l exec "i3lock -c 000001" | |
# key binding for auto lock | |
exec "xautolock -detectsleep -time 25 -locker \"i3lock -c 000001\"" | |
# Use Mouse+$mod to drag floating windows to their wanted position | |
floating_modifier $mod | |
# start a terminal | |
bindsym $mod+Return exec i3-sensible-terminal | |
# kill focused window | |
bindsym $mod+Shift+q kill | |
# start dmenu (a program launcher) | |
# bindsym $mod+d exec --no-startup-id dmenu_run | |
bindsym $mod+d exec "rofi -modi drun,run -show drun" | |
# A more modern dmenu replacement is rofi: | |
# bindcode $mod+40 exec "rofi -modi drun,run -show drun" | |
# There also is i3-dmenu-desktop which only displays applications shipping a | |
# .desktop file. It is a wrapper around dmenu, so you need that installed. | |
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop | |
# change focus | |
bindsym $mod+j focus left | |
bindsym $mod+k focus down | |
bindsym $mod+l focus up | |
bindsym $mod+semicolon focus right | |
# alternatively, you can use the cursor keys: | |
bindsym $mod+Left focus left | |
bindsym $mod+Down focus down | |
bindsym $mod+Up focus up | |
bindsym $mod+Right focus right | |
# move focused window | |
bindsym $mod+Shift+j move left | |
bindsym $mod+Shift+k move down | |
bindsym $mod+Shift+l move up | |
bindsym $mod+Shift+semicolon move right | |
# alternatively, you can use the cursor keys: | |
bindsym $mod+Shift+Left move left | |
bindsym $mod+Shift+Down move down | |
bindsym $mod+Shift+Up move up | |
bindsym $mod+Shift+Right move right | |
# split in horizontal orientation | |
bindsym $mod+h split h | |
# split in vertical orientation | |
bindsym $mod+v split v | |
# enter fullscreen mode for the focused container | |
bindsym $mod+f fullscreen toggle | |
# change container layout (stacked, tabbed, toggle split) | |
bindsym $mod+s layout stacking | |
bindsym $mod+w layout tabbed | |
bindsym $mod+e layout toggle split | |
# toggle tiling / floating | |
bindsym $mod+Shift+space floating toggle | |
# change focus between tiling / floating windows | |
bindsym $mod+space focus mode_toggle | |
# focus the parent container | |
bindsym $mod+a focus parent | |
# focus the child container | |
#bindsym $mod+d focus child | |
# Define names for default workspaces for which we configure key bindings later on. | |
# We use variables to avoid repeating the names in multiple places. | |
set $ws1 "1: Tiny" | |
set $ws2 "2: Personal" | |
set $ws3 "3: Browsing" | |
set $ws4 "4: Communication" | |
set $ws5 "5: Misc" | |
set $ws6 "6" | |
set $ws7 "7" | |
set $ws8 "8" | |
set $ws9 "9" | |
set $ws10 "10" | |
# switch to workspace | |
bindsym $mod+1 workspace number $ws1 | |
bindsym $mod+2 workspace number $ws2 | |
bindsym $mod+3 workspace number $ws3 | |
bindsym $mod+4 workspace number $ws4 | |
bindsym $mod+5 workspace number $ws5 | |
bindsym $mod+6 workspace number $ws6 | |
bindsym $mod+7 workspace number $ws7 | |
bindsym $mod+8 workspace number $ws8 | |
bindsym $mod+9 workspace number $ws9 | |
bindsym $mod+0 workspace number $ws10 | |
# move focused container to workspace | |
bindsym $mod+Shift+1 move container to workspace number $ws1 | |
bindsym $mod+Shift+2 move container to workspace number $ws2 | |
bindsym $mod+Shift+3 move container to workspace number $ws3 | |
bindsym $mod+Shift+4 move container to workspace number $ws4 | |
bindsym $mod+Shift+5 move container to workspace number $ws5 | |
bindsym $mod+Shift+6 move container to workspace number $ws6 | |
bindsym $mod+Shift+7 move container to workspace number $ws7 | |
bindsym $mod+Shift+8 move container to workspace number $ws8 | |
bindsym $mod+Shift+9 move container to workspace number $ws9 | |
bindsym $mod+Shift+0 move container to workspace number $ws10 | |
# move focused workspace between monitors | |
bindsym $mod+Ctrl+greater move workspace to output right | |
bindsym $mod+Ctrl+less move workspace to output left | |
# reload the configuration file | |
bindsym $mod+Shift+c reload | |
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) | |
bindsym $mod+Shift+r restart | |
# exit i3 (logs you out of your X session) | |
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" | |
# resize window (you can also use the mouse for that) | |
mode "resize" { | |
# These bindings trigger as soon as you enter the resize mode | |
# Pressing left will shrink the window’s width. | |
# Pressing right will grow the window’s width. | |
# Pressing up will shrink the window’s height. | |
# Pressing down will grow the window’s height. | |
bindsym j resize shrink width 10 px or 10 ppt | |
bindsym k resize grow height 10 px or 10 ppt | |
bindsym l resize shrink height 10 px or 10 ppt | |
bindsym semicolon resize grow width 10 px or 10 ppt | |
# same bindings, but for the arrow keys | |
bindsym Left resize shrink width 10 px or 10 ppt | |
bindsym Down resize grow height 10 px or 10 ppt | |
bindsym Up resize shrink height 10 px or 10 ppt | |
bindsym Right resize grow width 10 px or 10 ppt | |
# back to normal: Enter or Escape or $mod+r | |
bindsym Return mode "default" | |
bindsym Escape mode "default" | |
bindsym $mod+r mode "default" | |
} | |
bindsym $mod+r mode "resize" | |
# my custom definitions | |
#################################### | |
# setup for screenshots in i3 | |
#################################### | |
# https://gist.github.com/dianjuar/ee774561a8bc02b077989bc17424a19f | |
# Screenshots | |
bindsym Print exec --no-startup-id maim "/home/$USER/Pictures/$(date)" | |
bindsym $mod+Print exec --no-startup-id maim --window $(xdotool getactivewindow) "/home/$USER/Pictures/$(date)" | |
bindsym Shift+Print exec --no-startup-id maim --select "/home/$USER/Pictures/$(date)" | |
## Clipboard Screenshots | |
bindsym Ctrl+Print exec --no-startup-id maim | xclip -selection clipboard -t image/png | |
bindsym Ctrl+$mod+Print exec --no-startup-id maim --window $(xdotool getactivewindow) | xclip -selection clipboard -t image/png | |
bindsym Ctrl+Shift+Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png | |
## battery notification | |
exec cbatticon | |
exec --no-startup-id -n i3-battery-popup | |
# Start i3bar to display a workspace bar (plus the system information i3status | |
# finds out, if available) | |
bar { | |
status_command i3status | |
# status_command i3blocks | |
} | |
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
## Installation guide | |
### basics | |
sudo apt update | |
sudo apt install net-tools curl zsh git build-essential -y | |
sudo apt install libffi-dev libncurses5-dev zlib1g zlib1g-dev liblzma-dev xsltproc -y | |
## install asdf | |
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2 | |
echo ". $HOME/.asdf/asdf.sh" >> ~/.zshrc | |
### install dependencies | |
sudo apt update -y | |
sudo apt install fzf libssl-dev make automake libncurses5-dev autoconf gcc g++ -y | |
sudo apt install -y libpq-dev postgresql postgresql-contrib libical-dev | |
### install python | |
asdf plugin add python | |
asdf install python 3.10.1 | |
### erlang specific stuff for ubuntu | |
sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk## manually install wxwidgets | |
## optional. if above doesn't work | |
git clone [email protected]:wxWidgets/wxWidgets.git | |
cd wxWidgets | |
git submodule update --init src/png | |
git submodule update --init src/jpeg | |
git submodule update --init 3rdparty/catch | |
git submodule update --init src/stc/scintilla | |
git submodule update --init src/stc/lexilla | |
./configure --with-cocoa --prefix=/usr/local --enable-webview --enable-compat28 --with-macosx-version-min=11.3 | |
make | |
sudo make install | |
# export KERL_BUILD_DOCS=yes | |
# export KERL_INSTALL_MANPAGES=yes | |
# export wxUSE_MACOSX_VERSION_MIN=11.3 | |
# export EGREP=egrep | |
# export CC=clang | |
# export CPP="clang -E" | |
# export KERL_USE_AUTOCONF=0 | |
# export KERL_CONFIGURE_OPTIONS="--disable-debug \ | |
# --disable-hipe \ | |
# --disable-sctp \ | |
# --disable-silent-rules \ | |
# --enable-darwin-64bit \ | |
# --enable-dynamic-ssl-lib \ | |
# --enable-kernel-poll \ | |
# --enable-shared-zlib \ | |
# --enable-smp-support \ | |
# --enable-threads \ | |
# --enable-wx \ | |
# --with-ssl=/opt/local \ | |
# --with-wx-config=/usr/local/bin/wx-config \ | |
# --without-javac \ | |
# --without-jinterface \ | |
# --without-odbc" | |
## see this for reference -- https://github.com/asdf-vm/asdf-erlang/issues/203#issue-890835601 | |
# apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk | |
### install erlang | |
asdf plugin add erlang | |
asdf install erlang 25.3 | |
### install elixir | |
asdf plugin add elixir | |
asdf install elixir 1.14.4 | |
## asdf global | |
asdf global elixir 1.14.4 | |
asdf global erlang 25.3 | |
asdf global python 3.10.1 | |
## configure postgres | |
#sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" | |
#sudo -u postgres createuser <username> | |
#sudo -u postgres createdb <dbname> | |
#sudo -u postgres psql | |
#psql=# alter user <username> with encrypted password '<password>'; | |
#psql=# grant all privileges on database <dbname> to <username> ; | |
## docker configurations | |
sudo apt-get update | |
sudo apt-get install \ | |
ca-certificates \ | |
curl \ | |
gnupg \ | |
lsb-release | |
# https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/ | |
# if permission denied error onrunning docker build command, use below. | |
# sudo chmod 777 /var/run/docker.sock | |
# sudo chmod 666 /var/run/docker.sock | |
## install phoenix | |
mix archive.install hex phx_new | |
## install alacritty | |
cd | |
git clone https://github.com/alacritty/alacritty.git | |
cd alacritty | |
sudo apt install cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev libxkbcommon-dev | |
cargo build --release | |
sudo tic -xe alacritty,alacritty-direct extra/alacritty.info | |
sudo cp target/release/alacritty /usr/local/bin # or anywhere else in $PATH | |
sudo cp extra/logo/alacritty-term.svg /usr/share/pixmaps/Alacritty.svg | |
sudo desktop-file-install extra/linux/Alacritty.desktop | |
sudo update-desktop-database | |
sudo mkdir -p /usr/local/share/man/man1 | |
gzip -c extra/alacritty.man | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null | |
gzip -c extra/alacritty-msg.man | sudo tee /usr/local/share/man/man1/alacritty-msg.1.gz > /dev/null | |
mkdir -p ${ZDOTDIR:-~}/.zsh_functions | |
echo 'fpath+=${ZDOTDIR:-~}/.zsh_functions' >> ${ZDOTDIR:-~}/.zshrc | |
cp extra/completions/_alacritty ${ZDOTDIR:-~}/.zsh_functions/_alacritty |
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
nvim ~/.config/i3/config | |
# open the config file and copy paste above config | |
# dependencies | |
agi xclip rofi maim light | |
agi acpi -y # for screen brightness controls |
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
asdf plugin add neovim | |
asdf install neovim latest | |
asdf global neovim latest | |
pip3 install pynvim | |
## install dependencies for nvim to work with fuelen/nvimfiles | |
sudo apt install ripgrep | |
## ascii image convertor | |
echo 'deb [trusted=yes] https://apt.fury.io/ascii-image-converter/ /' | sudo tee /etc/apt/sources.list.d/ascii-image-converter.list | |
sudo apt update | |
sudo apt install -y ascii-image-converter | |
# install fuelen/nvimfiles | |
git clone https://github.com/fuelen/nvimfiles.git ~/.config/nvim | |
cd ~/.config/nvim | |
bash install.sh | |
cd - | |
nvim . |
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
## oh my zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/zsh-autocomplete | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
git clone https://github.com/joshskidmore/zsh-fzf-history-search ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-fzf-history-search | |
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k | |
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf | |
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf | |
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf | |
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf | |
cp Meslo*.ttf ~/.fonts/ | |
fc-cache -f -v | |
## now change the default font to meslo from your terminal |
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
# ngrok | |
wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz | |
sudo tar xvzf ./ngrok-v3-stable-linux-amd64.tgz -C /usr/local/bin | |
rm -rf ./ngrok-v3-stable-linux-amd64.tgz |
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
sudo vi /etc/postgresql/14/main/pg_hba.conf | |
# change the following | |
---- | |
local all postgres ident | |
local all all md5 | |
host all all 127.0.0.1/32 md5 | |
---- | |
then in file | |
sudo vi /etc/postgresql/14/main/postgresql.conf | |
## for first time setup, create a new user, and reset its password by using trust mode | |
https://docs.bitnami.com/aws/infrastructure/postgresql/administration/change-reset-password/ | |
after that, just change trust back to md5 and user postres securely. | |
--- | |
password_encryption = scram-sha-256 # scram-sha-256 or md5 | |
--- | |
sudo systemctl start postgresql |
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
# setup postgres password | |
https://stackoverflow.com/a/12721020 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tmux config