Questions tagged [hook]
The hook tag has no summary.
47 questions
0
votes
1
answer
105
views
Why does no packet traverse the nat chain in the output or postrouting hook with this ruleset?
I have a machine with the network interface enp0s3 which is assigned the IPv4 address 192.168.20.254. Furthermore, on another machine there is a DNS server listening on the IPv4 address 192.168.20.10. ...
0
votes
1
answer
98
views
Libvirt allow hook to fork
If I have following Libvirt hook in /etc/libvirt/hooks/qemu.d/hook.sh
#!/usr/bin/env bash
if [[ $1 == "SEARCH_FOR_ME" ]]; then
while true; do
sleep 1
done
fi
bash /etc/...
0
votes
1
answer
80
views
Is there a way to disallow a certain combination of commands and options?
Say, I create a new repo, and try to commit. Git shows me
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your ...
2
votes
0
answers
353
views
Difference in behavior when hooking a library function via LD_PRELOAD on Ubuntu and CentOS [closed]
There is a hook function socketHook.c that intercepts socket() calls:
#include <stdio.h>
int socket(int domain, int type, int protocol)
{
printf("socket() has been intercepted!\n");...
0
votes
0
answers
37
views
Using a script output as a file (not to a file)
I have two programs using the same configuration (chatty + pidgin) in ~/.purple but I wish to separate them into different configuration folders.
My goal is to have chatty use only chatty's ...
1
vote
1
answer
320
views
Arch Boot Hook: Allocation zramctl fails to allocate
OS Version: 5.9.14-arch1-1 Kernel
I am trying to figure out how I can load the whole / directory into the RAM when starting up.
I found a little helper here:
https://github.com/arcmags/ramroot
So, ...
0
votes
1
answer
522
views
Execute function in bash on every keystroke in interactive shell
I would like to run a function every time a user presses a key in an interactive bash shell.
I am wondering if bash has anything built in like the self-insert function in zsh?
Alternatively, I am ...
0
votes
0
answers
134
views
Does linux support the functionality provided by Windows HKEY_CLASSES_ROOT URL protocol trigger?
This windows registry magic:
[HKEY_CLASSES_ROOT\shotgun]
@="URL:example Protocol" # <---- URL for this example is example.com
"URL Protocol"=""
[HKEY_CLASSES_ROOT\...
0
votes
2
answers
350
views
rclone mount webdav whenever a certain application is started
I'd like to automatically mount a nextcloud directory (webdav) with my keepass-database in it using rclone whenever I start KeepassXC and unmount it after closing Keepass. Is there any way to do this (...
1
vote
0
answers
267
views
Identify empty VALUE in XML files and return exit command? [closed]
For instance, I have an XML file with the below content and the "NAME" Author and Assignee(s) have empty "VALUE". The main aim is to implement a check that can be applied to find ...
0
votes
1
answer
389
views
Zsh Hook Function Definitions as arguments
I would like to know if it's possible to define hook functions as arguments or env var when launching zsh instead of defining it in .zshrc or prompt.
For example ;
zsh -F preexec() { date } -F chpwd() ...
4
votes
0
answers
242
views
How to run script when switching to specific (already logged in) user
There's plenty of info out there on how to run a script at login (add it to .xprofile etc.), but I'm looking for a solution that will run a script/command not just at login but also every time a ...
0
votes
0
answers
1k
views
How to add crontab task by reboot / poweroff / poweron pc?
I have next record in crontab -e, running with user root.
@reboot /usr/bin/curl --silent --insecure -v -X GET https://<myserver_with_hook>?key=9d722304320de0b074d8da74bf680874&mes='nik-pc ...
0
votes
1
answer
678
views
Tmux hook after-source-file running but not displaying message
I want to write a hook in tmux to show a message that reports the config has been reloaded. Here is my code:
#binding a button to reload this config file
bind r source-file ~/.tmux.conf
#set hook to ...
-1
votes
1
answer
3k
views
Capture output of a command, process it and ONLY then output to terminal
I would like to capture the stdout (as sent to a terminal), and perform some processing after it is output on the terminal (for the user).
I want to know how to grab the output, process and make ...