Skip to content

Instantly share code, notes, and snippets.

View mgrzaslewicz's full-sized avatar

Mikołaj Grząślewicz mgrzaslewicz

View GitHub Profile
@mgrzaslewicz
mgrzaslewicz / ubuntu-provision.sh
Last active December 19, 2022 16:29
Ubuntu provision
# To have by default: apt install $something --yes # --force-yes
## at first it was:
## sudo "echo 'APT::Get::Assume-Yes \"true\";'" > /etc/apt/apt.conf.d/90forceyes
## but it gives permission denied, because the stream redirect will not be run as super user
sudo bash -c "echo 'APT::Get::Assume-Yes \"true\";' > /etc/apt/apt.conf.d/90yes"
# sudo bash -c "echo 'APT::Get::force-yes \"true\";' >> /etc/apt/apt.conf.d/90yes" # this one is potentialy harmful
# terminal
sudo apt install zsh
# prompt - show last 2 directories and time at the end
PROMPT_DIRTRIM=2
PS1="\[\e[33m\]\w\[\e[m\] \[\e[36m\]\t\[\e[m\] $ "
# setup variables
mkdir ~/tmp
MY_TMP=~/tmp
# tmux
alias tmux-print-screen="tmux capture-pane -pS -1000000"
@mgrzaslewicz
mgrzaslewicz / .tmux.conf
Created January 11, 2022 11:34
tmux config
# rebind control key
set -g prefix C-Space
unbind C-b
set-option -g history-limit 10000
# count windows from 1
set -g base-index 1
# Enable mouse control (clickable windows, panes, resizable panes)
@mgrzaslewicz
mgrzaslewicz / .vimrc
Last active October 26, 2021 09:33
vimrc
:set number
:imap kj <Esc>
:set so=999
:set cursorline
@mgrzaslewicz
mgrzaslewicz / .gitconfig
Last active October 14, 2021 10:47
gitconfig
## Why use git aliases?
## It's much faster to operate git from command line when you don't have to
## eg. `git pull --rebase` -> becomes `git p`
## Adding an alias to bash `alias g='git'` makes it even shorter and above example becomes `g p`
## Use below content to append to your .gitconfig
[include]
# cd ~ && wget https://raw.githubusercontent.com/GitAlias/gitalias/master/gitalias.txt
path = ~/gitalias.txt
##
@mgrzaslewicz
mgrzaslewicz / windows-provision.sh
Last active June 20, 2021 18:10
Windows provision
#console
choco install sudo -Y
choco install cmder -Y
choco install wget -Y
#file browsing
choco install filezilla -Y
choco install totalcommander -Y
choco install tor-browser -Y
@mgrzaslewicz
mgrzaslewicz / .ideavimrc
Last active February 16, 2021 13:40
intellij idea vim settings
imap kj <Esc>
set so=999
# reload settings after modifying the file
# :source ~/.ideavimrc
# https://stackoverflow.com/questions/3776117/what-is-the-difference-between-the-remap-noremap-nnoremap-and-vnoremap-mapping
@mgrzaslewicz
mgrzaslewicz / Monokai.sublime-color-scheme
Last active January 28, 2021 10:57
Sublime plugins and settings
# Open with PackageResourceViewer, color scheme default, monokai
"globals":
{
"line_highlight": "color(hsl(148, 100%, 25%))",
}
# open with PackageResourceViewer, theme, default
{
"class": "minimap_control",
"settings": ["always_show_minimap_viewport"],
@mgrzaslewicz
mgrzaslewicz / .sublime-keymap.json
Last active September 11, 2020 07:25
.sublime-keymap
[
{ "keys": ["k", "j"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
}
]
@mgrzaslewicz
mgrzaslewicz / windows .bashrc
Last active August 8, 2020 12:54
bashrc with shortcuts (functions and aliases) for backend programming
PS1="\[\e[33m\]\W\[\e[m\] \[\e[36m\]\t\[\e[m\] $ "
# navigation
alias repos="cd /c/data/repos"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias ll="ls -la --color"
alias llf="ls -la | grep $1"
alias grep="grep --color=auto"