Skip to content

Instantly share code, notes, and snippets.

View marsyang1's full-sized avatar

marsyang1 marsyang1

  • Taichung,Taiwan
View GitHub Profile
@dsdstudio
dsdstudio / JQPrefixGeneratorStrategy.java
Last active May 20, 2021 00:48
jooq schema ddl jpa entity로 부터 뽑아내기
import org.jooq.codegen.DefaultGeneratorStrategy;
import org.jooq.meta.Definition;
public class JQPrefixGeneratorStrategy extends DefaultGeneratorStrategy {
@Override
public String getJavaClassName(Definition definition, Mode mode) {
return "JQ" + super.getJavaClassName(definition, mode);
}
}
/* using gradle */
// dependencies {
// compile 'com.akamai.edgegrid:edgegrid-signer-google-http-client:2.1.1'
// compile 'com.akamai.edgegrid:edgegrid-signer-core:2.1.1'
// compile 'com.akamai.edgegrid:edgegrid-signer-rest-assured:2.1.1'
// }
package akamai.purge;
import com.akamai.edgegrid.signer.ClientCredential;
@muhammadghazali
muhammadghazali / What is server_names_hash_bucket_size.md
Last active March 11, 2025 03:56
Nginx: What is server_names_hash_bucket_size?

Background

While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.

References

References that have been read so far:

@marsyang1
marsyang1 / SimpleHTTPServer-http-file-server
Last active June 14, 2017 05:16
SimpleHTTPServer-http-file-server-by-python
# http://stackoverflow.com/questions/12571804/lightweight-localhost-file-server-for-mac
cd path/to/files
python -mSimpleHTTPServer
or
python -mSimpleHTTPServer 2343
@daicham
daicham / .gitlab-ci.yml
Last active November 13, 2024 07:47
A sample of .gitlab-ci.yml for a gradle project
image: java:8-jdk
stages:
- build
- test
- deploy
before_script:
# - echo `pwd` # debug
# - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug
@marsyang1
marsyang1 / manager-web.xml
Last active September 7, 2016 03:11
tomcat config xml file
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
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
@marsyang1
marsyang1 / Vagrantfile
Last active August 24, 2016 06:14
vagrant-docker-box
Vagrant.require_version ">= 1.7.4"
# change default synced_folder for convenience
SYNCED_FOLDER = "/home/vagrant/docker-workshop"
# expose ports from guest to host for convenience
FORWARDED_PORT_RANGE = (10200..10250)
Vagrant.configure(2) do |node|
@alex-shpak
alex-shpak / querydsl.gradle
Last active January 9, 2020 05:45
Gradle script for querydsl-apt processor with separate classpath
// apply plugin: 'idea'
sourceSets {
generated.java
main.java.srcDirs += generated.java.srcDirs
}
configurations {
querydslapt
}
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active April 13, 2025 08:51
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@joewiz
joewiz / post-mortem.md
Last active October 16, 2024 07:39
Recovery from nginx "Too many open files" error on Amazon AWS Linux

On Tue Oct 27, 2015, history.state.gov began buckling under load, intermittently issuing 500 errors. Nginx's error log was sprinkled with the following errors:

2015/10/27 21:48:36 [crit] 2475#0: accept4() failed (24: Too many open files)

2015/10/27 21:48:36 [alert] 2475#0: *7163915 socket() failed (24: Too many open files) while connecting to upstream...

An article at http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/ provided directions that mostly worked. Below are the steps we followed. The steps that diverged from the article's directions are marked with an *.

  1. * Instead of using su to run ulimit on the nginx account, use ps aux | grep nginx to locate nginx's process IDs. Then query each process's file handle limits using cat /proc/pid/limits (where pid is the process id retrieved from ps). (Note: sudo may be necessary on your system for the cat command here, depending on your system.)
  2. Added fs.file-max = 70000 to /etc/sysctl.conf