Skip to content

Instantly share code, notes, and snippets.

View smartass08's full-sized avatar

Shubham Dubey smartass08

View GitHub Profile
@smartass08
smartass08 / pihole.service
Created July 6, 2021 01:20
/etc/systemd/system/pihole.service
[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
Environment="DOCKER_CLIENT_TIMEOUT=120"
Environment="COMPOSE_HTTP_TIMEOUT=120"
RemainAfterExit=true
@smartass08
smartass08 / docker-compose_pihole.yml
Created July 6, 2021 01:19
Docker-compose for pihole
version: "3"
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
dns:
- 8.8.8.8
ports:
@smartass08
smartass08 / DIgitalcounter.py
Created June 21, 2021 02:39
A digital counter in python
import sys
from pynput.keyboard import Key, Listener
count = 0
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
@smartass08
smartass08 / subdomain.doamin.TLD
Created April 22, 2021 20:58
default reverse proxy ngnix
server {
listen 80;
listen [::]:80;
root /var/www/subdomain.doamin.TLD/html;
index index.html index.htm index.nginx-debian.html;
server_name subdomain.doamin.TLD;
return 302 https://$server_name$request_uri;
}
import javax.swing.*;
import javax.swing.UIManager;
import javax.swing.border.*;
import java.awt.Font;
import java.security.SecureRandom;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.datatransfer.*;
@smartass08
smartass08 / tg.go
Last active October 19, 2020 11:41
package modules
import (
"fmt"
"github.com/PaulSonOfLars/gotgbot"
"github.com/PaulSonOfLars/gotgbot/ext"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"html"
"log"
[Unit]
Description=Your service description
[Service]
Restart=always
WorkingDirectory=/home/user/to/path
ExecStartPre=/usr/bin/whatever/app command to execute before actual command
ExecStart=/usr/bin/whatever/app main command
[Install]
#!/bin/bash
#Add your username here
user=smartass08
#Adds your uid's to subuid and subgid
sudo touch /etc/subuid && sudo touch /etc/subgid
uid=$(id -u $user)
sudo usermod -v $((uid+200000))-$((uid+200000+65535)) -w $((uid+200000))-$((uid+200000+65535)) $user
import (
"github.com/PaulSonOfLars/gotg_md2html"
)
func MakeKeyboards(button []tg_md2html.Button) [][]ext.InlineKeyboardButton {
var allbuttons [][]ext.InlineKeyboardButton
for _, v := range button {
var button1 []ext.InlineKeyboardButton
tempbtn := ext.InlineKeyboardButton{
var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
func randSeq(n int) string {
b := make([]rune, n)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
}
return string(b)
}