From 69b452aa1bc04d987e4d1e6079cad122b967bcb2 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Wed, 5 Jun 2019 11:43:52 +0200 Subject: [PATCH] enable calendar, add urls newsboat, update to tl2019, output jpg for resize script, add vim options, add ac3 conversion script, add wipe script for hard drives --- email/.local/bin/newmail.sh | 2 +- newsboat/.config/newsboat/urls | 3 +++ shell/.bashrc | 5 +++-- shell/.local/bin/ac3fix | 11 +++++++++++ shell/.local/bin/resize.sh | 4 ++-- shell/.local/bin/wipe | 25 +++++++++++++++++++++++++ vim/.vimrc | 14 ++++++++------ 7 files changed, 53 insertions(+), 11 deletions(-) create mode 100755 shell/.local/bin/ac3fix create mode 100755 shell/.local/bin/wipe diff --git a/email/.local/bin/newmail.sh b/email/.local/bin/newmail.sh index 4f62eb4..a1828a0 100755 --- a/email/.local/bin/newmail.sh +++ b/email/.local/bin/newmail.sh @@ -8,4 +8,4 @@ then notify-send "$newmail new emails!" fi notmuch new -#vdirsyncer sync +vdirsyncer sync diff --git a/newsboat/.config/newsboat/urls b/newsboat/.config/newsboat/urls index e68166e..3c6ece6 100644 --- a/newsboat/.config/newsboat/urls +++ b/newsboat/.config/newsboat/urls @@ -21,3 +21,6 @@ https://www.youtube.com/feeds/videos.xml?channel_id=UC9-y-6csu5WGm29I7JiwpnA yt https://www.youtube.com/feeds/videos.xml?channel_id=UC-7I1gU1r6PxBSl87o-7YEQ yt "Drauga1" https://www.youtube.com/feeds/videos.xml?channel_id=UC1ydE9gDHTdvbNVIgEKIKzw yt "VWestlife" https://www.youtube.com/feeds/videos.xml?channel_id=UCSE6yilNScIz1SLTNQvrXMw yt "Vinheteiro" +https://www.youtube.com/feeds/videos.xml?channel_id=UCnCE0-pPZuit8aud1l9rhkA yt "Whisky.com" +https://www.youtube.com/feeds/videos.xml?channel_id=UCb45YJUy9zAzhPaduyMM-_w yt "Janet Devlin" +https://www.youtube.com/feeds/videos.xml?channel_id=UCxDZs_ltFFvn0FDHT6kmoXA yt "Bald and bankrupt" diff --git a/shell/.bashrc b/shell/.bashrc index 156d908..0d2a2c9 100644 --- a/shell/.bashrc +++ b/shell/.bashrc @@ -24,12 +24,13 @@ export CLEAN_HOME=/opt/clean export PATH=~/.local/bin:$PATH export PATH=$PATH:$CLEAN_HOME/lib/exe:$CLEAN_HOME/bin -export PATH=$PATH:/opt/texlive/2018/bin/x86_64-linux:/opt/zotero:/opt/arduino:/opt/beets/bin +export PATH=$PATH:/opt/texlive/2019/bin/x86_64-linux:/opt/zotero:/opt/arduino:/opt/beets/bin -export MANPATH=~/.local/share/man:/opt/texlive/2018/texmf-dist/doc/man:./arduino/java/man:$MANPATH +export MANPATH=~/.local/share/man:/opt/texlive/2019/texmf-dist/doc/man:./arduino/java/man:$MANPATH export GTK_IM_MODULE=xim export QT_IM_MODULE=xim +export QT_QPA_PLATFORMTHEME=qt5ct alias ls='ls --color=auto' alias grep='grep --color=auto' diff --git a/shell/.local/bin/ac3fix b/shell/.local/bin/ac3fix new file mode 100755 index 0000000..4b46afe --- /dev/null +++ b/shell/.local/bin/ac3fix @@ -0,0 +1,11 @@ +#!/bin/bash +if [ $# -eq 0 ] +then + echo "Usage $0 [file1 [file2 ..]]" >&2 +fi + +while (( "$#" )) +do + ffmpeg -i "$1" -acodec ac3 -vcodec copy "ac3-$1" + shift +done diff --git a/shell/.local/bin/resize.sh b/shell/.local/bin/resize.sh index 295bcd7..008ef4e 100755 --- a/shell/.local/bin/resize.sh +++ b/shell/.local/bin/resize.sh @@ -40,9 +40,9 @@ while true; do CUR=$((CUR+D*STEP)) STEP=$((STEP/2)) if [[ $PREV -eq $CUR ]]; then break; fi - if [[ $(convert "$1" -resize ${CUR}x png:- | wc -c) -ge $TGT ]]; + if [[ $(convert "$1" -resize ${CUR}x jpg:- | wc -c) -ge $TGT ]]; then D=-1; else D=1; fi echo -n "$CUR," >&2 done echo -e "\b " >&2 -convert "$1" -resize "${CUR}x" png:- +convert "$1" -resize "${CUR}x" jpg:- diff --git a/shell/.local/bin/wipe b/shell/.local/bin/wipe new file mode 100755 index 0000000..9a2717f --- /dev/null +++ b/shell/.local/bin/wipe @@ -0,0 +1,25 @@ +#!/bin/bash +set -ue + +if [ $# -eq 1 ]; then + dev=$1 +elif [ $# -eq 0 ]; then + select dev in $(ls /sys/class/block/); do break; done +else + echo "Usage: $0 [device]" + echo "e.g.: $0 /dev/sda" + exit 1 +fi + +size="$(($(cat "/sys/class/block/$dev/size")*512))" +dev="/dev/$dev" +echo "Select $dev with size $(numfmt --to=iec-i $size) or $size bytes" + +read -p "Are you sure? It will wipe $dev [y/n]" r +if [ "$r" != y ]; then + echo "Answer y to proceed" + exit 1 +fi + +pv -aeprts "$size" /dev/zero | sudo dd of="$dev" bs=4096 +sync diff --git a/vim/.vimrc b/vim/.vimrc index 42d87df..3479ab3 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -5,6 +5,8 @@ autocmd! bufwritepost .vimrc source % syntax enable filetype indent plugin on color torte + +" Settings set encoding=utf-8 set history=1000 set number @@ -22,8 +24,11 @@ set textwidth=79 set shiftwidth=4 set tabstop=4 set nowrap - -" List characters to mark trailing whitespace etc +set lazyredraw +set smartcase +set ignorecase +set scrolloff=1 +set sidescrolloff=1 set listchars=nbsp:¬,tab:▸\ ,eol:↩,extends:»,precedes:«,trail:• set list @@ -57,7 +62,7 @@ map Q set foldmethod=marker set foldlevelstart=99 -" Unbind arrow keys, who has them anyways on the keyboard... +" Unbind arrow keys, who has them anyway on the keyboard... for prefix in ['i', 'n', 'v'] for key in ['', '', '', ''] exe prefix . "noremap " . key . " " @@ -80,6 +85,3 @@ let g:syntastic_check_on_wq = 0 " Vimtex options let g:vimtex_compiler_enabled = 0 - -" Background transparency -hi Normal guibg=NONE ctermbg=NONE -- 2.20.1