Skip to content

Instantly share code, notes, and snippets.

View c05m0ch405's full-sized avatar
💭
H4ppy

c05m0ch405

💭
H4ppy
  • world
View GitHub Profile
@c05m0ch405
c05m0ch405 / server.py
Created August 24, 2021 17:52 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@c05m0ch405
c05m0ch405 / wp20140226_reset_slugs.php
Created October 11, 2020 23:58 — forked from codearachnid/wp20140226_reset_slugs.php
Reset the slugs on a particular post type to use the default sanitized slugs. To use, add the following code into your theme's functions.php file, ensure that the desired post type is set when calling `wp20140226_reset_slugs('post');` Then navigate to `wp-admin/options-permalink.php` to activate query to reset slugs. Depending on how many posts …
<?php
/**
* Reset the slugs on a particular post type to use the default sanitized slugs
* @param string $post_type filter by post type
* @param int $offset set the paginated post to start
* @param boolean $force_guid_update * WARNING * never enable this
*
* @example add the following code into your theme's functions.php file, ensure
tmux new-session -d -s backend_proj
tmux send-keys -t backend_proj:0 'cd ~/Projects/project-name;poetry shell' C-m
tmux send-keys -t backend_proj:0 './manage.py runserver' C-m
tmux rename-window 'backend_project'
tmux split-window -h
tmux select-window -t backend_proj:0
tmux send-keys -t backend_proj:0 'cd ~/Projects/another-project-name' C-m
tmux send-keys -t backend_proj:0 'yarn start' C-m
tmux split-window -v -t 0
tmux send-keys -t backend_proj:0 'cd ~/Projects/projectname/foldername;poetry shell' C-m
import sys
from scapy.all import *
def make_dns_request(dns_server, domain_name):
answer = sr1(IP(dst=dns_server)/UDP(dport=53)/DNS(rd=1,qd=DNSQR(qname=domain_name)),verbose=3)
print(answer[DNS].summary())
if __name__=='__main__':
make_dns_request(sys.argv[1], sys.argv[2])
import string, random
#============ Word List Gen ============
minimum=eval(input('Please enter the minimum length of any give word to be generated: '))
maximum=eval(input('Please enter the maximum length of any give word to be generated: '))
wmaximum=eval(input('Please enter the max number of words to be generate in the dictionary: '))
alphabet = string.ascii_letters[0:52] + string.digits
string=''
FILE = open("wl.txt","w")
ncat -lk localhost 8080 --sh-exec "ncat www.example.gr 443 --ssl" -vvvv
#! /bin/bash
B="100K"
F="ogg"
ssh <remote_host> ffmpeg -b $B -an -f video4linux2 \
-s 320x240 -r 10 -i /dev/video0 -b $B -f $F - \
| vlc -
# YOUR LOCAL BOX
socat -t0 -T0 tcp4-listen:6667,reuseaddr,fork UDP:localhost:4445
ssh user@remote_server -N -R 6667:localhost:6667
# REMOTE MACHINE
socat -t0 -T0 udp4-recvfrom:4445,reuseaddr,fork tcp:localhost:6667