Skip to content

Instantly share code, notes, and snippets.

View rohanpande's full-sized avatar
💭
I may be slow to respond.

Rohan Pande rohanpande

💭
I may be slow to respond.
  • Nagpur
View GitHub Profile
@rohanpande
rohanpande / generate-pem.md
Created February 5, 2025 18:01 — forked from devmahmud/generate-pem.md
Generate pem file to login into remote server

We can use pem file to login into remote server from our local machines. Infact if you use AWS, the only way to SSH into the server is using pem file.

1. On your local Machine from where you require access, Home directory of the user is preferable

cd ~
ssh-keygen -t rsa -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
@rohanpande
rohanpande / iptables-cheatsheet.md
Created February 4, 2025 15:37 — forked from mcastelino/iptables-cheatsheet.md
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@rohanpande
rohanpande / README.md
Created October 19, 2024 10:33 — forked from piyushgarg-dev/README.md
Kafka Crash Course
@rohanpande
rohanpande / ThreadedTCPRequestHandler.py
Created September 14, 2024 07:17 — forked from efazati/ThreadedTCPRequestHandler.py
ThreadedTCPRequestHandler.py
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
def handle(self):
logger.info({'module': 'server', 'msg': 'Client connected %s' % self.client_address[0]})
cur_thread = threading.current_thread()
data = self.request.recv(1024) # clip input at 1Kb
try:
msg_analyser(data)
response = "{}: {}".format(cur_thread.name, data)
@rohanpande
rohanpande / fonts.sh
Created September 23, 2022 18:05 — forked from incogbyte/fonts.sh
Install Meslo Fonts Ubuntu Linux Mint and debians
#!/bin/bash
sudo apt install fontconfig
cd ~
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip
mkdir -p .local/share/fonts
unzip Meslo.zip -d .local/share/fonts
cd .local/share/fonts
rm *Windows*
cd ~
@rohanpande
rohanpande / redis-expire.sh
Created July 8, 2022 05:06 — forked from fieg/redis-expire.sh
Set expire on large set of keys using pattern in Redis
#!/bin/bash
if [ $# -ne 4 ]
then
echo "Usage: $0 <host> <port> <pattern> <seconds>"
exit 1
fi
cursor=-1
keys=""
Source: https://edwilliams.org/sunrise_sunset_example.htm
Source:
Almanac for Computers, 1990
published by Nautical Almanac Office
United States Naval Observatory
Washington, DC 20392
Inputs:
day, month, year: date of sunrise/sunset
@rohanpande
rohanpande / clear_tmp
Created August 6, 2018 04:18
clear_tmp
sudo chown www-data:www-data -R ./tmp ./logs && sudo rm -rf ./tmp/cache/* && sudo rm -rf ./tmp/sessions/* && sudo rm -rf ./tmp/tests/* && sudo rm -rf ./logs/* && sudo touch ./logs/debug_kit.sqlite && sudo chmod 777 ./logs/debug_kit.sqlite && sudo chmod 777 -R ./tmp ./logs
@rohanpande
rohanpande / beanstalkd.service
Created June 22, 2018 10:12 — forked from ifduyue/beanstalkd.service
Install beanstalkd on CentOS 7
[Unit]
Description=Beanstalkd is a simple, fast work queue
[Service]
User=nobody
Restart=always
RestartSec=500ms
ExecStart=/usr/local/bin/beanstalkd -b /var/lib/beanstalkd
LimitNOFILE=10240
@rohanpande
rohanpande / only_full_group_by.sql
Created May 23, 2018 05:34 — forked from rmdstudio/only_full_group_by.sql
Disabling only full group by in mysql
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));