Skip to content

Instantly share code, notes, and snippets.

View katoozi's full-sized avatar
🏡
Working from home

mohammad katoozi katoozi

🏡
Working from home
  • Tehran, Iran
View GitHub Profile
@rxaviers
rxaviers / gist:7360908
Last active July 5, 2024 17:44
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@bakins
bakins / gist:5bf7d4e719f36c1c555d81134d8887eb
Last active April 2, 2024 13:27
prometheus - scrape multiple containers in a pod
# Example scrape config for pods
#
# The relabeling allows the actual pod scrape endpoint to be configured via the
# following annotations:
#
# * `prometheus.io/scrape`: Only scrape pods that have a value of `true`
# * `prometheus.io/path`: If the metrics path is not `/metrics` override this. This
# will be the same for every container in the pod that is scraped.
# * this will scrape every container in a pod with `prometheus.io/scrape` set to true and the
port is name `metrics` in the container
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active June 29, 2024 15:54
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@mariocesar
mariocesar / api.js
Created September 26, 2017 04:21
Axios single configured instance
import axios from "axios";
const singleton = Symbol();
const singletonEnforcer = Symbol();
function readCookie(name) {
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
}
@katoozi
katoozi / i3-audio.conf
Last active May 27, 2019 07:39
my i3 script for increase, decrease and mute sound
# add this three line to i3 config file
bindsym XF86AudioRaiseVolume exec --no-startup-id ~/.i3/sound_script.sh incr #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id ~/.i3/sound_script.sh decr #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id ~/.i3/sound_script.sh # mute sound
@katoozi
katoozi / google-search.sh
Created April 13, 2019 06:36
my google search script for dmenu
#!/bin/sh
browser=${BROWSER:-google-chrome-stable}
pgrep -x dmenu && exit
choice=$(echo "" | dmenu -i -p "Search Google:") || exit 1
if [ "$choice" = "" ]; then
$browser "https://google.com"
else
@Nikkely
Nikkely / docker-compose.yml
Created May 13, 2019 09:12
redis replication on docker-compose
version: '3'
services:
redis:
image: redis:5.0.0
container_name: master
ports:
- "6379:6379"
networks:
- redis-replication
@katoozi
katoozi / auto_lock.sh
Last active February 3, 2024 01:26
my i3 config files
#!/bin/sh -e
# Take a screenshot
#scrot /tmp/screen_locked.png
# Pixellate it 10x
#mogrify -scale 10% -scale 1000% /tmp/screen_locked.png
# Lock screen displaying this image.
i3lock -i /usr/share/backgrounds/warty-final-ubuntu.png
@fracasula
fracasula / encrypt_decrypt.go
Last active June 25, 2024 07:13
A simple example with Golang that uses AES-128 to encrypt and decrypt messages.
package mycrypto
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"io"
"time"
)
@katoozi
katoozi / crontab
Last active August 21, 2020 15:21
postgresql daily backup at 1:00 AM
0 1 * * * /backups/backup.sh >/dev/null 2>&1