dot

packages and services management
Log | Files | Refs | README

commit dc9ad552d0fa8fdeabf9afa992276bb389cfb0ed
parent d8c99934a984132dad186b80edb8624ba38a362f
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 12 Dec 2017 23:10:19 +0100

Merge branch 'master' of git.josuah.net:srv/git/etc

Diffstat:
Mbin/blih | 6++----
Mbin/fun-troll | 2+-
Mbin/ii-client | 5+++--
Mbin/io-mail | 2+-
Mbin/mblaze-filter | 2+-
Ddot/emacs.d/lisp/std.el | 21---------------------
Ddot/emacs.d/lisp/std_comment.el | 184-------------------------------------------------------------------------------
7 files changed, 8 insertions(+), 214 deletions(-)

diff --git a/bin/blih b/bin/blih @@ -13,7 +13,7 @@ import getpass version = 1.7 class blih: - def __init__(self, baseurl='http://127.0.0.1/', user=None, token=None, verbose=False, user_agent='blih-' + str(version)): + def __init__(self, baseurl='https://blih.epitech.eu/', user=None, token=None, verbose=False, user_agent='blih-' + str(version)): self._baseurl = baseurl if token: self._token = token @@ -52,12 +52,10 @@ class blih: def request(self, resource, method='GET', content_type='application/json', data=None, url=None): signed_data = self.sign_data(data) - print(json.dumps(signed_data)) if url: req = urllib.request.Request(url=url, method=method, data=bytes(json.dumps(signed_data), 'utf8')) else: req = urllib.request.Request(url=self._baseurl + resource, method=method, data=bytes(json.dumps(signed_data), 'utf8')) - print(req) req.add_header('Content-Type', content_type) req.add_header('User-Agent', self._useragent) @@ -251,7 +249,7 @@ if __name__ == "__main__": verbose = False user = None - baseurl = 'http://127.0.0.1/' + baseurl = 'https://blih.epitech.eu/' token = None user_agent = 'blih-' + str(version) diff --git a/bin/fun-troll b/bin/fun-troll @@ -4,7 +4,7 @@ size=`stty size` -hexdump -o /dev/random | tr -dc '0-9' | fold -w 4 | +od /dev/random | tr -dc '0-9' | fold -w 4 | sed -r 's/^(..)(..)/\1 \2/' | while read row col do printf '\033[%s;%sH' "$row" "$col" diff --git a/bin/ii-client b/bin/ii-client @@ -7,9 +7,9 @@ INPUT=$HOME/.cache/ii-client [ $# -eq 0 ] && exec "$0" "$(find "$IRCPATH" -type d | iomenu)" clear -tail -f "$1/out" | eel | while IFS='' read -r line +tail -fn50 "$1/out" | eel | while IFS= read -r line do printf '\r\033[K%s\n> %s' "$line" "$(cat "$INPUT")" -done & +done & pid=$! trap 'tty sane' EXIT @@ -27,6 +27,7 @@ do tail -n 1000 "$1/out"| eel | less ;; (016) # Ctrl + N + pkill -fx "tail -fn50 $1/out" exec "$0" "$(find "$IRCPATH" -type d | iomenu)" ;; (025) # Ctrl + U diff --git a/bin/io-mail b/bin/io-mail @@ -5,5 +5,5 @@ export LC_COLLATE=C mdirs "$MAIL/.." | sort | while IFS='' read -r dir do printf '%s\t%s\n' "$(mlist -s "$dir" | wc -l)" "${dir#$PWD/}" done | iomenu -p mail | cut -f 2 | mlist | mthread | msort -r -d | -mseq -S | mscan -f '%6n %u %D %20f %t%2i%120S' | iomenu -p mail | +mseq -S | mscan -f '%6n %u %D %20f %t%2i%120S' | tee "$HOME/error" | iomenu -p mail | sed -r 's/^ *([0-9]*) .*/\1/'| xargs mless diff --git a/bin/mblaze-filter b/bin/mblaze-filter @@ -47,7 +47,7 @@ repo.or.cz "Subject" ~~~ "*\[repo.or.cz\]*" researchgate.net "From" ~~~ "*@researchgate.*" researchgate.net "From" ~~~ "*@researchgatemail.*" sabotage.tech "Mailing-List" ~~~ "*sabotage*@lists.openwall.com*" -suckless.org "List-Id" ~~~ "*@suckless.org*" +suckless.org "List-Id" ~~~ "*suckless.org*" transports "From" ~~~ "*@captaintrain.com*" transports "From" ~~~ "*BlaBlaCar*" transports "From" ~~~ "*flixbus*" diff --git a/dot/emacs.d/lisp/std.el b/dot/emacs.d/lisp/std.el @@ -1,21 +0,0 @@ -;; -;; EPITECH PROJECT, 2017 -;; emacs configuration -;; File description: -;; global emacs configuration to help students -;; - -(set-variable 'c-argdecl-indent 0) - -(normal-erase-is-backspace-mode 0) - -; Define keyboard shortcuts -(global-set-key "" 'backward-delete-char) -(global-set-key "" 'compile) -(global-set-key "" 'goto-line) - -; Adjust indentation settings -(setq c-default-style "linux" - c-basic-offset 8 - tab-width 8 - indent-tabs-mode t) diff --git a/dot/emacs.d/lisp/std_comment.el b/dot/emacs.d/lisp/std_comment.el @@ -1,184 +0,0 @@ -;; -;; EPITECH PROJECT, 2017 -;; emacs configuration -;; File description: -;; standard epitech header configuration -;; - -(global-set-key "" 'std-file-header) - -(setq header-epitech "EPITECH PROJECT, " - header-description "File description:") - -(setq std-c-alist '( (cs . "/*") (cc . "** ") (ce . "*/") ) - std-css-alist '( (cs . "/*") (cc . "** ") (ce . "*/") ) - std-cpp-alist '( (cs . "//") (cc . "// ") (ce . "//") ) - std-pov-alist '( (cs . "//") (cc . "// ") (ce . "//") ) - std-java-alist '( (cs . "//") (cc . "// ") (ce . "//") ) - std-latex-alist '( (cs . "%%") (cc . "%% ") (ce . "%%") ) - std-lisp-alist '( (cs . ";;") (cc . ";; ") (ce . ";;") ) - std-xdefault-alist '( (cs . "!!") (cc . "!! ") (ce . "!!") ) - std-pascal-alist '( (cs . "{ ") (cc . " ") (ce . "}" ) ) - std-makefile-alist '( (cs . "##") (cc . "## ") (ce . "##") ) - std-text-alist '( (cs . "##") (cc . "## ") (ce . "##") ) - std-fundamental-alist '( (cs . " ") (cc . " ") (ce . " ") ) - std-html-alist '( (cs . "<!--") (cc . " -- ") (ce . "-->")) - std-php-alist '( (cs . "#!/usr/local/bin/php\n<?php") (cc . "// ")(ce . "//")) - std-nroff-alist '( (cs . "\\\"") (cc . "\\\" ") (ce . "\\\"")) - std-sscript-alist '( (cs . "#!/bin/sh") (cc . "## ") (ce . "##")) - std-perl-alist '( (cs . "#!/usr/local/bin/perl -w") (cc . "## ")(ce . "##")) - std-cperl-alist '( (cs . "#!/usr/local/bin/perl -w") (cc . "## ")(ce . "##")) - ) - - -(setq std-modes-alist '(("C" . std-c-alist) - ("C/l" . std-c-alist) - ("CSS" . std-c-alist) - ("PoV" . std-pov-alist) - ("C++" . std-cpp-alist) - ("C++/l" . std-cpp-alist) - ("Lisp" . std-lisp-alist) - ("Lisp Interaction" . std-lisp-alist) - ("Emacs-Lisp" . std-lisp-alist) - ("Fundamental" . std-fundamental-alist) - ("Shell-script" . std-sscript-alist) - ("Makefile" . std-makefile-alist) - ("BSDmakefile" . std-makefile-alist) - ("GNUmakefile" . std-makefile-alist) - ("Perl" . std-cperl-alist) - ("CPerl" . std-cperl-alist) - ("xdefault" . std-xdefault-alist) - ("java" . std-java-alist) - ("latex" . std-latex-alist) - ("Pascal" . stdp-ascal-alist) - ("Text" . std-text-alist) - ("HTML" . std-html-alist) - ("PHP" . std-php-alist) - ("Nroff" . std-nroff-alist) - ("TeX" . std-latex-alist) - ("LaTeX" . std-latex-alist)) - ) - -(defun std-get (a) - (interactive) - (cdr (assoc a (eval (cdr (assoc mode-name std-modes-alist))))) - ) - -(defun std-file-header () - "Puts a standard header at the beginning of the file.\n(According to mode)" - (interactive) - (goto-char (point-min)) - (let ((projname "toto")(projdescription "tiuti")) - (setq projname (read-from-minibuffer - (format "Type project name (RETURN to quit) : "))) - (setq projdescription (read-from-minibuffer - (format "Type short file description (RETURN to quit) : "))) - - (insert-string (std-get 'cs)) - (newline) - (insert-string (concat (std-get 'cc) - header-epitech - (format-time-string "%Y"))) - (newline) - (insert-string (concat (std-get 'cc) - projname)) - (newline) - (insert-string (concat (std-get 'cc) - header-description)) - (newline) - (insert-string (concat (std-get 'cc) - projdescription)) - (newline) - (insert-string (std-get 'ce)) - (newline) - (newline))) - -(defun insert-std-vertical-comments () - "Inserts vertical comments (according to mode)." - (interactive) - (beginning-of-line) - (insert-string (std-get 'cs)) - (newline) - (let ((ok t)(comment "")) - (while ok - (setq comment (read-from-minibuffer - (format "Type comment (RETURN to quit) : "))) - (if (= 0 (length comment)) - (setq ok nil) - (progn - (insert-string (concat (std-get 'cc) comment)) - (newline))))) - (insert-string (std-get 'ce)) - (newline)) - -(defun std-toggle-comment () - "Toggles line comment on or off (according to mode)." - (interactive) - (save-excursion - (let (beg end) - (beginning-of-line) - (setq beg (point)) - (end-of-line) - (setq end (point)) - (save-restriction - (if (not (equal beg end)) - (progn - (narrow-to-region beg end) - (goto-char beg) - (if (search-forward (std-get 'cs) end t) - (progn - (beginning-of-line) - (replace-string (std-get 'cs) "") - (replace-string (std-get 'ce) "")) - (progn - (beginning-of-line) - (insert-string (std-get 'cs)) - (end-of-line) - (insert-string (std-get 'ce))))))))) - ;; (indent-according-to-mode) - (indent-for-tab-command) - (next-line 1)) - -;;; Added by Eole Wednesday May 29 2002, 1:33:55 -;;; Extended bindings for this package and for commenting code - -(global-set-key "h" 'update-std-header) -(global-set-key "" 'std-file-header) - -;;;; Generating local keymaps for exotics modes. - -;;; In CPerl mode, C-c C-h is used to do some help. -;;; so it is C-c C-h h -;;; For working, it requires info pages about perl -(add-hook 'cperl-mode-hook - '(lambda () - (define-key cperl-mode-map "" - 'comment-region) - (define-key cperl-mode-map "h" - 'std-file-header))) - -;; for perl-mode -(add-hook 'perl-mode-hook - '(lambda () - (define-key perl-mode-map "" - 'comment-region))) - -;; for all kind of lisp code -(add-hook 'emacs-lisp-mode-hook - '(lambda () - (define-key emacs-lisp-mode-map "" - 'comment-region))) - -(add-hook 'lisp-mode-hook - '(lambda () - (define-key lisp-mode-map "" - 'comment-region))) - - - -;; for La(TeX)-mode -(add-hook 'tex-mode-hook - '(lambda () - (define-key tex-mode-map "" - 'comment-region))) -