Skip to content

Instantly share code, notes, and snippets.

View vpnwall-services's full-sized avatar

Vpnwall Services vpnwall-services

View GitHub Profile
@scrapehero
scrapehero / linkedin_scraper.py
Last active December 6, 2021 18:13
Python script to scrape a company details from a public company page on LinkedIn.com. Written as part of How to Scrape educational post - https://www.scrapehero.com/tutorial-scraping-linkedin-for-public-company-data/
from lxml import html
import csv, os, json
import requests
from exceptions import ValueError
from time import sleep
def linkedin_companies_parser(url):
for i in range(5):
try:
@mattia-beta
mattia-beta / ddos.conf
Last active April 27, 2024 22:00
IPtables DDoS Protection for VPS
### 1: Drop invalid packets ###
/sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP
### 2: Drop TCP packets that are new and are not SYN ###
/sbin/iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP
### 3: Drop SYN packets with suspicious MSS value ###
/sbin/iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP
### 4: Block packets with bogus TCP flags ###
@abalter
abalter / argparse1.md
Last active May 30, 2023 11:51
Python Aargparsing Examples

http://stackoverflow.com/a/30493366/188963

Other answers do mention that argparse is the way to go for new Python, but do not give usage examples. For completeness, here is a short summary of how to use argparse:

1) Initialize

import argparse

# Instantiate the parser

parser = argparse.ArgumentParser(description='Optional app description')

@sourcec0de
sourcec0de / haproxy.cfg
Created October 18, 2016 16:04
Here's a sample WORKING haproxy config for websockets / socketio. We were able to get socketio working on an Amazon ELB with just one node, but when we added multiple nodes, we saw weird client issues. So, we decided to use HAProxy on Ubuntu 12.04 and spent significant time trying to get just the right configuration (haproxy.cfg). Note though th…
global
#debug
#daemon
log 127.0.0.1 local0
defaults
log global
option httplog
frontend unsecured *:80
@andrew-d
andrew-d / freeotp-redisplay.py
Created September 21, 2016 07:35
Read a FreeOTP tokens.xml file and display the entries as QR codes
#!/usr/bin/env python
from __future__ import print_function
import base64
import ctypes
import json
import subprocess
import sys
import xml.etree.ElementTree as ET
@mgeeky
mgeeky / pickle-payload.py
Last active December 4, 2023 00:56
Python's Pickle Remote Code Execution payload template.
#!/usr/bin/python
#
# Pickle deserialization RCE payload.
# To be invoked with command to execute at it's first parameter.
# Otherwise, the default one will be used.
#
import cPickle
import sys
import base64
@vburlak
vburlak / wpinstall.sh
Last active April 2, 2024 08:30 — forked from teledirigido/wpinstall.sh
Download and Install Wordpress and Roots/Sage theme via WP-CLI
#!/bin/bash
# This bash script works JUST with WP-CLI
# You can get it from here:
# http://wp-cli.org/
#
# If you don't know what to do with this file:
#
# 1) Install wp-cli on your workspace
# 2) Create a file call wpinstall.sh
@elnappo
elnappo / logstash-suricata.conf
Last active August 22, 2022 06:21
Suricata Logstash Elasticsearch
input {
file {
path => ["/var/log/suricata/eve.json"]
sincedb_path => ["/var/lib/logstash/since.db"]
codec => json
type => "SuricataIDPS"
}
}
filter {
git config --global alias.lola "log --graph --decorate --pretty=oneline --abbrev-commit --all"
@subfuzion
subfuzion / curl.md
Last active May 3, 2024 09:26
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.