Skip to content

Instantly share code, notes, and snippets.

View oseme-techguy's full-sized avatar
🙂
The Infinite Improbability Drive!

Odigie Oseme oseme-techguy

🙂
The Infinite Improbability Drive!
View GitHub Profile
@oseme-techguy
oseme-techguy / gist:459c6d7978ee122145d629e960a7e021
Created May 19, 2021 16:12 — forked from mgedmin/gist:9547214
Setting up a Jenkins slave on Linux
# This is how you add a Jenkins slave
# On master:
sudo -u jenkins -H ssh-keygen
# On slave
adduser --system --group --home=/var/lib/jenkins-slave --no-create-home --disabled-password --quiet --shell /bin/bash jenkins-slave
install -d -o jenkins-slave -g jenkins-slave /var/lib/jenkins-slave
$ cat /etc/systemd/system/jenkins.service
[Unit]
Description=Jenkins - open source automation server
Before=multi-user.target
After=network-online.target
[Service]
ExecStart=/etc/init.d/jenkins start
ExecStop=/etc/init.d/jenkins stop
CapabilityBoundingSet=~CAP_SYS_PTRACE
@oseme-techguy
oseme-techguy / rsa.java
Created May 14, 2021 19:27 — forked from jbrown17/rsa.java
Quick, simple implementation of RSA encryption algorithm without external libraries
import java.awt.EventQueue;
import java.io.*;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
/**
* Quick and dirty implementation of the RSA algorithm
@oseme-techguy
oseme-techguy / Knex-Setup.md
Created January 11, 2021 15:45 — forked from NigelEarle/Knex-Setup.md
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init
@oseme-techguy
oseme-techguy / install-comodo-ssl-cert-for-nginx.rst
Created November 21, 2020 13:15 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@oseme-techguy
oseme-techguy / How-to-use-the-Coralpay-JAVA-PGP-library.md
Last active February 25, 2021 13:02
How to use the JAVA PGP library - These are the steps required to use the CoralPay JAVA PGP Library.

These are the steps required to use the CoralPay JAVA PGP Library.
The library's binaries can be downloaded from here: CoralPay JAVA PGP Library Link .

Build the Library:

To build the library, run .\gradlew.bat build --refresh-dependencies
This should build the library file into a .jar in the \build\libs directory.
Copy the library out of the directory to the target project that needs to use the libary
and follow the steps below to add the required dependecies to use with the library for that target project.

@oseme-techguy
oseme-techguy / downgrade.md
Created October 26, 2020 19:27 — forked from jineshqa/downgrade.md
Downgrade Jenkins Version

How to downgrade a jenkins version by command line

  • First locate your jenkins.war file, most of time it is located in /usr/share/jenkins
  • Rename jenkins.war to jenkins.war.old mv jenkins.war jenkins.war.old
  • Get a version from jenkins example: http://updates.jenkins-ci.org/stable-2.32/latest/jenkins.war sudo wget http://updates.jenkins-ci.org/stable-2.32/latest/jenkins.war
  • Now start or restart jenkins service sudo service jenkins restart
@oseme-techguy
oseme-techguy / shallow_update_git.md
Created September 4, 2020 14:40 — forked from gobinathm/shallow_update_git.md
Fix for Remote rejected shallow update not allowed after changing Git remote URL

Some Time there is a shallow update not allowed issue in your cloned GIT repo.

This means that you have to unshallow your repository. To do so you will need to add your old remote again.

git remote add origin <path-to-old-remote> After that we use git fetch to fetch the remaining history from the old remote (as suggested in this answer).

git fetch --unshallow origin And now you should be able to push into your new remote repository.

@oseme-techguy
oseme-techguy / Correct_GnuPG_Permission.sh
Last active October 16, 2024 14:20
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
@oseme-techguy
oseme-techguy / docker_output.py
Created August 1, 2018 06:53 — forked from ifiok/docker_output.py
Docker Python logger output to stdout
import logging
from sys import stdout
# Define logger
logger = logging.getLogger('mylogger')
logger.setLevel(logging.DEBUG) # set logger level
logFormatter = logging.Formatter\
("%(name)-12s %(asctime)s %(levelname)-8s %(filename)s:%(funcName)s %(message)s")
consoleHandler = logging.StreamHandler(stdout) #set streamhandler to stdout