Skip to content

Instantly share code, notes, and snippets.

Avatar

Wojtek T mandhor

View GitHub Profile
@mandhor
mandhor / install_oci8_ubuntu_16.04_php7.1.md
Created Apr 9, 2020 — forked from hewerthomn/install_oci8_ubuntu_16.04_php7.1.md
How to install OCI8 on Ubuntu 16.04 and PHP 7.1
View install_oci8_ubuntu_16.04_php7.1.md
@mandhor
mandhor / nginx-tuning.md
Created Mar 9, 2020 — forked from denji/nginx-tuning.md
NGINX tuning for best performance
View nginx-tuning.md

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.

View reset-opcache.php
<?php
/*
Copyright 2013 Stuart Carnie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@mandhor
mandhor / ebsnvme-id
Created Oct 24, 2018 — forked from lbernail/ebsnvme-id
ebsnvme-id script
View ebsnvme-id
#!/usr/bin/env python2.7
# Copyright (C) 2017 Amazon.com, Inc. or its affiliates.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
View lockrun.c
/*
* $Id: //websites/unixwiz/unixwiz.net/webroot/tools/lockrun.c#8 $
*
* written by : Stephen J. Friedl
* Software Consultant
* Southern California USA
* steve@unixwiz.net
* http://www.unixwiz.net/tools/
*
* ===================================================================
@mandhor
mandhor / redis-migrate.sh
Created Mar 22, 2017 — forked from nicStuff/redis-migrate.sh
Comfort tool for migrating redis keys among instances. Supports KEYS syntax matching, authentication and TTL
View redis-migrate.sh
#!/bin/bash
######
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
# TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
######
@mandhor
mandhor / noip2
Created Apr 18, 2015
noip2 init.d
View noip2
#! /bin/sh
# /etc/init.d/noip2
### BEGIN INIT INFO
# Provides: noip2
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
@mandhor
mandhor / swipeRefreshLayoutRecyclerView.java
Created Apr 8, 2015
SwipeRefreshLayout RecyclerView bug workaround (SwipeRefreshLayout catches scroll up too early - not on top of the list - making it impossible to scroll up recyclerview)
View swipeRefreshLayoutRecyclerView.java
//we have to keep current scroll value somewhere in our fragment
private int overallYScroll = 0;
recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
overallYScroll = overallYScroll + dy;
@mandhor
mandhor / gist:e89d2547eaad7b9ab82b
Created Apr 6, 2015
Convert DP to PX ( android dip dp pixels px )
View gist:e89d2547eaad7b9ab82b
int dp = 123;
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, getResources().getDisplayMetrics());
@mandhor
mandhor / gist:92ce23904437d83e673d
Created Apr 6, 2015
[ SOLUTION ] SwipeRefreshLayout spinner not showing when .setRefreshing(true) called right after creating Fragment. ( android bug solution swiperefreshlayout pull to refresh not showing )
View gist:92ce23904437d83e673d
TypedValue typed_value = new TypedValue();
getActivity().getTheme().resolveAttribute(android.support.v7.appcompat.R.attr.actionBarSize, typed_value, true);
mSwipeRefreshLayout.setProgressViewOffset(false, 0, getResources().getDimensionPixelSize(typed_value.resourceId));
You can’t perform that action at this time.