hook

How to discover a file is changed in GIT during a push

£可爱£侵袭症+ 提交于 2019-12-11 02:13:04
问题 when I push something to my GIT repository, the post-receive hook is triggered and executes some scripts. Is it possible doing something before the execution these scripts if (and only if) a specific file is changed respect to the previous push (for example .sql file)? Thanks Randomize 回答1: In the same post-receive hook as a first step or in a pre-receive or update hook, you can use git diff-tree --name-status -rz and pass in the new and old ref that are passed in to the hook ( either stdin

Git: Post-update hook that runs a script that needs access to all files in the repository

偶尔善良 提交于 2019-12-11 01:29:30
问题 I'm running into a bit of dilemma at the moment in that I need a script to run whenever the remote repository is updated (ie, whenever someone runs git push) that builds packages from the files in the repository. These packages are then placed into a directory on the git server that's exposed to clients over HTTP for future use. The problem is, I'm not sure how to access the files in the repository in the post-update hook. If anyone can give some insight, it would be much appreciated. 回答1:

Xposed - How to hook the private static method

点点圈 提交于 2019-12-11 00:08:08
问题 Xposed question: I want to modify some static field in android.os.Build, such as android.os.Build.BOARD, android.os.Build.DEVICE, android.os.Build.DISPLAY. There are 3 private static methods ( private static String getString(String property), private static String[] getStringList(String property, String separator) , private static long getLong(String property) ) in Build.java. Then I tried to hook the static method 'getString(String s)' in android.os.Build . public void handleLoadPackage

delphi Hook SetClipboardData from user32.dll

北城余情 提交于 2019-12-10 23:32:01
问题 i've this component that i want to use it in a DLL to achieve a system-wide hook : unit ClipboardHook; interface uses Windows, SysUtils, Classes, ExtCtrls; type TFOnOpenClipboard = procedure(Sender:TObject; hWndNewOwner:HWND; var opContinue:Boolean) of object; TFOnSetClipboardData = procedure(Sender:TObject; hWndNewOwner:HWND; uFormat:DWord; hMem:THandle; var opContinue:Boolean) of object; type TClipboardHook = class(TComponent) private { Private declarations } FOnOpenClipboard

How to hook MANAGED(.NET) Processes and collect information inside that process?

拜拜、爱过 提交于 2019-12-10 23:15:19
问题 I need to hook managed (C#,C++/CLI) processes, I need to find and send information about how many windows it has(its associated controls and their properties)to the target application which is written in C# managed code. For that What I need to do? Do I need to explore IAT (Import Address Table) & EAT(Export address Table) of that managed process? Do I need to write injector DLL in C++? What else apart from changing IAT and EAT , do I need? [EDIT] I need to attach managed running processes to

Disable hooks for a single git command

流过昼夜 提交于 2019-12-10 23:08:04
问题 Given that I need to use git inside my hook scripts, I would prefer my hook scripts to not trigger hooks themselves. So I want to skip hooks on a per-command basis. i.e. I am looking for an option like: git --no-hooks some-git-command 回答1: You can use: git -c core.hooksPath=/dev/null some-git-command If you are not on an Unix (no /dev/null ) I suppose that you can use: git -c core.hooksPath= some-git-command 来源: https://stackoverflow.com/questions/58337861/disable-hooks-for-a-single-git

SVN hooks not working

最后都变了- 提交于 2019-12-10 21:37:38
问题 I have a server repository of branch and trunk. The branch is all team members' repositories. I'm trying to use svn hooks only in my repo under branch, but it doesn't seem to work fine. In the following are the steps I tried to approach: checked out my_repo from the remote server's branch/my_repo since the local repo my_repo doesn't have any content, I created a new svn repo locally and copied over everything including the /hooks folder to my_repo . I created an empty file in my_repo and

Delphi problems converting VirtualProtect EAT hook routines from C to Delphi

让人想犯罪 __ 提交于 2019-12-10 18:53:19
问题 I'm trying to convert this code which came from CHook forum posting this code which does EAT hooking: #include <Windows.h> #include <Psapi.h> #include <string> #if PSAPI_VERSION == 1 #pragma comment(lib, "Psapi.lib") #endif template <typename DestType, typename SrcType> DestType* ByteOffset(SrcType* ptr, ptrdiff_t offset) { return reinterpret_cast<DestType*>(reinterpret_cast<unsigned char*>(ptr) + offset); } bool eat_hook(void* old_function, void* new_function) { HMODULE hModule;

Is it posible to hook redis before key expired

邮差的信 提交于 2019-12-10 16:40:07
问题 I have set an expiration value to a key in redis, and want to get the opportunity to run a piece of code before the key will be deleted by redis. Is it possible, and if so how...? Thanks 回答1: My solution was to create a new key, with the same name as the one I wanted to hook, only I added a prefix for it indicating it's a key for timeouts usage ("TO") - something like: set key1 data1 set TO_key1 "" expire TO_key1 20 In the example above, as soon as "TO_key1" will expire, it will notify my

How can you block git commits from invalid users?

这一生的挚爱 提交于 2019-12-10 16:26:52
问题 I am running a gitlab git server. Most of my users are running 1 of 3 versions of git. git 1.7.1 (centos users) git 1.7.9 (everyone else) git 1.8.4 (mac users) Some users have accidentally been committing and pushing code as the root user. I need to block commits from those users. My pre-commit hook looks like this: #!/bin/bash if [[ $GIT_AUTHOR_NAME == 'root' ]] then echo "If you commit as root, you're gonna have a bad time"; echo "Set 'git config user.name' and try again"; exit 1; fi This