Skip to content

Instantly share code, notes, and snippets.

@achillean
achillean / install_shodan.sh
Created April 29, 2011 04:52
Install Shodan Library
$ easy_install shodan
# or easy_install -U shodan
# or pip install shodan
@funkfinger
funkfinger / main.c
Created May 4, 2011 07:23
ATTiny85 3 channel software PWM to drive RGB LED
// based largely on Atmel's AVR136: Low-Jitter Multi-Channel Software PWM Application Note:
// http://www.atmel.com/dyn/resources/prod_documents/doc8020.pdf
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#define CHMAX 3 // maximum number of PWM channels
#define PWMDEFAULT 0x00 // default PWM value at start up for all channels
@benhosmer
benhosmer / udp-port-scanning.txt
Created April 20, 2012 15:31
UDP Port Troubleshooting using netcat
Using the nc command you can scan a port or a range of ports to verify whether a UDP port is open and able to receive traffic.
This first command will scan all of the UDP ports from 1 to 65535 and add the results to a text file:
$ nc -vnzu server.ip.address.here 1-65535 > udp-scan-results.txt
This merely tells you that the UDP ports are open and receive traffic.
Perhaps a more revealing test would be to actually transfer a file using UDP.
@davidbalbert
davidbalbert / gist:6815258
Last active February 29, 2024 16:12
How to install custom SSL certificates on an ASUS RT-N66U running asuswrt-merlin
###########################################
# IMPORTANT NOTE:
#
# As of asuswrt-merlin 380.67 Beta, you
# can now configure SSL certificates from
# the Webui, making these instructions
# unnecessary.
###########################################
@achillean
achillean / simple-export.py
Last active April 16, 2022 16:29
A simple script to search Shodan and output the results as JSON-encoded banners; each line corresponds to a single banner.
#!/usr/bin/env python
"""
A simple script to search Shodan and output the results as JSON-encoded banners;
each line corresponds to a single banner.
Warning: This will use up query credits because it pages through the results!
Usage: python simple-export.py <search query>
"""
# Install via "easy_install shodan"
@kalharbi
kalharbi / load_ajax.js
Created July 2, 2014 05:42
PhantomJS - Load dynamic web page content that uses AJAX
// Original code:
// https://github.com/ariya/phantomjs/blob/master/examples/waitfor.js
// https://github.com/ariya/phantomjs/blob/master/examples/rasterize.js
/**
* Wait until the test condition is true or a timeout occurs. Useful for waiting
* on a server response or for a ui change (fadeIn, etc.) to occur.
*
* @param testFx javascript condition that evaluates to a boolean,
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
@kenjij
kenjij / geoip.sh
Last active February 14, 2024 22:32
Downloading free MaxMind GeoIP file, use with NGINX
# Download the legacy format for NGINX compatibility
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# Unzip
gunzip Geo*.gz
# Copy to /usr/share/GeoIP/
cp Geo*.dat /usr/share/GeoIP/
@segrax
segrax / BSD Youtrack rc script
Last active January 22, 2023 00:12 — forked from artuomvproskunin/BSD Youtrack rc script
Youtrack Startup script
#!/bin/sh
# $FreeBSD: head/devel/youtrack/files/youtrack.in 329474 2013-10-05 16:11:37Z lwhsu $
#
# PROVIDE: youtrack
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Configuration settings for youtrack in /etc/rc.conf:
@phrawzty
phrawzty / 2serv.py
Last active June 19, 2024 05:12
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@PaulSec
PaulSec / vnc_snapshot.py
Last active October 5, 2019 10:25
VNC Snapshot using Torify and vncsnapshot
#!/bin/python
import requests
import threading
import os
API_KEY = "XXXXXXXXXXXXXXXXX"
QUERY = "port:5900 authentication"
class VNCSnapshot(threading.Thread):