Restructure repository: organize tools by purpose, create what search tool
- Move single-file tools to tools/ organized by category (security, forensics, data, etc.) - Move multi-file projects to projects/ (go-tools, puzzlebox, timesketch, rust-tools) - Move system scripts to scripts/ (proxy, display, setup, windows) - Organize config files in config/ (shell, visidata, applications) - Move experimental tools to archive/experimental - Create 'what' fuzzy search tool with progressive enhancement (ollama->fzf->grep) - Add initial metadata database for intelligent tool discovery - Preserve git history using 'git mv' commands
This commit is contained in:
76
scripts/setup/automountctl
Executable file
76
scripts/setup/automountctl
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/bin/bash
|
||||
command="${1}"
|
||||
|
||||
# test if gsettings tool is installed
|
||||
if ! (which gsettings 1>/dev/null) ; then
|
||||
echo "need gsettings"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#test for existing mate settings
|
||||
if (gsettings get org.mate.media-handling automount 1>/dev/null 2>/dev/null) ; then
|
||||
mate=1
|
||||
fi
|
||||
|
||||
#test for existing gnome settings
|
||||
if (gsettings get org.gnome.desktop.media-handling automount 1>/dev/null 2>/dev/null) ; then
|
||||
gnome=1
|
||||
fi
|
||||
|
||||
#test if at least one of the known settings where found
|
||||
if [ -z $mate ] && [ -z $gnome ] ; then
|
||||
echo "No supported Settings found"
|
||||
echo "mate : org.mate.media-handling automount"
|
||||
echo "gnome: org.gnome.desktop.media-handling automount"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case ${command} in
|
||||
on)
|
||||
echo "turning on"
|
||||
if [[ $mate -eq "1" ]] ; then
|
||||
gsettings set org.mate.media-handling automount true
|
||||
gsettings set org.mate.media-handling automount-open true
|
||||
fi
|
||||
if [[ $gnome -eq "1" ]] ; then
|
||||
gsettings set org.gnome.desktop.media-handling automount true
|
||||
gsettings set org.gnome.desktop.media-handling automount-open true
|
||||
fi
|
||||
;;
|
||||
off)
|
||||
echo "turning off"
|
||||
if [[ $mate -eq "1" ]] ; then
|
||||
gsettings set org.mate.media-handling automount false
|
||||
gsettings set org.mate.media-handling automount-open false
|
||||
fi
|
||||
if [[ $gnome -eq "1" ]] ; then
|
||||
gsettings set org.gnome.desktop.media-handling automount false
|
||||
gsettings set org.gnome.desktop.media-handling automount-open false
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Status:"
|
||||
if [[ $mate -eq "1" ]] ; then
|
||||
echo "# mate-settings found:"
|
||||
echo " - org.mate.media-handling automount :"
|
||||
echo -n " "
|
||||
gsettings get org.mate.media-handling automount
|
||||
echo " - org.mate.media-handling automount-open :"
|
||||
echo -n " "
|
||||
gsettings get org.mate.media-handling automount-open
|
||||
fi
|
||||
|
||||
if [[ $gnome -eq "1" ]] ; then
|
||||
echo "# gnome-settings found:"
|
||||
echo " - org.gnome.desktop.media-handling automount :"
|
||||
echo -n " "
|
||||
gsettings get org.gnome.desktop.media-handling automount
|
||||
echo " - org.gnome.desktop.media-handling automount-open :"
|
||||
echo -n " "
|
||||
gsettings get org.gnome.desktop.media-handling automount-open
|
||||
fi
|
||||
echo "-------------------"
|
||||
echo "usage:"
|
||||
echo " $0 on : turn on automount"
|
||||
echo " $0 off : turn off automount"
|
||||
esac
|
||||
6
scripts/setup/share.sh
Executable file
6
scripts/setup/share.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
#ifconfig eth1 10.10.10.1/24
|
||||
sysctl -w net.ipv4.conf.all.forwarding=1
|
||||
iptables -t nat -F
|
||||
iptables -t nat -A POSTROUTING -o eno1 -j MASQUERADE
|
||||
|
||||
35
scripts/setup/terminal-logs.sh
Normal file
35
scripts/setup/terminal-logs.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
disablefile=$(realpath ~/.notermlogs)
|
||||
if [[ -f "${disablefile}" ]] ; then
|
||||
echo "${disablefile} exists > Terminal - Logging is disabled"
|
||||
else
|
||||
if [[ -z "${termlogpid}" ]] ; then
|
||||
export termlogpid="$(echo $$)"
|
||||
export termlogsdir="${HOME}/termlogs"
|
||||
export termlogfilename="${termlogsdir}/$(date +%Y-%m-%d_%H:%M:%S)_${termlogpid}"
|
||||
if ! [[ -d "${termlogsdir}" ]] ; then
|
||||
echo "Terminal log folder does not exist. ${termlogsdir} will be created..."
|
||||
mkdir -v -p "${termlogsdir}"
|
||||
fi
|
||||
#Cleanup old files
|
||||
echo "Removin Terminal Logs older than 30 days:"
|
||||
find "${termlogsdir}" -type f -mtime +30
|
||||
find "${termlogsdir}" -type f -mtime +30 -delete
|
||||
|
||||
#prepare outputfiles with proper permissions
|
||||
touch "${termlogfilename}.termlog"
|
||||
chmod 600 "${termlogfilename}.termlog"
|
||||
touch "${termlogfilename}.termtime"
|
||||
chmod 600 "${termlogfilename}.termtime"
|
||||
#start logged session
|
||||
script -t"${termlogfilename}.termtime" "${termlogfilename}.termlog"
|
||||
#clean up after exiting
|
||||
gzip "${termlogfilename}.termlog"
|
||||
if [[ -f "/tmp/disablescreenrecord_${termlogpid}" ]] ; then
|
||||
echo "Recording stopped for this session"
|
||||
else
|
||||
exit
|
||||
fi
|
||||
else
|
||||
alias stop_termlog="touch /tmp/disablescreenrecord_${termlogpid} ; exit"
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user