Skip to content

Instantly share code, notes, and snippets.

View Paradoxis's full-sized avatar
:shipit:
Security Person

Luke Paris Paradoxis

:shipit:
Security Person
View GitHub Profile
@Paradoxis
Paradoxis / http-to-ws.js
Last active April 16, 2024 21:02
Convert WS/HTTP links with JavaScript
/**
* Converts an HTTP(S) url to a WS(S) URL
* Example:
* httpUrlToWebSockeUrl("http://www.example.com/") -> ws://www.example.com/
* httpUrlToWebSockeUrl("https://www.example.com/") -> wss://www.example.com/
*
* @param {string} url
* @return {string}
*/
function httpUrlToWebSockeUrl(url)
@Paradoxis
Paradoxis / agressive-url-encode.md
Last active February 10, 2024 23:00
Agressive URL encode

Agressive URL encode

Python based CLI tool to agressively url-encode strings, rather than just encoding non-url characters this tool will encode every character in the URL.

Usage:

Firstly make a function in your .bash_profile to call the script

function url-encode()
{
 python ~//url_encode.py $@
@Paradoxis
Paradoxis / slack_delete.py
Last active January 30, 2024 17:30 — forked from jackcarter/slack_delete.py
Delete all Slack files. Usage: python slack_delete.py --token <your token>
import argparse
import requests
import time
import json
def main():
"""
Entry point of the application
:return: void
@Paradoxis
Paradoxis / findReplace.js
Created July 4, 2016 10:23
Find and replace double curly braces in JavaScript, example: findReplace("Hello, {{ name }}", "name", "John"); // "Hello, John"
/**
* Format double braced template string
* @param {string} string
* @param {string} find
* @param {string} replace
* @returns {string}
*/
function findReplaceString(string, find, replace)
{
if ((/[a-zA-Z\_]+/g).test(string)) {
@Paradoxis
Paradoxis / url-decode.md
Created May 31, 2017 11:10
URL decode CLI

Agressive URL encode

Python based CLI tool to url-decode strings

Usage:

Firstly make a function in your .bash_profile to call the script

function url-decode()
{
 python ~//url_decode.py $@
@Paradoxis
Paradoxis / findReplace.php
Last active March 14, 2022 13:30
Find and replace double curly braces in PHP, example: findReplace("Hello, {{ name }}", "name", "John"); // "Hello, John" Raw
<?php
/**
* Parses a template argument to the specified value
* Template variables are defined using double curly brackets: {{ [a-zA-Z] }}
* Returns the query back once the instances has been replaced
* @param string $string
* @param string $find
* @param string $replace
* @return string
@Paradoxis
Paradoxis / daemonize.go
Created December 4, 2021 12:30
GoLang - Daemonize a own process on runtime (MacOS / Linux)
package main
import (
"os"
"time"
"syscall"
)
func main() {
daemonize()
@Paradoxis
Paradoxis / is_development_install.py
Created August 9, 2021 09:56
Checks if a package is installed using an installable flag '-e' without use of pip's internal API
def is_development_install(package: str) -> bool:
"""Check if we're running a development installation"""
import pkg_resources
file = Path(dirname(pkg_resources.__file__)).parent
file = file.joinpath(package.replace('_', '-') + '.egg-link')
return file.exists()
@Paradoxis
Paradoxis / FbAdsSdkExample.cs
Last active March 10, 2021 04:56
Example of how to use the FacebookAds SDK for C#
using System;
using System.Collections.Generic;
using Facebook;
using FacebookAds;
using FacebookAds.Object;
using FacebookAds.Object.Fields;
namespace FacebookAdsExamples
{
@Paradoxis
Paradoxis / README.md
Last active February 26, 2021 16:16 — forked from rduplain/README.md
Connect to MSSQL using FreeTDS / ODBC in Python.

Goal: Connect to MSSQL using FreeTDS / ODBC in Python.

Host: Ubuntu 16.04 x86_64

Install:

sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy

In /etc/odbcinst.ini: