From 29478ead07ffda4a4564fc47e49b75cd4d70e810 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Fri, 1 Sep 2017 18:39:06 +0200 Subject: [PATCH] From internship --- bashrc | 3 ++- bin/.gitignore | 2 ++ config/htop/htoprc | 4 ++-- config/i3/lock.png | Bin 524 -> 266 bytes inputrc | 3 +-- scripts/docker-image-childs | 11 +++++++++++ scripts/docker-rm | 1 + scripts/install-prefs | 7 ++++--- scripts/lorem | 22 ++++++++++++++++++++++ scripts/machines | 3 ++- vimrc | 16 +++++++++++++--- 11 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 bin/.gitignore create mode 100755 scripts/docker-image-childs create mode 100755 scripts/lorem diff --git a/bashrc b/bashrc index 98d0e92..c321755 100644 --- a/bashrc +++ b/bashrc @@ -23,6 +23,7 @@ fi export JAVA_FONTS=/usr/share/fonts/TTF export ANDROID_HOME=/opt/android-sdk export GOPATH=$HOME/.go +export PATH=$GOPATH/bin:$PATH export XDG_CONFIG_HOME=$HOME/.config export ARDUINO=/usr/share/arduino export ARDUINO_DIR=$ARDUINO @@ -104,7 +105,7 @@ export PS4="- " # CUSTOM SCRIPTS -export PATH="$HOME/.scripts/:$PATH" +export PATH="$HOME/.bin/:$HOME/.scripts/:$PATH" [ -f ~/.gscripts/gprofile ] && source ~/.gscripts/gprofile # UTILITIES diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/config/htop/htoprc b/config/htop/htoprc index 9b71608..7374ae2 100644 --- a/config/htop/htoprc +++ b/config/htop/htoprc @@ -1,7 +1,7 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=47 +sort_key=46 sort_direction=1 hide_threads=0 hide_kernel_threads=1 @@ -12,7 +12,7 @@ show_program_path=0 highlight_base_name=1 highlight_megabytes=0 highlight_threads=1 -tree_view=1 +tree_view=0 header_margin=0 detailed_cpu_time=0 cpu_count_from_zero=0 diff --git a/config/i3/lock.png b/config/i3/lock.png index 33f04e2b47bda7fddc797b411983e68ba389cae6..70cc80b9e4849ec73eb585040a3730f890fbd254 100644 GIT binary patch delta 214 zcmeBS>0+9o!YDB@QKsHSHY|vNfnlwui(`nz>C#IZ1rIq0upCVEVr1C(fSdV~in3E9 z2ZQs0``-JX=lX6ff5-Q>Z@KsG&Bkx<^&1sbP5ZjSS!wbK6{Aic7!`eKf^O!CeVIpq zs4nvW5dF(M4Mb75HcT^Hv&2+8^K4d>;rG-yZR=`%ug{@3&%V=s{;qoW`Z>Se_rgs< eH4~Nho8jiC#x@6O%|f8d89ZJ6T-G@yGywq9C0-!_ literal 524 zcmeAS@N?(olHy`uVBq!ia0vp^#vshX3?xtV>q-JCmUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mYa32{woXKY%+SUr!? zuY}Pphtao~F{Oi{dM@Mt|NrF`CQk$^V@&dPcj0KeH?<1L;VkfoEC#ygHwZIwmz&N8 z3bL1Y`ns||WaQ^IG?`!Q-VPMn;_2cTVsX0k(r!^EM;_Qtx@k?|BvY?Vem1XKyGyBLU zSCwd&O}>V=MU0nD&}`*7k?vsUTqHT^G|$a56VBfI#QH1Y+hpa_^ODZztVoGm3Nom7 z640R1N0I9Dco*GNnB|*vQ)Qa2(oLmFxm`Dx&CqQ1(M)l$WBvp*V?s>YiL|yHwfe?g z*UwCAKk5&3ziNqVL`h0wNvc(HQ7VvPFfuSS*EKNIH8c$|G_*3Yv@$i)HZZg@Fo@HB zFNmTcH$NpatrE8e{j%`2Kn;>08-nxGO3D+9QW?t2%k?tzvWt@w3sUv+i_&MmvylQS OV(@hJb6Mw<&;$VS=&%L= diff --git a/inputrc b/inputrc index 4c211de..bb2af3c 100644 --- a/inputrc +++ b/inputrc @@ -6,7 +6,7 @@ set completion-query-items 200 set editing-mode vi set history-preserve-point on set history-size 10000 -set horizontal-scroll-mode on +set horizontal-scroll-mode off set mark-directories on set mark-modified-lines off set mark-symlinked-directories on @@ -28,7 +28,6 @@ $if mode=vi set keymap vi-insert # these are for vi-insert mode "jk": vi-movement-mode - "mù": vi-movement-mode "\e[A": history-search-backward "\e[B": history-search-forward Control-l: clear-screen diff --git a/scripts/docker-image-childs b/scripts/docker-image-childs new file mode 100755 index 0000000..cf72ad1 --- /dev/null +++ b/scripts/docker-image-childs @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +# Find the dependent child image from an image + +parent="$1" + +# From https://stackoverflow.com/a/41634462 +for i in $(docker images -q) +do + docker history "$i" | grep -q "$parent" && echo "$i" +done | grep -v "$parent" | sort -u diff --git a/scripts/docker-rm b/scripts/docker-rm index a9d6631..aadc6fb 100755 --- a/scripts/docker-rm +++ b/scripts/docker-rm @@ -1,4 +1,5 @@ #!/usr/bin/env sh +docker unpause $(docker ps -q) docker kill $(docker ps -q) docker container prune -f docker network prune -f diff --git a/scripts/install-prefs b/scripts/install-prefs index 9674f42..cc24ce0 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -237,7 +237,7 @@ fi if [ $GUI == 1 ]; then # Desktop manager - inst i3 i3lock i3status dunst unclutter xautolock feh numlockx scrot xterm xclip + inst i3 i3lock dunst unclutter xautolock feh numlockx scrot xterm xclip if [ $ARCH == 1 ]; then altInst polybar-git ttf-font-awesome autorandr-git keynav-enhanced else @@ -272,10 +272,11 @@ if [ $GUI == 1 ]; then if [ $ARCH == 1 ]; then altInst sct elif [ $TERMUX != 1 ]; then - if [ ! -f $HOME/.gscripts/sct ]; then + if [ ! -f $HOME/.bin/sct ]; then TMP=$(mktemp) wget http://www.tedunangst.com/flak/files/sct.c -O $TMP - cc -std=c99 -O2 -I /usr/X11R6/include -o $HOME/.gscripts/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr + cc -std=c99 -O2 -I /usr/X11R6/include -o $HOME/.bin/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr + rm $TMP fi fi diff --git a/scripts/lorem b/scripts/lorem new file mode 100755 index 0000000..77e3998 --- /dev/null +++ b/scripts/lorem @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Generates Lorem Ipsum + +original="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. + +Ut velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula. Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam. Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat. Proin feugiat, augue non elementum posuere, metus purus iaculis lectus, et tristique ligula justo vitae magna. + +Aliquam convallis sollicitudin purus. Praesent aliquam, enim at fermentum mollis, ligula massa adipiscing nisl, ac euismod nibh nisl eu lectus. Fusce vulputate sem at sapien. Vivamus leo. Aliquam euismod libero eu enim. Nulla nec felis sed leo placerat imperdiet. Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet. +" + +repet=$1 + +if [ -z $repet ]; then + repet=1 +fi + +for i in $(seq 1 $repet) +do + echo -e "$original" +done + diff --git a/scripts/machines b/scripts/machines index aacbbb2..3e6450b 100755 --- a/scripts/machines +++ b/scripts/machines @@ -78,6 +78,7 @@ function _machines-pubFromCrt { } function _machines-verifyCertificate { + return if openssl verify $MACHINES_CONFIG/machines.crt | grep -v 'error 18' | grep 'error' --quiet; then echo "[ERROR] Invalid certificate" exit 1 @@ -426,7 +427,7 @@ function machines_setup { _machines-apiToken machine --post-data "$data" echo $name > $MACHINES_CONFIG/this.name - machines-update + machines_update } function machines_update { diff --git a/vimrc b/vimrc index 6711788..6e10446 100644 --- a/vimrc +++ b/vimrc @@ -35,6 +35,7 @@ Plugin 'artur-shaik/vim-javacomplete2' Plugin 'tomtom/tcomment_vim' Plugin 'Shougo/denite.nvim' Plugin 'tomlion/vim-solidity' +Plugin 'godlygeek/tabular' call vundle#end() " required filetype plugin indent on " required @@ -46,7 +47,7 @@ nmap :UndotreeToggle:UndotreeFocus """ CTRLP """ let g:ctrlp_custom_ignore = { - \ 'dir': '\v([\/]\.(git|hg|svn)|log|node_modules|bower_components|__pycache__|vendor|output|buildroot)$', + \ 'dir': '\v([\/]\.(git|hg|svn)|log|node_modules|bower_components|__pycache__|vendor|output|buildroot|doc)$', \ 'file': '\v\.(exe|so|dll|o|pyc)$', \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', \ } @@ -78,6 +79,13 @@ let g:airline_theme = 'wombat' let g:ycm_global_ycm_extra_conf = '/usr/share/vim/vimfiles/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' let g:ycm_server_python_interpreter = '/usr/bin/python2' +nmap gTi :YcmCompleter GoToInclude +nmap gTc :YcmCompleter GoToDeclaration +nmap gTf :YcmCompleter GoToDefinition +nmap gt :YcmCompleter GoTo +nmap gT :YcmCompleter GoToImprecise +nmap gTr :YcmCompleter GoToReference + """ AUTOFORMAT """ nmap :Autoformat @@ -153,7 +161,9 @@ cmap w!! w !sudo tee > /dev/null % imap jk imap mù map o -nmap :bp -nmap :bn +nmap :bp +nmap :bn +nmap kkkkkkkkkkkkkkkkkkkkk +nmap jjjjjjjjjjjjjjjjjjjjj