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
@jurigis
jurigis / RestProxyTemplate.java
Last active December 2, 2022 16:05 — forked from davidtimmerman/RestProxyTemplate.java
Spring RestTemplate with proxy settings and proxy authentication
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.ProxyAuthenticationStrategy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@kekru
kekru / add CA cert on CentOS Debian Ubuntu.md
Last active May 17, 2024 02:38
Add CA cert to local trust store on CentOS, Debian or Ubuntu
  • Open a webpage that uses the CA with Firefox
  • Click the lock-icon in the addressbar -> show information -> show certificate
  • the certificate viewer will open
  • click details and choose the certificate of the certificate-chain, you want to import to CentOS
  • click "Export..." and save it as .crt file
  • Copy the .crt file to /etc/pki/ca-trust/source/anchors on your CentOS machine
  • run update-ca-trust extract
  • test it with wget https://thewebsite.org
@yangxuan8282
yangxuan8282 / emoji-info.sh
Last active October 14, 2023 07:26
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
@mvisonneau
mvisonneau / gitlab_to_jira.py
Created August 11, 2017 15:54
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
@philipz
philipz / Readme.md
Last active April 5, 2022 18:53
GitLab Runner on a Kubernetes cluster
  1. Create namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: gitlab
  1. kubectl create -f ./namespace.yaml
@benoitdevos
benoitdevos / WebConfig.java
Last active March 19, 2022 19:29
Adding support for application/octet-stream in RestController (Spring Boot) - java version
package mycompany.myappp.config;
import org.apache.commons.io.IOUtils;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpInputMessage;
import org.springframework.http.HttpOutputMessage;
import org.springframework.http.MediaType;
import org.springframework.http.converter.AbstractHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.HttpMessageNotReadableException;
@styblope
styblope / docker-api-port.md
Last active June 7, 2024 15:21
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"]}
    
@asvignesh
asvignesh / Build_seed_iso
Created January 6, 2018 07:42
Samples to create a cloud-init configuration ISO.
$ genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data
@zoilomora
zoilomora / README.md
Last active May 13, 2024 16:49
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:

@SarasaGunawardhana
SarasaGunawardhana / install-on-all-node.sh
Last active October 25, 2020 22:21
Prerequisites for Setup Kubenetes Cluster. You should install these things on each server.
#!/bin/bash
## Generic installation on all nodes
sysctl -w net.ipv4.ip_forward=1
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
swapoff -a
sed -i '2s/^/#/' /etc/fstab