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

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 / update-kernel-dev.sh
Created March 16, 2021 05:52
Update Kernerl headers
sudo yum install "kernel-devel-uname-r == $(uname -r)"
@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 / vm.sh
Created February 17, 2021 09:22
Create KVM VM
sudo virt-install --name=deepin-vm-2 --os-variant="generic" --vcpu=2 --ram=2048 --graphics spice --cdrom=/mnt/data/software/isos/ubuntu-20.04-live-server-amd64.iso --disk size=10,path=/mnt/data/virtual-machines/kvmubu-3 --network bridge=virbr0
@jamesdube
jamesdube / args.sh
Created December 9, 2020 16:22
Bash Args
#!/bin/bash
PARAMS=""
while (( "$#" )); do
case "$1" in
-a|--my-boolean-flag)
MY_FLAG=0
shift
;;
-b|--my-flag-with-argument)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
@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
@jamesdube
jamesdube / emoji-info.sh
Created December 8, 2020 20:28 — forked from yangxuan8282/emoji-info.sh
Emoji❤bash
#!/bin/bash
# run this scripts with `bash emoji-info.sh` or `./emoji-info.sh`
usage() {
cat << EOF
usage: $0 [options] <emoji>
Options:
-h Show this message
-o Octal Escape Sequence