git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/localfs/etc/profile.d
diff options
context:
space:
mode:
Diffstat (limited to 'localfs/etc/profile.d')
-rw-r--r--localfs/etc/profile.d/netcatandquit.sh15
-rw-r--r--localfs/etc/profile.d/shellhist.sh28
-rw-r--r--localfs/etc/profile.d/taskd.sh1
3 files changed, 44 insertions, 0 deletions
diff --git a/localfs/etc/profile.d/netcatandquit.sh b/localfs/etc/profile.d/netcatandquit.sh
new file mode 100644
index 0000000..5410051
--- /dev/null
+++ b/localfs/etc/profile.d/netcatandquit.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Harald Pfeiffer, 2017-04-17
+# Quick helper to have an ncat command available which, similarly to netcat -z,
+# terminates the ncat connection as soon as there's a successful establishment.
+#
+# tl;dr fek incomplete replacements 凸ಠ_ಠ)凸
+
+
+# Let's check whether "echo -e" outputs "echo -e", we then will quit
+# (no escape sequences mean no escape, lel.)
+echo -e "moo"|grep -- "-e moo" >/dev/null 2>&1
+[ "$?" -eq 0 ]&&exit 0
+
+alias ncquit='echo -ne "\e[3;12r\e[3H"|ncat'
diff --git a/localfs/etc/profile.d/shellhist.sh b/localfs/etc/profile.d/shellhist.sh
new file mode 100644
index 0000000..4e377fd
--- /dev/null
+++ b/localfs/etc/profile.d/shellhist.sh
@@ -0,0 +1,28 @@
+export HISTTIMEFORMAT="%F %T: "
+export HISTSIZE=5000
+if [ -z "$PROMPT_COMMAND" ]; then
+ case $TERM in
+ xterm*|vte*)
+ if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
+ PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
+ elif [ "${VTE_VERSION:-0}" -ge 3405 ]; then
+ PROMPT_COMMAND="__vte_prompt_command"
+ else
+ PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
+ fi
+ ;;
+ screen*)
+ if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
+ PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
+ else
+ PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
+ fi
+ ;;
+ *)
+ [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
+ ;;
+ esac
+fi
+# ...and now that we have the prompt, make sure history gets updated every time you fire away a command,
+# not only on GRACEFUL session ends.
+export PROMPT_COMMAND="history -a;history -c;history -r;$PROMPT_COMMAND"
diff --git a/localfs/etc/profile.d/taskd.sh b/localfs/etc/profile.d/taskd.sh
new file mode 100644
index 0000000..266737a
--- /dev/null
+++ b/localfs/etc/profile.d/taskd.sh
@@ -0,0 +1 @@
+export TASKDDATA=/var/taskd