Skip to content

Instantly share code, notes, and snippets.

Avatar
🖖
live long and prosper

Gokhan Boranalp kunthar

🖖
live long and prosper
View GitHub Profile
View tcpdump_results.log
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 Mar 23, 2022
nginx proxy pass
View domain.com
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 Nov 5, 2021
kunthar .bash_profile
View .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
View gist:3ba5d0b7e7fec4985ec78975b3de6cf0
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
@kunthar
kunthar / asdf-usage.MD
Last active Aug 27, 2021
asdf crash course
View asdf-usage.MD

Manage multiple runtime versions with a single CLI tool

  • asdf is cool tool if you have a limited disk space.
  • Nor docker containers neither Nixos packages can help when disk space is really small as most of Macs has.
  • You can test a new language or tool, see the results and remove without having leftover in your system if you like to.
  • install asdf with git
  • Btw, you can check the snapd if you are on Ubuntu!

https://asdf-vm.com/#/core-manage-asdf-vm

@kunthar
kunthar / vscode-notes-for-python-developers.md
Last active Aug 27, 2021
vscode notes for python developers
View vscode-notes-for-python-developers.md
  1. Bullshit venv detection: If you can't find where the hell is this virtualenv you should open workspace settings, create settings.json and add this
"python.pythonPath": "/your_path/.venv/bin/python"
  1. You click the file and then another one and your previous file closed. You get mad as a hell. Because of preview mode is enabled as default. Disable it as shown here:

https://stackoverflow.com/questions/38713405/open-files-always-in-a-new-tab

View gist:b9d24eb99ca4529737b50630f4421295
┌─(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 Sep 26, 2020
move files periodically from one directory to another in SAME server. uses cron facility.
View move-files.sh
#!/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 Sep 24, 2020
remove .DS_Store sh*te
View .bash_profile
#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 Aug 6, 2020
Create a linkedlist and remove dups from llist
View llist_ops.py
"""
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