Skip to content

Instantly share code, notes, and snippets.

View kunthar's full-sized avatar
🖖
live long and prosper

Gokhan Boranalp kunthar

🖖
live long and prosper
View GitHub Profile
@kunthar
kunthar / tcpdump_results.log
Created May 11, 2022 15:42
tcpdump results
root@ubuntu20-01:/home/bbadmin# tcpdump -i any -N 'port 6065'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked v1), capture size 262144 bytes
18:37:05.618919 IP localhost.35834 > 192.168.48.4.6065: Flags [S], seq 3926100908, win 65495, options [mss 65495,sackOK,TS val 3651694995 ecr 0,nop,wscale 7], length 0
18:37:05.618942 IP localhost.35834 > 192.168.48.4.6065: Flags [S], seq 3926100908, win 65495, options [mss 65495,sackOK,TS val 3651694995 ecr 0,nop,wscale 7], length 0
18:37:05.618980 IP 192.168.48.4.6065 > localhost.35834: Flags [S.], seq 2052857366, ack 3926100909, win 65160, options [mss 1460,sackOK,TS val 2461048105 ecr 3651694995,nop,wscale 7], length 0
18:37:05.618986 IP 192.168.48.4.6065 > localhost.35834: Flags [S.], seq 2052857366, ack 3926100909, win 65160, options [mss 1460,sackOK,TS val 2461048105 ecr 3651694995,nop,wscale 7], length 0
18:37:05.619043 IP localhost.35834 > 192.168.48.4.6065: Flags [R.], seq 1, ack
@kunthar
kunthar / domain.com
Created March 23, 2022 15:05
nginx proxy pass
server {
listen 80;
server_name domain.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@kunthar
kunthar / .bash_profile
Last active November 5, 2021 02:09
kunthar .bash_profile
#asdf direnv install hook
eval "$(/Users/kunthar/.asdf/shims/direnv hook bash)"
export GREP_OPTIONS='--color=always'
# Disable auto update of brew
export HOMEBREW_NO_AUTO_UPDATE=1
# cowsay Acme not found fix
@kunthar
kunthar / gist:3ba5d0b7e7fec4985ec78975b3de6cf0
Created September 28, 2021 11:50
php-fpm with goodies
FROM php:fpm-alpine3.14
WORKDIR /var/www/html/
# Date time setup
RUN apk add tzdata
RUN cp /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
RUN echo "Europe/Istanbul" > /etc/timezone
RUN apk del tzdata
┌─(py38)[kunthar][kunthar][~/work/repos/Envs]
└─▪ pip list
Package Version
------------------ ----------
appnope 0.1.0
attrs 19.3.0
backcall 0.1.0
bigbluebutton 0.6.0
bleach 3.1.0
certifi 2020.4.5.1
@kunthar
kunthar / move-files.sh
Created September 26, 2020 18:39
move files periodically from one directory to another in SAME server. uses cron facility.
#!/bin/bash
DIRECTORY="/home/lmsadmin/videos"
FILES=$DIRECTORY/*
if [ -d "$DIRECTORY" ]; then
cd $DIRECTORY
shopt -s nullglob dotglob # To include hidden files
files=($DIRECTORY/*)
if [ ${#files[@]} -gt 0 ]; then
@kunthar
kunthar / .bash_profile
Created September 24, 2020 05:05
remove .DS_Store sh*te
#add to .bash_profile //MAC only
alias ds_sil='find . -name ".DS_Store" -depth -exec rm {} \;'
alias rmds='find . -name '*.DS_Store' -type f -delete'
@kunthar
kunthar / llist_ops.py
Last active August 6, 2020 20:02
Create a linkedlist and remove dups from llist
"""
There is no direct implementation of Linkedlist in Python even in 3. So we have to implement it first.
Please note that we have a collections.deque class but delete operation is nearly the same polynomial time bruh.
To get more detail on this please read here:
https://realpython.com/linked-lists-python/
"""
class Node:
def __init__(self, data):
self.data = data
@kunthar
kunthar / gist:e7aa391719f93722f7bc73c23175d745
Created June 30, 2020 09:07
Prometheus global config example Mariadb Galera, Redis, Haproxy, Gluster
# my global config
global:
scrape_interval: 60s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 60s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
@kunthar
kunthar / colorscale.sh
Created May 27, 2020 21:49
show colorscale of xterm
#!/bin/bash -
#title :colorscale.sh
#description :Show a rainbow of colors.
#author :bgw
#date :20111002
#version :0.1
#usage :./colorscale.sh
#notes :
#bash_version :4.1.5(1)-release