Skip to content

Instantly share code, notes, and snippets.

@adnanalbeda
adnanalbeda / multiDialog.tsx
Last active April 24, 2024 12:56
React-RadixUI
import {
Children,
cloneElement,
createContext,
useCallback,
useContext,
useMemo,
useState,
} from "react";
import { Slot, SlotProps } from "@radix-ui/react-slot";
@pyrocat101
pyrocat101 / ip-address-regex.js
Created November 20, 2013 18:44
IPv4 and IPv6 Address RegExp
var IPV4 = /^(25[0-5]|2[0-4][0-9]|1?[0-9][0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}$/,
IPV6 = /^([0-9a-f]){1,4}(:([0-9a-f]){1,4}){7}$/i;
@alexandrosbouzalas
alexandrosbouzalas / cheatsheet.md
Created April 12, 2024 12:40
OSCP Cheatsheet

NMAP

nmap default

nmap -sC -sV TARGET -Pn -oN nmap/scan -p- -v
scan target for pentest
nmap -PN -n -A -sS -p- -oN output.nmap <IP>
-Pn : no ping check (host is up),
-n no dns resolution
-A : detect systeme info
-sT : tcp connect [laisse des traces dans les logs serveurs] (moins impactant que -sS Syn, ne laisse pas de trace dans les logs par defaut)
-p- : port de 0-65535
-oN output.nmap : write utput to file
ajouter un scan udp en parallèle -sU (dns, ipsec ...)
@markasoftware
markasoftware / enterprise_token.rb
Last active April 24, 2024 12:54
OpenProject Enterprise mode for free
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ it doesn't show that enterprise mode is enabled in the settings, but all ################
############ enterprise mode features, such as KanBan boards, are enabled. ################
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
// Find the latest version of this script here:
// https://gist.github.com/rsms/a8ad736ba3d448100577de2b88e826de
//
const EM = 2048
interface FontInfo {
familyName :string
styleName :string
unitsPerEm :int
ascender :int
@adibhanna
adibhanna / keymap.json
Created April 18, 2024 17:55
zed keymaps
[
{
"context": "Editor && VimControl && !VimWaiting && !menu",
"bindings": {
"ctrl-w z": "workspace::ToggleZoom",
"ctrl-w t": "terminal_panel::ToggleFocus",
"g ]": "editor::GoToDiagnostic",
"g [": "editor::GoToPrevDiagnostic",
"g r": "editor::FindAllReferences",
"shift-k": "editor::Hover",
@Webreaper
Webreaper / docker-compose.yml
Last active April 24, 2024 12:49
Sample Docker-compose file which shows how to set up Sonarr, Radarr, Prowlarr, Lidarr, QBittorrent and a VPN container so that all all traffic from the containers is routed through the VPN. Also includes Plex and get_iplayer containers, which are not routed through the VPN.
# Docker compose to set up containers for all services you need:
# VPN
# Sonarr, Radarr, Lidarr, Qbittorrent
# Non-VPN
# Plex, get_iplayer
# Before running docker-compose, you should pre-create all of the following folders.
# Folders for Docker State:
# /volume1/dockerdata. - root where this docker-compose.yml should live
# /volume1/dockerdata/plex - Plex config and DB
# /volume1/dockerdata/sonarr - Sonarr config and DB
@adibhanna
adibhanna / settings.json
Created April 18, 2024 17:56
zed settings
{
"theme": "Gruvbox Dark Hard",
"base_keymap": "VSCode",
"buffer_font_family": "BerkeleyMono Nerd Font",
"buffer_font_size": 15,
"vim_mode": true,
"relative_line_numbers": true,
"cursor_blink": false,
"scrollbar": {
"show": "never"
@maelvls
maelvls / README.md
Last active April 24, 2024 12:49
Ubuntu, libsecret, git-credential-helper

Dealing with secrets

GNOME comes with libsecret. You can use libsecret to store your git credentials:

sudo apt install libsecret-1-0 libsecret-1-dev libglib2.0-dev
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret