Skip to content

Instantly share code, notes, and snippets.

View jamesdube's full-sized avatar
🛰️
To the moon

James Dube jamesdube

🛰️
To the moon
View GitHub Profile
@jamesdube
jamesdube / README.md
Created March 18, 2022 16:44 — forked from int128/README.md
Example of Envoy TCP Proxy
@jamesdube
jamesdube / Build_seed_iso
Created November 12, 2021 20:57 — forked from asvignesh/Build_seed_iso
Samples to create a cloud-init configuration ISO.
$ genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data
stages:
- build
- push
- cleanup
build:
stage: build
variables:
REGISTRY_SERVER: foo.bar
IMAGE_NAME: vrutkovs-public/openshift-ansible-testing
@Component
public class LogFilter extends OncePerRequestFilter {
private static Logger LOG = LoggerFactory.getLogger(LogFilter.class);
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
LOG.info(request.getRequestURI()); // log the request path.
}

This gist describes the configuration required for Spring reactive WebClient to make a call to an OAuth2 protected resource through OAuth2.0 Client Credentials Grant Type Flow.

Assumption is that the Authorization Server supports OpenId Connect 1.0 specifications.

@jamesdube
jamesdube / gitlab_to_jira.py
Created June 12, 2021 22:09 — forked from mvisonneau/gitlab_to_jira.py
GitLab to Jira issue sync
#!/usr/bin/env python
import gitlab
from jira import JIRA
import urllib3
## Disable urllib3 ssl checks warnings
urllib3.disable_warnings( urllib3.exceptions.InsecureRequestWarning )
## GitLab config
@jamesdube
jamesdube / docker-api-port.md
Created April 1, 2021 21:44 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@jamesdube
jamesdube / README.md
Created March 24, 2021 19:12 — forked from zoilomora/README.md
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@jamesdube
jamesdube / gist:dd1362e9543ccfec756ddb2a41aa830f
Created March 16, 2021 05:51 — forked from jpbougie/gist:1827065
Example of a SOAP request with Finagle
import java.net.InetSocketAddress
import scala.xml.{Elem, XML}
import org.jboss.netty.buffer.ChannelBuffers
import org.jboss.netty.util.CharsetUtil.UTF_8
import com.twitter.finagle.Service;
import com.twitter.finagle.builder.ClientBuilder;
import com.twitter.finagle.http.{Http, RequestBuilder};
import org.jboss.netty.handler.codec.http._
import org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer
import java.net.URL
@jamesdube
jamesdube / gist:7cc933040c666b50a6ac6d5d77f580f5
Created December 9, 2020 10:59 — forked from Khoulaiz/gist:41b387883a208d6e914b
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23