• Stars
    star
    348
  • Rank 121,508 (Top 3 %)
  • Language
    Go
  • License
    Other
  • Created almost 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Get a free and open tcp port that is ready to use

FreePort

Get a free open TCP port that is ready to use.

Command Line Example:

# Ask the kernel to give us an open port.
export port=$(freeport)

# Start standalone httpd server for testing
httpd -X -c "Listen $port" &

# Curl local server on the selected port
curl localhost:$port

Golang example:

package main

import "github.com/phayes/freeport"

func main() {
	port, err := freeport.GetFreePort()
	if err != nil {
		log.Fatal(err)
	}
	// port is ready to listen on
}

Installation

Mac OSX

brew install phayes/repo/freeport

CentOS and other RPM based systems

wget https://github.com/phayes/freeport/releases/download/1.0.2/freeport_1.0.2_linux_386.rpm
rpm -Uvh freeport_1.0.2_linux_386.rpm

Ubuntu and other DEB based systems

wget wget https://github.com/phayes/freeport/releases/download/1.0.2/freeport_1.0.2_linux_amd64.deb
dpkg -i freeport_1.0.2_linux_amd64.deb

Building From Source

sudo apt-get install golang                    # Download go. Alternativly build from source: https://golang.org/doc/install/source
go get github.com/phayes/freeport

More Repositories

1

geoPHP

Advanced geometry operations in PHP
PHP
845
star
2

sidefuzz

Fuzzer to automatically find side-channel (timing) vulnerabilities
Rust
99
star
3

hookserve

HookServe is a small golang utility for receiving github webhooks.
Go
64
star
4

permbits

Easy file permissions for golang. Easily get and set file permission bits.
Go
51
star
5

ecies-ed25519

ECIES on Twisted Edwards Curve25519 using AES-GCM and HKDF-SHA256
Rust
29
star
6

tallystick

A rust library for tallying votes
Rust
29
star
7

deadci

Dead Easy Continuous Integration and Testing
Go
21
star
8

polars_gdal

Read GDAL compatible file formats into polars / geopolars
Rust
17
star
9

rsa-fdh

RSA-FDH blind signature scheme using RSA and a Full Domain Hash
Rust
8
star
10

geojump

Drupal 7: Provides an openlayers-behavior that allows a user to type an address and go to that location the map
JavaScript
7
star
11

vuetify-survey

Build simple questionnaires and surveys declaratively
JavaScript
6
star
12

sidefuzz-targets

Fuzzing targets for SideFuzz
Rust
6
star
13

errors

Better error handling for go
Go
6
star
14

geofield_postgis

Drupal 7: PostGIS backend for geofield module
PHP
3
star
15

cryptoid

Cryptography OIDs for golang - useful for juggling ASN.1 crypto data structures
Go
3
star
16

crawlbot

A simple, efficient, and flexible webcrawler / spider for go
Go
3
star
17

fdh-rs

Full Domain Hash library for rust
Rust
3
star
18

uncaptchalous

Drupal 7: Unobtrusive form spam filter
JavaScript
3
star
19

SaganSearch

Searching for artifical messages in pi
Rust
2
star
20

mgit

git multiplexer
Go
2
star
21

mysqlchecksize

A small utility for checking disk space used by mysql databases
Go
2
star
22

go-drupal

Interface with a Drupal site using golang, execute drush commands
PHP
2
star
23

benaloh-challenge

Benaloh Challenge (aka Interactive Device Challenge)
Rust
2
star
24

decryptpem

Decrypts encrypted PEM files and blocks. Provides (optional) TTY prompt for input for password.
Go
1
star
25

cryptocourse

Course work from Coursea Crytography course
Go
1
star
26

polars_geos

use GEOS geospatial function inside polars and geopolars
Rust
1
star
27

sagent

Generate a re-usable ssh-agent for ssh key forwarding
1
star
28

fimble

Simple command-line File Integrity Monitoring
Rust
1
star
29

wonderdraft_assets

A collection of assets for wonderdraft (cartography)
1
star
30

triggerfail

fail a command with an exit status of 1 if a trigger string appears in it's output
Go
1
star
31

cloudflare2

Fork of Drupal's CloudFlare module
PHP
1
star
32

elasticentityquery

Drupal module provides an elasticsearch EntityQuery backend
PHP
1
star