Skip to content

Instantly share code, notes, and snippets.

@dklima
dklima / nvram-clean.sh
Created May 2, 2021 06:08
asuswrt-merlin NVRAM low warning
#!/usr/bin/env bash
# Save it at /jffs/scripts and you can schedule its execution
for line in $(nvram show | grep =$); do
var=${line%*=}
nvram unset $var
done
nvram commit
# Change all directories permission on current dir to 755
find . -type d -exec chmod 755 {} \;
# Change all files permission on current dir to 644
find . -type f -exec chmod 644 {} \;
@dklima
dklima / .vimrc
Last active June 12, 2022 16:00
Vimrc for using vim with powerline-vim
python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
set laststatus=2 " Always display the statusline in all windows
set showtabline=2 " Always display the tabline, even if there is only one tab
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
set t_Co=256
" Tab of 2 spaces configuration
set expandtab " On pressing tab, insert 2 spaces
@dklima
dklima / .gemrc
Created January 29, 2018 20:56
Do not install documentations when installing gems
gem: --no-document
@dklima
dklima / .bashrc
Created January 10, 2018 11:17
Ask you ssh passphrase once when you log in on Linux, use ssh-agent for storing session
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
@dklima
dklima / .bashrc
Last active January 10, 2018 11:42
bash prompt like "pure" theme from zsh (with current git branch)
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1="\n\[\033[94m\]\w\[\033[0m\]\$(parse_git_branch)\[\033[00m\]\n\[\033[1;35m\]❯\[\033[1;33m\] \[\033[0m\]"
export PS1