Skip to content

Instantly share code, notes, and snippets.

View dpurnam's full-sized avatar

Nitin K dpurnam

View GitHub Profile
@svetlyak40wt
svetlyak40wt / use-nullmailer.sh
Created February 7, 2016 14:38
Using nullmailer from docker image
# this example shows how to run docker container and use nullmailer, running on a host machine
# first, run a container like that
sudo docker run \
--rm \
-ti \
-v `which sendmail`:`which sendmail` \
-v `which nullmailer-inject`:`which nullmailer-inject` \
-v `which nullmailer-queue`:`which nullmailer-queue` \
@mitchellkrogza
mitchellkrogza / fail2ban-reset-log-db.sh
Last active December 13, 2024 06:48
Bash script to reset Fail2Ban - clears / truncates log file and deletes the sqlite database - stops and restarts service during this process.
#!/bin/bash
# Bash Script by https://gist.github.com/mitchellkrogza
# ************************************************************
# This script clears the log file and database of Fail2Ban
# This resets Fail2Ban to a completely clean state
# Useful to use after you have finished testing all your jails
# and completed your initial setup of Fail2Ban and are now
# putting the server into LIVE mode
# ************************************************************
@ageis
ageis / systemd_service_hardening.md
Last active April 7, 2025 11:20
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@jitheshkt
jitheshkt / docker-compose.yml
Last active July 13, 2024 14:15
Apache and Traefik 2.0 with Docker Compose
version: "3"
networks:
proxy:
external: true
services:
public_apache:
image: httpd
labels:
@davidjguru
davidjguru / bash_aliases
Last active November 23, 2024 07:44
BASH Aliases commands for a Linux (Debian / Ubuntu) environment
## Morning Opertures
alias whatsup='service --status-all'
alias hello='sudo /etc/init.d/apache2 stop && cd workspace/project && ddev start && ddev launch'
alias hi='sudo systemctl stop apache2'
alias iad='systemctl is-active docker'
alias ports='nmap localhost'
alias dns="sudo systemd-resolve --status | grep 'DNS Servers'"
alias bye='shutdown -r now'
## Usual Instructions
@vgel
vgel / r1.py
Last active March 29, 2025 15:50
script to run deepseek-r1 with a min-thinking-tokens parameter, replacing </think> with a random continuation string to extend the model's chain of thought
import argparse
import random
import sys
from transformers import AutoModelForCausalLM, AutoTokenizer, DynamicCache
import torch
parser = argparse.ArgumentParser()
parser.add_argument("question", type=str)
parser.add_argument(