Skip to content

Instantly share code, notes, and snippets.

View vincentclee's full-sized avatar
🇺🇸
USA

Vincent Lee vincentclee

🇺🇸
USA
View GitHub Profile
@kfox
kfox / sysctl.conf
Created February 29, 2012 17:32
Linux kernel tuning settings for large number of concurrent clients
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
@stefanschmidt
stefanschmidt / toggle-screen-sharing
Last active November 29, 2023 22:21
Enable/Disable Screen Sharing on OSX
# Enable Screen Sharing
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
# Disable Screen Sharing
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
@esycat
esycat / PrettyPrinter.groovy
Last active December 19, 2023 16:20
A simple way to pretty print nested lists and maps in Groovy.
import static groovy.json.JsonOutput.*
def config = ['test': 'lalala']
println prettyPrint(toJson(config))
@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@eric-wu
eric-wu / nginx.conf
Last active October 27, 2022 01:45
Nginx reverse proxy set up behind a elastic load balancer and in front of a Play web app. Redirects http to https.
# This sets up a nginx reverse proxy behind a load balancer and in front of
# the Play web app. The setup is illustrated as the following:
#
# LB:80 ==> RP:80 ==> (Redirect to https)
# LB:443 ==> RP:8080 ==> Backend:9001
#
# LB -- Load Balancer
# RP -- Reverse Proxy
#
# IMPORTANT: Remove the line `include /etc/nginx/sites-enabled/*` from this config
@jewelsea
jewelsea / JavaFXTrayIconSample.java
Last active November 13, 2023 14:54
Demonstrate using the System Tray (AWT) to control a JavaFX application.
import javafx.application.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.Label;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.stage.*;
import javax.imageio.ImageIO;
import java.io.IOException;
@chrisvfritz
chrisvfritz / index.html
Created November 18, 2014 19:22
Simplest possible HTML template
<!doctype html>
<html>
<head>
<title>This is the title of the webpage!</title>
</head>
<body>
<p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p>
</body>
</html>
@jtomaszon
jtomaszon / sysctl.conf
Last active July 12, 2017 01:29
sysctl compile variables
### IMPROVE SYSTEM MEMORY MANAGEMENT ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 1
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
vm.zone_reclaim_mode = 0
@vitorbritto
vitorbritto / rm_mysql.md
Last active May 20, 2024 19:44
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@rstruber
rstruber / elasticsearch-update-settings.py
Created August 25, 2015 16:30
Example of how to use curator and elasticsearch python api to update index settings
import elasticsearch
import curator
import json
client = elasticsearch.Elasticsearch()
indices = curator.get_indices(client)
# Filter anything older than or equal to 3 days
_filter = curator.build_filter(kindOf='newer_than', value=3, time_unit='days', timestring='%Y.%m.%d')
indices = curator.apply_filter(indices, **_filter)