Skip to content

Instantly share code, notes, and snippets.

View deanet's full-sized avatar
:octocat:
talk is cheap, show me the code

deanetdavid deanet

:octocat:
talk is cheap, show me the code
View GitHub Profile
@schacon
schacon / gist:1
Created July 15, 2008 18:17
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.
@alertor
alertor / jira-behing-nginx-ssl
Last active April 27, 2023 15:45
Atlassian JIRA behind nginx + SSL
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
@ekinertac
ekinertac / nginx.conf
Created May 6, 2013 10:37
nginx: port forwarding
server{
listen 80;
server_name example.com;
access_log /home/path_to_site/access.log;
error_log /home/path_to_site/error.log;
location / {
proxy_pass http://0.0.0.0:8002;
proxy_set_header Host $host;
@ardianzzz
ardianzzz / 1kb editor
Last active October 28, 2016 09:12
1Kb HTML5 WYSWYG Editor
<html>
<head>
<title>1Kb HTML5 WYSWYG Editor</title>
<style>
.control {
margin:0 0 8px;
}
#editable {
padding:10px;
border:solid 1px #ccc;
@denji
denji / nginx-tuning.md
Last active July 20, 2024 17:33
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.

<?php
$username=$_GET['username'];
$password=$_GET['password'];
$message=$_GET['message'];
$type=$_GET['type'];
$id=$_GET['id'];
if(!$username && !$password && !$message && $type > 7 && $type < 0) { exit(); }
$agent = "Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15";
@igalic
igalic / restore-zimbra-config+mails.sh
Last active August 17, 2023 06:44
Restore Zimbra's ldap, mysql and config from backup, as well as the store
#!/bin/bash
# sources
# https://wiki.zimbra.com/wiki/LDAP_data_import_export
# http://wiki.zimbra.com/wiki/Mysql_Crash_Recovery
# http://wiki.zimbra.com/wiki/CLI_zmvolume
set -e
# set limits as per zmslapadd
ulimit -n 32768
ulimit -c unlimited
@zhanghui9700
zhanghui9700 / config-ceph-with-openstack.sh
Last active June 26, 2023 19:41
install ceph and config openstack glance/cinder to use ceph as it's backend
---
##prapare to install
# for all nodes
sudo useradd -d /home/ceph -m ceph
sudo passwd ceph
echo "ceph ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/ceph
sudo chmod 0440 /etc/sudoers.d/ceph
##admin-node node(ceph and root)
ssh-keygen
@uzyexe
uzyexe / kickstart-for-pxeboot-coreos
Last active January 16, 2018 01:57
Kickstart default PXElinux for coreos
default coreos
prompt 1
timeout 15
display boot.msg
label coreos
menu default
kernel http://<your_server_name>/coreos_production_pxe.vmlinuz
append initrd=http://<your_server_name>/coreos_production_pxe_image.cpio.gz cloud-config-url=http://<your_server_name>/cloud-config.yml
@fillup
fillup / google-example.php
Last active November 30, 2022 08:08
Example of using Google Admin SDK Directory API to get an individual or list of users.
<?php
// Updated 2018-01-24 to work with google/apiclient:^2.0
/*
* Easiest to use composer to install google-api-php-client and generate autoloader
* If you dont want to use composer you can manually include any needed files
*/
include_once 'vendor/autoload.php';
/*
* Email address for admin user that should be used to perform API actions