Skip to content

Instantly share code, notes, and snippets.

View xtrcode's full-sized avatar
💢
\o/

xtrcode

💢
\o/
View GitHub Profile
@xtrcode
xtrcode / Middleware.php
Created April 26, 2024 09:51
Laravel Sanctum authentication by request parameter
<?php
// app/Http/Middleware/AuthByGetParam.php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
@xtrcode
xtrcode / froxlor_chown_webapps.sh
Created February 22, 2020 15:07
froxlor webapp hardening
#!/bin/bash -e
#
# this script is intended for use with froxlor to automatically
# set the correct user & group rights for froxlor customers.
# each function (except cleanup) contains specific chmods for
# the desired webapp.
#
# froxlor customer who owns the webspace
@xtrcode
xtrcode / securelist.com.txt
Created January 8, 2020 16:23
github.com/j0k3r/graby siteconfig for kaspersky's securelist.com
# Author: xtrcode
# Set full title
title: //h1[contains(concat(' ',normalize-space(@class),' '),' entry-title ')]
date: //time
author: //a[@rel='author']
# Content is here
body: //div[contains(concat(' ',normalize-space(@class),' '),' entry-content ')]
@xtrcode
xtrcode / hid_usb.ino.c
Created May 12, 2019 16:54
DigiSpark ATtiny85 Example payload for the german keyboard layout to automatically open a terminal (i3wm) and visit a website.
//This the important part, include the De suffixed version instead of the normal one and the rest goes same as the original lib.
// see: https://github.com/adnan-alhomssi/DigistumpArduinoDe
#include "DigiKeyboardDe.h"
int LOOP = 0;
char *payload = "xdg-open https://www.youtube.com/watch?v=dQw4w9WgXcQ & exit";
void setup() {
DigiKeyboard.delay(2000);
@xtrcode
xtrcode / install_i3gaps.sh
Created May 12, 2019 13:11
Install i3-gaps on Ubuntu 18.04
#!/bin/bash
mkdir -p /tmp
cd /tmp
git clone https://github.com/Airblader/xcb-util-xrm
cd xcb-util-xrm
git submodule update --init
./autogen.sh --prefix=/usr
make
sudo make install
@xtrcode
xtrcode / WriteClipboardToPdf.java
Created March 8, 2019 18:27
Write clipboard content into pdf Java
package com.company;
import java.awt.*;
import java.io.*;
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
@xtrcode
xtrcode / copy_syncMap.go
Created February 21, 2019 16:13
Go Create Copy Of sync.Map
func CopySyncMap(m sync.Map) sync.Map {
var cp sync.Map
m.Range(func(k, v interface{}) bool {
vm, ok := v.(sync.Map)
if ok {
cp.Store(k, CopySyncMap(vm))
} else {
cp.Store(k, v)
}