Skip to content

Instantly share code, notes, and snippets.

@merong
merong / bypass_ssl_insecurities.py
Created September 16, 2023 13:44 — forked from sujit/bypass_ssl_insecurities.py
Selenium Bypass SSL Bad/Revoked Certificates
import sys
from time import sleep
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import WebDriverException
from eliot import start_action, to_file, log_call
# from selenium.webdriver.common.keys import Keys
# from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# from selenium.webdriver.common.by import By
# from selenium.webdriver.support import expected_conditions as EC
@merong
merong / index.html
Created August 15, 2023 00:34 — forked from Shoora/index.html
Slider and Lightbox :: slider (swiper.js) & Lightbox gallery (photoswipe.js)
<h1>
<a title="swiper.js" href="http://idangero.us/swiper/" target="_blank">Swiper.js (4.3.5)</a>
&
<a title="photoswipe" href="http://photoswipe.com/" target="_blank">Photoswipe.js (4.1.1)</a>
- Mobile Native feel slider gallery
</h1>
<p>Combine two of the most powerfull JS plugins (Endless options / Great docs / Fast / Modern / Mobile freindly) - <a title="swiper.js" href="http://idangero.us/swiper/" target="_blank">SWIPER</a> IS PERFECT FOR THIS IDEA BEACUSE OF ITS unique <code>preventClicks</code> Parameter (Prevent accidental unwanted clicks on links during swiping) - <strong>Works like magic</strong>. Also its really <b>hard</b> to find - Code example of working photoswipe combination with any slider out there(slick, flickity, owl etc.) and in general slider & lightbox - so i hope this example be usefull for you.</p>
<!-- Slider main container -->
<div class="swiper-container">
@merong
merong / PDFTableStripper.java
Created July 19, 2022 19:25 — forked from beldaz/PDFTableStripper.java
Class to extract tabular PDF text using PDFBox
/*
* Copyright 2017 Beldaz (https://github.com/beldaz)
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@merong
merong / nginx-tuning.md
Created April 15, 2022 07:35 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

#!/bin/sh
# install stable nginx
# even though nginx will be replaced
# by compiling from source
# this installs latest versions
# of required libs
add-apt-repository -y ppa:nginx/stable \
&& apt-get update \
&& apt-get install -y nginx \
@merong
merong / SimpleXMLElement-node-existence.php
Created June 11, 2021 02:53 — forked from Thinkscape/SimpleXMLElement-node-existence.php
How to check if a <child> node exists in SimpleXMLElement document ? Comparison of different approaches.
<?php
/**
* The only reliable way of determining if a child exists
* in SimpleXMLElement is to use count(). All other methods
* do not work reliably in global or local NS.
*
* NOTE: Error suppresion on @count() is used to suppress
* "PHP Warning: count(): Node no longer exists"
*/
if(!class_exists('SimpleXMLElement')) die("Bonkers");
@merong
merong / logback.xml
Created September 15, 2020 08:08
로그백 기본 설정
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds">
<property name="LOGS_ABSOLUTE_PATH" value="./logs" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<!--pattern>[%d{yyyy-MM-dd HH:mm:ss}][%-5level][%logger{36}] - %msg%n</pattern-->
<pattern> %d{HH:mm:ss.SSS} [%thread] %-5level %class{36}.%M %L - %msg%n </pattern>
</encoder>
</appender>
@merong
merong / nginx_wss_reverse_proxy.conf
Created June 6, 2020 04:39
nginx 리버스 프록시를 사용하여 ws 를 wss로 전환 처리
# nginx에서 웹소켓 reverse proxy 설정은 아래내용을 참조하세요.
# https://www.joinc.co.kr/w/man/12/nginx/wsproxy
#설정 예제
#아래와 같이 설정한 경우 wss주소는
# ws://호스트도메인:9000/ 으로 채팅서버를 실행하였다면,
# wss://호스트도메인:8080/ 이 됩니다.
# 운용하는 채팅서버 아이피가 다른 경우 proxy_pass에 아이피를 지정하시면 됩니다.
@merong
merong / exclude_files.sh
Created May 10, 2020 13:09
bash script build file with exclude files
#!/usr/bash
dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
BASE_PATH=${dir}
BUILD_DIR=${BASE_PATH}/build
TEMP_DIR=${BASE_PATH}/temp
mkdir -p ${TEMP_DIR}
@merong
merong / nginx.conf
Created January 18, 2020 10:40 — forked from CSRaghunandan/nginx.conf
Nginx configuration for serving mp4 videos
#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;