Skip to content

Instantly share code, notes, and snippets.

View naviat's full-sized avatar
🪲

naviat

🪲
View GitHub Profile
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active April 24, 2024 00:11
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@tsaqib
tsaqib / ideas.md
Last active April 14, 2024 12:48
Ideas that you can use for hackathons, competitions and research.

Ideas

I have collected and moderated these ideas from various public sources and put into one place so that problem solvers and solution developers may find inspirations. Because I wish to update it regularly, I have setup as a single page wiki. You may try these ideas on hackathons/competitions/research; some are quite intense problems and some are not. Many of the problems were prepared keeping Dhaka/Bangladesh in mind, but of course can be applied to just about any underdeveloped/developing and sometimes developed countries.

Categories:
  • Eradicate Extreme Poverty and Hunger
  • Education
  • Healthcare
  • Governance
@naviat
naviat / LocalDot.md
Last active January 15, 2024 19:53
Dotfile for zsh

Step by step

For AWS CLI ALIAS

  • Install aws cli
  • Copy file alias to ~/.aws/cli/ and use the alias: aws
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
@devfelipereis
devfelipereis / README.md
Last active June 28, 2023 16:56 — forked from bvis/README.md
Docker Env Vars expanded with secrets content

Set secrets as env variables in docker

This script will read your secret file and set each line as an env variable in your container.

How to use it

I' assuming that you already has a entrypoint file in your Dockerfile. So now, you need to copy and paste the contents of set_env_secrets.sh to your entrypoint(you don't need the first line).

Now, you need to create a secret, the name could be whatever you like. I'm using the name of my application as a pattern for my secrets name. For this example, my secret name will be super-project and the content will be.

# Maintainer: Jakub Hajek, jakub.hajek@cometari.com
#
# docker stack deploy -c stack-elastic.yml elastic
#
# The stack creates Elasticsearch cluster consiting of
# - 3 dedicated master nodes in order to keep quorum
# - 4 dedicated data nodes to manage CRUD,
#
# Docker compose file to easily deploy Elasticsearch cluster 7.x on Docker Swarm cluster.
@naviat
naviat / gist:7cf3f136f8e96b5de0961a95e6ebc38c
Created July 21, 2022 08:46 — forked from exAspArk/gist:c325bb9a75dcda5c8212
Elasticsearch: calculating user sessions with Map/Reduce (Ruby)
# The same algorithm which is used in Google Analytics (https://support.google.com/analytics/answer/2731565?hl=en):
# Time-based expiry (including end of day):
# - After 30 minutes of inactivity
# - At midnight
# Enable dynamic scripting for Groovy (https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html#_enabling_dynamic_scripting)
# ! WARNING: please read about security first
# Usage:
#
@naviat
naviat / tmux-cheatsheet.markdown
Created March 17, 2021 10:45 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Mastering your history

Frequently rebasing from master

If you work on feature branches, like we do, that are based off a parent branch (e.g. the master branch of the main repository), you want to avoid your branch getting out of sync with the latest work in the parent branch.

As time goes by, your forked branch where you’re working can become significantly out of sync with the latest master branch. This may mean that merging your work