Skip to content

Instantly share code, notes, and snippets.

View psamsotha's full-sized avatar

Paul Samsotha psamsotha

View GitHub Profile
@psamsotha
psamsotha / Dockerfile
Created July 4, 2023 05:32 — forked from matt-bertoncello/Dockerfile
Dockerfile and python script to run selenium with headless chromedriver in debian docker container.
# define base image as python slim-buster.
FROM python:3.7-slim-buster as base
## start builder stage.
# this is the first stage of the build.
# it will install all requirements.
FROM base as builder
# install all packages for chromedriver: https://gist.github.com/varyonic/dea40abcf3dd891d204ef235c6e8dd79

Often referred to as the "swiss army of knife" for TCP/IP networking, [Netcat][1] is an extremely versatile Linux utility that allows you to do anything under the sun using TCP/UDP sockets. It is one of the most favorite tools for system admins when they need to do networking related troubleshooting and experimentation.

In this tutorial, I am sharing a few useful netcat examples, although the sky is the limit when it comes to possible netcat use cases. If you are using netcat regularly, feel free to share your use case.

Note that when you are binding to well-known ports (0-1023) with nc, you need root privilege. Otherwise, run nc as a normal user.

1. Test if a particular TCP port of a remote host is open.

$ nc -vn 192.168.233.208 5000
@psamsotha
psamsotha / .gitignore
Created April 16, 2021 18:41 — forked from hughbiquitous/.gitignore
.gitignore for Java/IntelliJ/gradle
# From https://github.com/github/gitignore/blob/master/Gradle.gitignore
.gradle
/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
"clang -o conftest -I/opt/vagrant/embedded/include/ruby-2.6.0/x86_64-darwin19 -I/opt/vagrant/embedded/include/ruby-2.6.0/ruby/backward -I/opt/vagrant/embedded/include/ruby-2.6.0 -I. -I/opt/vagrant/embedded/include -mmacosx-version-min=10.9 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/vagrant/embedded/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/opt/vagrant/embedded/include -mmacosx-version-min=10.9 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fno-common -pipe conftest.c -L. -L/opt/vagrant/embedded/lib -L/opt/vagrant/embedded/lib -L. -mmacosx-version-min=10.9 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fstack-protector-strong -L/opt/vagrant/embedded/lib -lruby.2.6 "
clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot]
In file included from conftest.c:1:
In file included from /opt/vagrant/embedded/include/ruby-2.6.0/ruby.h:33:
In file inc
INFO global: Vagrant version: 2.2.15
INFO global: Ruby version: 2.6.6
INFO global: RubyGems version: 3.0.3
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/bin/vagrant"
INFO global: VAGRANT_NO_PLUGINS="1"
INFO global: VAGRANT_DISABLE_PLUGIN_INIT="1"
INFO global: VAGRANT_LOG="debug"
import org.glassfish.hk2.api.Factory;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.server.ContainerRequest;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.server.internal.inject.AbstractContainerRequestValueFactory;
import org.glassfish.jersey.server.model.Parameter;
import org.glassfish.jersey.server.spi.internal.ValueFactoryProvider;
import org.glassfish.jersey.test.JerseyTest;
import org.junit.Test;
import java.io.IOException;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import java.io.Closeable;
import java.util.function.Supplier;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
package com.example;
import java.io.IOException;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Method;
import javax.ws.rs.GET;