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
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@oseme-techguy
oseme-techguy / nvmnodeinstall.sh
Last active August 31, 2017 14:43 — forked from nimboya/nvmnodeinstall.sh
Install any version of node using nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
# Exit Terminal and Login to use Command
~/.nvm/nvm.sh # this line is not needed at all
nvm install 4.4.5 # Here you can choose your version number
@oseme-techguy
oseme-techguy / es.sh
Created September 1, 2017 07:21 — forked from Globegitter/es.sh
Easy install for elasticsearch on Ubuntu 14.04
cd ~
##If you want to install OpenJDK
#sudo apt-get update
#sudo apt-get install openjdk-8-jre-headless -y
###Or if you want to install Oracle JDK, which seems to have slightly better performance
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
@oseme-techguy
oseme-techguy / java-8-ami.md
Last active September 2, 2017 16:50 — forked from rtfpessoa/java-8-ami.md
[Guide] Install Oracle Java (JDK) 8 on Amazon EC2 Ami
@oseme-techguy
oseme-techguy / node_crypto.js
Created September 11, 2017 17:25 — forked from rojan/node_crypto.js
Encrypt in nodejs and decrypt in php or vice versa
var crypto = require('crypto');
var key = 'MySecretKey12345';
var iv = '1234567890123456';
var cipher = crypto.createCipheriv('aes-128-cbc', key, iv);
var decipher = crypto.createDecipheriv('aes-128-cbc', key, iv);
var text = 'plain text';
var encrypted = cipher.update(text, 'utf8', 'binary');
encrypted += cipher.final('binary');
hexVal = new Buffer(encrypted, 'binary');
@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
@oseme-techguy
oseme-techguy / Correct_GnuPG_Permission.sh
Last active December 22, 2024 19:58
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 / 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 / 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 / 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.