Skip to content

Instantly share code, notes, and snippets.

View sefacan's full-sized avatar

Sefa Can sefacan

View GitHub Profile
@pauldotknopf
pauldotknopf / HomeController.cs
Last active December 23, 2024 13:23
Render .NET Core ASP.NET MVC ViewComponent to string from controller
public class HomeController : Controller
{
public async Task<string> RenderViewComponent(string viewComponent, object args)
{
var sp = HttpContext.RequestServices;
var helper = new DefaultViewComponentHelper(
sp.GetRequiredService<IViewComponentDescriptorCollectionProvider>(),
HtmlEncoder.Default,
sp.GetRequiredService<IViewComponentSelector>(),
@ueokande
ueokande / benchmark-commands.md
Last active February 7, 2025 07:46 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands

Benchmark commands

Producer

Setup

bin/kafka-topics.sh \
  --zookeeper zookeeper.example.com:2181 \
  --create \
@gnepud
gnepud / gist:4cac79b5e5f5053c1fd6
Last active September 4, 2022 10:09
docker elasticsearch / kibana install plugin
# elasticsearch
docker run --rm -v "$PWD/esdata":/usr/share/elasticsearch/data -v "$PWD/esdata/plugins":/usr/share/elasticsearch/plugins elasticsearch /usr/share/elasticsearch/bin/plugin install marvel-agent
docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data -v "$PWD/esdata/plugins":/usr/share/elasticsearch/plugins -p 9200:9200 -p 9300:9300 --name=elasticsearch elasticsearch
# kibana
mkdir -p kibana/installedPlugins
chmod 777 -R kibana
docker run --rm -v "$PWD/kibana/installedPlugins":/opt/kibana/installedPlugins --link some-elasticsearch:elasticsearch kibana kibana plugin --install elasticsearch/marvel/latest
docker run -d --name kibana -v "$PWD/kibana/installedPlugins":/opt/kibana/installedPlugins --link some-elasticsearch:elasticsearch -p 5601:5601 kibana
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:[email protected]
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
@jedi4ever
jedi4ever / gist:1171128
Created August 25, 2011 16:50
ubuntu tuning
#Here comes my tuning
# https://klaver.it/linux/sysctl.conf
# http://www.kegel.com/c10k.html
# http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-1/
# https://gist.github.com/243632 - vmsappiness
# http://blog.urbanairship.com/blog/2010/09/29/linux-kernel-tuning-for-c500k/
# https://groups.google.com/forum/#!topic/nodejs/0Z34PH_R88o/discussion
# http://serverfault.com/questions/10852/what-limits-the-maximum-number-of-connections-on-a-linux-server
# http://fasterdata.es.net/fasterdata/host-tuning/linux/