Compare commits

..

No commits in common. "b8ead0532272c43fc9634613ee4c2334bb945d7e" and "be5d768f6f7eb819f4f1e8cf63887b108c0cc4b5" have entirely different histories.

6 changed files with 54 additions and 41 deletions

2
bashrc
View file

@ -111,8 +111,8 @@ alias fuck='eval $(thefuck $(fc -ln -1))'
alias FUCK='fuck'
# Command not found
[ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash
[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh
[ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash
# Functions
function clean {

View file

@ -1,4 +0,0 @@
def FlagsForFile(filename, **kwargs):
return {
'flags': ['-Wall', '-Wextra', '-lm'],
}

View file

@ -79,20 +79,13 @@ function _machines-regenKey {
openssl genrsa -out $MACHINES_CONFIG/machines.key 4096
chmod 600 $MACHINES_CONFIG/machines.key
openssl req -key $MACHINES_CONFIG/machines.key -new -out $MACHINES_CONFIG/machines.csr
openssl x509 -req -days 1826 -in $MACHINES_CONFIG/machines.csr -signkey $MACHINES_CONFIG/machines.key -out $MACHINES_CONFIG/machines.crt
openssl x509 -req -in $MACHINES_CONFIG/machines.csr -signkey $MACHINES_CONFIG/machines.key -out $MACHINES_CONFIG/machines.crt
_machines-pubFromCrt
fi
}
function _machines-verifyCertificate {
if openssl verify $MACHINES_CONFIG/machines.crt | grep -v 'error18' | grep 'error' --quiet; then
echo "Invalid certificate"
exit 1
fi
}
function _machines-ensurePub {
if [ ! -f $MACHINES_CONFIG/machines.crt ]; then
if [ ! -f $MACHINES_CONFIG/machines.pub ]; then
CERT_FILE=$(mktemp)
echo "[INFO] Downloading certificate..."
_machines-api cert > $CERT_FILE
@ -100,15 +93,14 @@ function _machines-ensurePub {
prompt "Is this correct ?"
if [ $? == 1 ]; then
mv $CERT_FILE $MACHINES_CONFIG/machines.crt &> /dev/null
_machines-pubFromCrt
return 0
else
echo "Certificate rejected."
exit 1
return 1
exit
fi
fi
_machines-verifyCertificate
if [ ! -f $MACHINES_CONFIG/machines.pub ]; then
_machines-pubFromCrt
fi
}
# SSH ACCESS KEYS
@ -123,7 +115,6 @@ function _machines-signAkey { # network
}
function _machines-getAkey { # network
_machines-ensurePub
KEY_FILE=$(mktemp)
SIGN_FILE=$(mktemp)
_machines-api akey/$1 > $KEY_FILE
@ -284,6 +275,9 @@ function machines-setup {
fi
_machines-ensurePub
if [ $? != 0 ]; then
return 2
fi
# Variables
read -p 'Machine name? ' name

View file

@ -69,7 +69,7 @@ function replaceImg { # candidate original
else
echo "→ Candidate don't have the same bit map as original, skipping!"
fi
rm "$ppmc" "$ppmo" "$c"
rm "$ppmc" "$ppmo"
}
@ -98,7 +98,7 @@ do
rm "$prog"
fi
done <<< "$(find "$dir" -type f -iregex ".+.jpe?g$")"
done <<< "$(find $dir -type f -iregex ".+.jpe?g$")"
# PNG (requires optipng)
while read image
@ -112,7 +112,7 @@ do
replaceImg "$temp" "$image"
done <<< "$(find "$dir" -type f -iname "*.png")"
done <<< "$(find $dir -type f -iname "*.png")"
# SVG (requires svgo)
while read image
@ -121,15 +121,15 @@ do
temp=$(mktemp --suffix .svg)
cp "$image" "$temp"
svgo --quiet --config $HOME/.scripts/svgo.yml "$temp"
svgo --quiet "$temp"
echo "→ Optimize done"
replaceImg "$temp" "$image"
done <<< "$(find "$dir" -type f -iname "*.svg")"
done <<< "$(find $dir -type f -iname "*.svg")"
# GIT (requires git)
find "$dir" -type d -name .git -print0 | while IFS= read -r -d '' dir; do
find $dir -type d -name .git -print0 | while IFS= read -r -d '' dir; do
(cd "$dir"; git gc)
done

View file

@ -1,5 +0,0 @@
plugins:
- mergePaths : false
- convertTransform : false
- cleanupNumericValues : false

48
vimrc
View file

@ -19,6 +19,8 @@ Bundle 'Shougo/neosnippet-snippets'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-repeat'
Plugin 'scrooloose/syntastic'
"Plugin 'terryma/vim-multiple-cursors'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'airblade/vim-gitgutter'
@ -33,7 +35,6 @@ Plugin 'majutsushi/tagbar'
Plugin 'wellle/targets.vim'
Plugin 'Chiel92/vim-autoformat'
Plugin 'Valloric/YouCompleteMe'
Plugin 'Raimondi/delimitMate'
call vundle#end() " required
filetype plugin indent on " required
@ -46,12 +47,37 @@ let g:ctrlp_custom_ignore = {
\ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
\ }
""" SYNTASTIC """
set statusline+=%#warningmsg#
set statusline+=%{syntasticstatuslineflag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 0
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
""" VIM-MULTIPLE-CURSORS """
let g:multi_cursor_use_default_mapping=0
" Default mapping
let g:multi_cursor_next_key='<C-n>'
let g:multi_cursor_prev_key='<C-p>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'
" Map start key separately from next key
let g:multi_cursor_start_key='<F6>'
let g:multi_cursor_start_key='<C-n>'
let g:multi_cursor_start_word_key='g<C-n>'
""" VIM-AIRLINE """
set noshowmode
set laststatus=2
let g:airline_powerline_fonts = 1
" let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline_section_a = airline#section#create(['mode'])
@ -72,10 +98,6 @@ let g:NERDTreeIndicatorMapCustom = {
\ "Unknown" : "?"
\ }
""" YOUCOMPLETEME """
let g:ycm_global_ycm_extra_conf = '~/.config/ycm_extra_conf.py'
""" VIM SETTINGS """
@ -107,8 +129,6 @@ set backspace=indent,eol,start
set hidden
set updatetime=250
set cursorcolumn
syntax enable
set background=dark
@ -138,7 +158,15 @@ if has('persistent_undo')
set undofile
endif
imap jk <Esc>
imap <Esc>
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
imap <up> <nop>
imap <down> <nop>
imap <left> <nop>
imap <right> <nop>
map ;; <Esc>
imap ;; <Esc>
map <Enter> o<Esc>