-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rodrigo Siqueira <[email protected]>
- Loading branch information
1 parent
8333e9f
commit 0c098ef
Showing
305 changed files
with
31,013 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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 contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# ~/.bashrc | ||
# | ||
|
||
# Vim should be default | ||
EDITOR=vim | ||
|
||
# My laziness stuffs | ||
R="$HOME/Documents/Repositories/" | ||
notes="$HOME/Documents/Notes/" | ||
|
||
Rk="$HOME/Documents/Repositories/kernels" | ||
Rdrm="$Rk/drm/drm-misc/" | ||
|
||
Rf="$HOME/Documents/Repositories/freedesktop" | ||
Rigt="$Rf/igt-gpu-tools" | ||
Rlibdrm="$Rf/libdrm" | ||
|
||
M="$R/MAINTENANCE" | ||
NOI="$R/NOI" | ||
|
||
kdd="drivers/gpu/drm/amd/dal-dev/" | ||
kd="drivers/gpu/drm/amd/display/" | ||
|
||
export GPG_TTY=$(tty) | ||
gpg-connect-agent updatestartuptty /bye >/dev/null | ||
|
||
# If not running interactively, don't do anything | ||
[[ $- != *i* ]] && return | ||
|
||
# Tools alias | ||
alias ls='ls --color=auto' | ||
alias grep='grep --color' | ||
alias feh='feh --scale-down' | ||
alias mpg123b='screen mpg123 -o pulse -z' | ||
# llk stands for last line in known_hosts | ||
alias dropllk="sed -i '\$d' ~/.ssh/known_hosts" | ||
|
||
# Useful alias | ||
alias kernel-test='[ -d "/usr/lib/modules/$(uname -r)" ] || echo "Kernel has been updated. Please reboot."' | ||
|
||
# Bash color | ||
PS1='[$?,\j][\D{%T}]\[\e[0;32m\]\u@\h\[\e[m\] \[\e[1;34m\]\w\[\e[m\] ' | ||
PS1+='\[\e[1;32m\]\[\e[0;33m\]$(__git_ps1 "[%s]")\n\[\e[1;32m\]' | ||
PS1+='\$\[\e[m\] \[\e[0;37m\]' | ||
|
||
# Miscellaneous export variables | ||
export HISTTIMEFORMAT='%F %T ' | ||
export HISTCONTROL=erasedups | ||
|
||
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. | ||
#export PATH="$PATH:$HOME/.rvm/bin" | ||
#[ -s "/home/siqueira/.scm_breeze/scm_breeze.sh" ] && source "/home/siqueira/.scm_breeze/scm_breeze.sh" | ||
|
||
# Adding the kdesrc-build directory to the path | ||
#export PATH="$HOME/kde/src/kdesrc-build:$PATH" | ||
|
||
PATH=~/.local/bin:$PATH |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cp bash/bashrc ~/.bashrc |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Get the project | ||
git clone https://github.com/scmbreeze/scm_breeze.git ~/.scm_breeze | ||
|
||
# Installing breeze | ||
bash ~/.scm_breeze/install.sh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Global setup | ||
git config --global user.name 'Rodrigo Siqueira' | ||
git config --global user.email '[email protected]' | ||
git config --global core.editor vim | ||
|
||
# Autocomplete | ||
printf '# Git magic\n' >> ~/.bashrc | ||
printf 'source /usr/share/git/completion/git-completion.bash\n' >> ~/.bashrc | ||
printf 'source /usr/share/git/completion/git-prompt.sh\n' >> ~/.bashrc |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#Used for file sourcing. | ||
#This function should used for file sourcing instead of `. file.sh --source-only` | ||
# | ||
# @filepath Path to the file to be sourced | ||
# | ||
# Returns: | ||
# 0 on a succesful import, 1 if the file can't be read and 2 if it can´t be found | ||
function include() | ||
{ | ||
local filepath="$1" | ||
local fullpath | ||
|
||
if [[ ! -r "$filepath" ]]; then | ||
if [[ ! -e "$filepath" ]]; then | ||
printf '%s\n' "File $filepath could not be found, check your file path." | ||
return 2 # ENOENT | ||
fi | ||
printf '%s\n' "File $filepath could not be read, check your file permissions." | ||
return 1 # EPERM | ||
fi | ||
|
||
fullpath="$(realpath "$filepath")" | ||
|
||
if [[ -v KW_INCLUDES_SET ]]; then | ||
[[ -v KW_INCLUDED_PATHS["$fullpath"] ]] && return 0 | ||
|
||
KW_INCLUDED_PATHS["$fullpath"]=1 | ||
else | ||
declare -g KW_INCLUDES_SET=1 | ||
declare -gA KW_INCLUDED_PATHS=(["$fullpath"]=1) | ||
fi | ||
|
||
. "$filepath" --source-only | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
function detect_distro() | ||
{ | ||
local root_path="$1" | ||
local str_check="$2" | ||
local distro_id='none' | ||
local etc_path | ||
declare -a debian_family=('debian' 'ubuntu' 'raspbian') | ||
declare -a arch_family=('arch' 'manjaro') | ||
declare -a fedora_family=('fedora') | ||
|
||
etc_path=$(join_path "$root_path" /etc) | ||
|
||
if [[ -n "$str_check" ]]; then | ||
distro_id="$str_check" | ||
elif [[ -d $etc_path ]]; then | ||
distro_id=$(cat "$etc_path"/*-release | grep -w ID | cut -d = -f 2) | ||
fi | ||
|
||
# Debian family | ||
if [[ "${debian_family[*]}" =~ ${distro_id} ]]; then | ||
printf '%s\n' 'debian' | ||
# ArchLinux family | ||
elif [[ "${arch_family[*]}" =~ ${distro_id} ]]; then | ||
printf '%s\n' 'arch' | ||
# Fedora family | ||
elif [[ "${fedora_family[*]}" =~ ${distro_id} ]]; then | ||
printf '%s\n' 'fedora' | ||
else | ||
printf '%s\n' 'none' | ||
fi | ||
} | ||
|
||
function join_path() | ||
{ | ||
local target_path=$1 | ||
local member=$2 | ||
local joined | ||
|
||
# TODO: Extended pattern matching. We should consider to use it as a default | ||
# in this project. | ||
shopt -s extglob | ||
member=${member%%+(/)} | ||
member=${member##+(/)} | ||
|
||
joined="${target_path%%+(/)}/$member" | ||
|
||
printf '%s\n' "$joined" | tr -s '/' | ||
} | ||
|
||
function install_packages() | ||
{ | ||
local -n list="$1" | ||
local package_manager_cmd="$2" | ||
|
||
printf -v list_str '%s ' "${list[@]}" | ||
|
||
eval "${package_manager_cmd} ${list_str}" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
. 'include.sh' --source-only | ||
|
||
include 'lib.sh' | ||
|
||
# Setup variables per distro target | ||
export TARGET_DISTRO=$(detect_distro) | ||
if [[ "$TARGET_DISTRO" == 'arch' ]]; then | ||
export PACKAGE_MANAGER='yes | sudo pacman -Syu --noconfirm ' | ||
else | ||
export PACKAGE_MANAGER='sudo apt install -y ' | ||
fi | ||
|
||
# Keep in mind that the order metters here. | ||
|
||
include 'packages/setup.sh' | ||
include 'vim/setup.sh' | ||
include 'repositories/setup.sh' | ||
include 'bash/setup.sh' | ||
include 'git/setup.sh' | ||
include 'rvm/setup.sh' | ||
include 'breeze/setup.sh' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# ArchLinux package names | ||
declare -a arch_packages=( | ||
'rsync' | ||
'wget' | ||
'vim' | ||
'git' | ||
'htop' | ||
'konsole' | ||
'libreoffice-fresh' | ||
'okular' | ||
'zim' | ||
'openconnect' | ||
'screen' | ||
'pv' | ||
'bzip2' | ||
'lzip' | ||
'lzop' | ||
'zstd' | ||
'mpg123' | ||
'man' | ||
'man-db' | ||
'chromium' | ||
'firefox' | ||
'ntfs-3g' | ||
'gnupg' | ||
'bash-completion' | ||
'openconnect' | ||
# Kernel packages | ||
'base-devel' | ||
'xmlto' | ||
'kmod' | ||
'inetutils' | ||
'bc' | ||
'libelf' | ||
'cpio' | ||
'perl' | ||
'tar' | ||
'xz' | ||
) | ||
|
||
install_packages "${TARGET_DISTRO}"_packages "${PACKAGE_MANAGER}" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
REPOS="${HOME}/Documents/Repositories" | ||
|
||
declare -a other_projects=( | ||
'https://github.com/webfolder/siqueira.tech' | ||
'https://github.com/rodrigosiqueira/myConfigFiles.git' | ||
) | ||
|
||
declare -a kw_repos=( | ||
'https://github.com/kworkflow/kworkflow.git' | ||
'https://github.com/kworkflow/blog.git' | ||
'https://github.com/kworkflow/miscellaneous.git' | ||
) | ||
|
||
declare -a kernel_repos=( | ||
'https://anongit.freedesktop.org/git/drm/drm-misc.git' | ||
'https://github.com/raspberrypi/linux.git' | ||
) | ||
|
||
declare -a freedesktop_repos=( | ||
'https://gitlab.freedesktop.org/mesa/drm' | ||
|
||
) | ||
|
||
function clone_project_to() | ||
{ | ||
local -n project_list="$1" | ||
local repo_path="$2" | ||
|
||
# Clone misc projects | ||
for repository in "${project_list[@]}"; do | ||
repo_name=$(basename "$repository") | ||
repo_name="${repo_name%%.*}" | ||
|
||
[[ -d "${repo_path}/${repo_name}" ]] && continue | ||
|
||
git -C "${repo_path}" clone "$repository" | ||
done | ||
} | ||
|
||
mkdir -p "${REPOS}" | ||
|
||
# Clone other projects | ||
clone_project_to other_projects "${REPOS}" | ||
|
||
# Clone kw project | ||
mkdir -p "${REPOS}/kw" | ||
clone_project_to kw_repos "${REPOS}/kw" | ||
|
||
# Clone kernel freedesktop | ||
mkdir -p "${REPOS}/freedesktop" | ||
clone_project_to freedesktop_repos "${REPOS}/freedesktop" | ||
|
||
# Clone kernel projects | ||
mkdir -p "${REPOS}/kernels" | ||
clone_project_to kernel_repos "${REPOS}/kernels" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Reference: https://rvm.io/rvm/install | ||
|
||
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | ||
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - | ||
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import - | ||
|
||
# Setup ruby | ||
curl -sSL https://get.rvm.io | bash -s stable --ruby |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
let g:netrw_dirhistmax =10 | ||
let g:netrw_dirhistcnt =7 | ||
let g:netrw_dirhist_7='/home/siqueira/Documents/Repositories/kernels/drm' | ||
let g:netrw_dirhist_6='/home/siqueira/Documents/Repositories/kw/kworkflow/etc/init_templates/x86-64' | ||
let g:netrw_dirhist_5='/home/siqueira/Documents/Repositories/kw/kworkflow/etc/init_templates/rpi4-raspbian-64-cross-x86-arm' | ||
let g:netrw_dirhist_4='/home/siqueira/Documents/Repositories/kw/kworkflow/etc/init_templates/rpi4-raspbian-32-cross-x86-arm' | ||
let g:netrw_dirhist_3='/home/siqueira/Documents/Repositories/kw/kworkflow/etc/init_templates' | ||
let g:netrw_dirhist_2='/home/siqueira/Documents/Repositories/kw/kworkflow/etc/init_templates/rpi4-raspbian-32-cross-x86-arm' | ||
let g:netrw_dirhist_1='/home/siqueira/Documents/Repositories/kw/kworkflow/etc/init_templates' | ||
let g:netrw_dirhist_0='/home/siqueira/Documents/Repositories/kw/kworkflow/src' | ||
let g:netrw_dirhist_9='/home/siqueira/Documents/Repositories/kw/kworkflow' | ||
let g:netrw_dirhist_8='/home/siqueira/Documents/Repositories/kw/kworkflow/documentation/dependencies' |
Oops, something went wrong.