Skip to content

Instantly share code, notes, and snippets.

View halilim's full-sized avatar

Halil Özgür halilim

View GitHub Profile
@johnwylie70
johnwylie70 / gist:e9be899fdbf42250f035e2467719d0e7
Created March 3, 2021 05:19
Powerlevel 9k 10k Arm64 or x86 status segments on Apple Silicon M1 (zsh, ohmyzsh)
To customise your terminal or iTerm to identify if you are in a Rosetta or Arm64 Architecture terminal,
add the following code in your ~/.zshrc file before the Powerlevel 10k statements.
# MacOS Architecture detection
function prompt_architecture() {
arch_name="$(uname -m)"
if [ "${arch_name}" = "x86_64" ]; then
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
p10k segment -b 7 -f 0 -t 'x86'
else
@dcode
dcode / _CLI_Elasticsearch_Analysis.md
Last active November 20, 2023 17:30
Analyze Elasticsearch on command line using HTTPie and jq

README

Especially when developing new query logic, it's helpful to query elasticsearch from the command line. If your Elasticsearch cluster uses SAML authentication or some other SSO, it's not simple or sometimes not even possible to query using curl directly. I wrote an auth plugin for HTTPie that should greatly simplify this process if you have rights to create API keys via the Kibana dev console (talk to your administrator and see the link below).

This process is also super handy for shell scripting because you can provide fine-grained limits of what your API key can do, making their use much safer and easier to manage than embedding native realm username/passwords.

@mjameswh
mjameswh / rename_es_index.sh
Last active August 18, 2023 20:59
Demonstration of how to rename an ElasticSearch index using the Index Clone API, introduced in ES 7.4. This is the cUrl based version. See here for details: https://stackoverflow.com/a/59397746/2887657 .
source_index=source_index
target_index=target_index
elastic_search_server=elasticsearch:9200
# Make sure the source index is actually open
curl -X POST "${elastic_search_server}/${source_index}/_open"
# Put the source index in read-only mode
curl -X PUT "${elastic_search_server}/${source_index}/_settings" \
youtube.com##.ytp-ce-covering-overlay
youtube.com##.ytp-ce-element-shadow
youtube.com##.ytp-ce-covering-image
youtube.com##.ytp-ce-expanding-image
youtube.com##.ytp-ce-element.ytp-ce-video.ytp-ce-element-show
@YumaInaura
YumaInaura / ZSH.md
Last active January 8, 2023 14:11
Zsh — How to create user defined widget and map with bindkey ( For very beginner of zle )

Zsh — How to create user defined widget and map with bindkey ( For very beginner of zle )

Another titles

  • How to add customized event and bind keymap
  • The very beginner to zle of zsh keymapping with bindkey

Step. Create function in shell

@vasanthk
vasanthk / System Design.md
Last active March 18, 2024 12:10
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?

Simple Security Guidelines

Using an iDevice? (Best option)

  • Use an iPod or an iPad without a SIM card
  • Use an iPhone
  • Do not jailbreak
  • Always upgrade to new iOS versions
  • Use Brave browser

Need Secure chat?

@omnibs
omnibs / phoenix showdown rackspace onmetal io.md
Last active January 25, 2023 18:33
Phoenix Showdown Comparative Benchmarks @ Rackspace

Comparative Benchmark Numbers @ Rackspace

I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.

Results

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)