Skip to content

Instantly share code, notes, and snippets.

View ohmrefresh's full-sized avatar

Ohm ohmrefresh

  • Bangkok, Thailand
View GitHub Profile
@ohmrefresh
ohmrefresh / error.log
Last active June 10, 2019 12:48
java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.SSL.renegotiatePending(J)I
2019-06-10T19:40:17.484+07:00|org.apache.tomcat.util.net.NioEndpoint|[]Error running socket processor
java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.SSL.renegotiatePending(J)I
at org.apache.tomcat.jni.SSL.renegotiatePending(Native Method) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.tomcat.util.net.openssl.OpenSSLEngine.getHandshakeStatus(OpenSSLEngine.java:1037) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.tomcat.util.net.openssl.OpenSSLEngine.wrap(OpenSSLEngine.java:458) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
at javax.net.ssl.SSLEngine.wrap(SSLEngine.java:469) ~[?:1.8.0_212]
at org.apache.tomcat.util.net.SecureNioChannel.handshakeWrap(SecureNioChannel.java:440) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.tomcat.util.net.SecureNioChannel.handshake(SecureNioChannel.java:211) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1392) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.tomcat.u
@ohmrefresh
ohmrefresh / Dockerfile
Last active June 9, 2019 17:00
Build tomcat native with centos 7 & java-1.8.0-openjdk-1.8.0.212
FROM centos
RUN yum install -y wget curl tar unzip bind sudo gcc make tar
# RUN yum install -y apr
RUN cd /tmp && wget https://www-us.apache.org/dist/tomcat/tomcat-connectors/native/1.2.21/source/tomcat-native-1.2.21-src.tar.gz && tar -zxvf tomcat-native-1.2.21-src.tar.gz
# # ======== Install Middleware =========
RUN yum install -y http://mirror.centos.org/centos/7/updates/x86_64/Packages/java-1.8.0-openjdk-devel-1.8.0.212.b04-0.el7_6.x86_64.rpm
RUN yum install apr-devel openssl-devel -y
# Edit ~/.bash_profile
export GOPATH=/Users/xxxxx/go
export PATH=$GOPATH/bin:$PATH
@ohmrefresh
ohmrefresh / README.md
Created September 16, 2018 06:32 — forked from rambabusaravanan/README.md
GitLab CI Configuration YAML

Firebase Deployment

Step 1: Get Token

Generate the firebase token from your terminal using the command $ firebase login:ci

Waiting for authentication...

✔ Success! Use this token to login on a CI server:

1/VXXXXXXX--YOUR-FIREBASE-CI-TOKEN--XXXXXh92o

@ohmrefresh
ohmrefresh / flex layout
Created June 23, 2018 02:15
flex layout
{
"type": "bubble",
"styles": {
"footer": {
"separator": true
}
},
"body": {
"type": "box",
"layout": "vertical",
@ohmrefresh
ohmrefresh / cspheader.php
Created April 15, 2018 14:28 — forked from phpdave/cspheader.php
CSP Header for PHP or Apache or .htaccess - Content Security Protocol
<?
//CSP only works in modern browsers Chrome 25+, Firefox 23+, Safari 7+
$headerCSP = "Content-Security-Policy:".
"connect-src 'self' ;". // XMLHttpRequest (AJAX request), WebSocket or EventSource.
"default-src 'self';". // Default policy for loading html elements
"frame-ancestors 'self' ;". //allow parent framing - this one blocks click jacking and ui redress
"frame-src 'none';". // vaid sources for frames
"media-src 'self' *.example.com;". // vaid sources for media (audio and video html tags src)
"object-src 'none'; ". // valid object embed and applet tags src
"report-uri https://example.com/violationReportForCSP.php;". //A URL that will get raw json data in post that lets you know what was violated and blocked
sudo true
# Alternatively you can use the official docker install script
wget -qO- https://get.docker.com/ | sh
# Install docker-compose
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9][0-9]+\.[0-9]+$" | tail -n 1`
sudo sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
sudo sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"
@ohmrefresh
ohmrefresh / gist:9839107969dcb9518dd19ebf40898048
Created June 10, 2017 03:43
Page Optimisation with Mod_Pagespeed
http://www.modpagespeed.com/
<VirtualHost *:80>
# mod_pagespeed configuration
ModPagespeedEnableFilters lazyload_images
ModPagespeedDisableFilters inline_css
</VirtualHost>
pagespeed.conf
@ohmrefresh
ohmrefresh / openssl_encrypt_decrypt.php
Created May 13, 2017 05:07 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@ohmrefresh
ohmrefresh / 01_Laravel 5 Simple ACL manager_Readme.md
Created June 19, 2016 16:40 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php