Skip to content

Instantly share code, notes, and snippets.

View axi92's full-sized avatar

axi92 axi92

  • Vienna
  • 12:46 (UTC +02:00)
View GitHub Profile
@axi92
axi92 / README.md
Created June 26, 2025 11:08 — forked from BoGnY/README.md
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@axi92
axi92 / generate.sh
Last active July 22, 2024 13:04
Clone all bitbucket repos from all projects
#!/bin/bash
# generate a script ./clone-repos.sh from a list of repos fetched via Bitbucket API
# note: requires 'curl' and 'jq' to be installed
set -e
ONPREM_USER=""
ONPREM_PASS=""
URL=""
@axi92
axi92 / binary_check.bash
Created June 29, 2023 08:21
Check git for not allowed binaries
#!/bin/bash
# set -e
ERRORS=$(grep -rIL --exclude-dir=.git --exclude=*.png --exclude=*.jpg --exclude=*.crt --exclude=*.ttf . | wc -l)
if [ $ERRORS -gt "0" ]; then
echo '########################################'
echo 'Not allowed binaries are found in repo!'
echo 'Remove them:'
echo ''
@axi92
axi92 / green.xml
Created April 13, 2023 12:33
Junit xml red/green example
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="NPM Audit Advisories">
<testcase name="MODERATE: 1091459 - Server-Side Request Forgery in Request">
</testcase>
<testcase name="HIGH: 1091653 - xml2js is vulnerable to prototype pollution ">
</testcase>
</testsuite>
</testsuites>
@axi92
axi92 / pre-commit
Last active May 18, 2022 14:43
pre-commit git hook prevent binaries from commiting
#!/bin/sh
staginlist=(`git diff --name-only --cached`)
binarylist=()
for filelist in ${staginlist[*]}
do
grep -Iq . ${filelist}
if [ $? -ne 0 ]
then
@axi92
axi92 / sample-server.js
Created October 7, 2021 06:35
Opcua server never exits
/*global require,setInterval,console */
const opcua = require("node-opcua");
// Let's create an instance of OPCUAServer
const server = new opcua.OPCUAServer({
port: 4334, // the port of the listening socket of the server
resourcePath: "/UA/MyLittleServer", // this path will be added to the endpoint resource name
buildInfo: {
productName: "MySampleServer1",
buildNumber: "7658",
@axi92
axi92 / report-ip-to-telegram-bot.sh
Created January 18, 2021 12:30
Send hostname and ip from device via telegram bot to channel or user
#!/bin/bash
TEXT="Hostname: $(hostname) - IP: $(hostname -I | awk '{print $1}')"
CHATID=""
TOKEN=""
curl -s -X POST \
-H 'Content-Type: application/json' \
-d '{"chat_id": "'"${CHATID}"'", "text": "'"${TEXT}"'", "disable_notification": false}' \
https://api.telegram.org/bot${TOKEN}/sendMessage
@axi92
axi92 / gist:b75502aad942d1c775867e111f3f7930
Created July 9, 2020 10:42
Chroot into raspi sd card
sudo proot -q qemu-arm -S /media/user/rootfs # <-mount path
@axi92
axi92 / nexus3-uploader.sh
Created January 21, 2020 09:23
This script uploads a folder with all its files into a sonatype nexus3 repository.
#!/bin/bash
# # ./nexus3-uploader.sh username password repo folder
url="http://domain.com:8081/nexus/repository/$repository/"
if [ $# -eq 0 ]; then
# Read Nexus3 Repository
echo -n "Nexus3 repository: "
read repository
# Read folder to upload
@axi92
axi92 / config.js
Created November 8, 2019 09:27
markdown-css
```
const config = {
"consumer_key": "00000000-0000-0000-0000-000000000000",
"consumerPrivateKey": "-----BEGIN RSA PRIVATE KEY-----\00000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000000000000000000\n00000000000000000000000000000