Skip to content

Instantly share code, notes, and snippets.

@dcatanzaro
dcatanzaro / botcito_galicia.js
Last active January 26, 2024 22:36
Botcito para el Galicia
const axios = require("axios");
let lastIndexMovement = 0;
const TELEGRAM_BOTID = "";
const TELEGRAM_CHATID = "";
class Telegram {
sendTelegramMessage(message) {
const botId = TELEGRAM_BOTID;
@c0reyes
c0reyes / README.md
Last active March 3, 2021 13:20
Marca de agua
@Eishfaq
Eishfaq / gist:27e9896fc0768bc73eafe76cb954da3c
Created July 18, 2019 12:05
Forking in Php pcntl_fork()
# Parallel process with pcntl_fork()
$data = array(
'142.12.34.21',
'75.34.21.34',
'98.34.23.11',
''97.23.12.33
);
foreach($data as $each){
$pid = pcntl_fork();
@aveao
aveao / bird1-bird-vultr.conf
Last active February 23, 2025 15:54
BIRD 1 and 2 configs for BGP stuffs (HE Tunnelbroker, Vultr etc)
router id [our IPv4];
protocol bgp vultr
{
local as [our ASN];
source address [our IPv4 from vultr];
import all;
export filter {
if net ~ [[the IPv4 block we want to announce]] then accept;
reject;
@basoro
basoro / proxmox-proxy
Created May 25, 2019 20:45
Running Proxmox behind a single IP address
I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables.
What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding.
Network configuration
Here’s how it’s done:
Create a virtual interface that serves as the gateway for your VMs:
@ibqn
ibqn / mailserver-howto.md
Last active December 16, 2024 06:11
Email server based on Dovecot, Postfix, MySQL, Rspamd and Debian 9 Stretch

Email server based on Dovecot, Postfix, MySQL, Rspamd and Debian 9 Stretch

MySQL database setup

Install MariaDB as a database management system DBMS

sudo apt install mariadb-server

Create a new database named srvmail for a mail server:

#battery
sudo pmset -b standbydelaylow 300
sudo pmset -b standby 1
sudo pmset -b halfdim 1
sudo pmset -b sms 0
sudo pmset -b disksleep 10
sudo pmset -b standbydelayhigh 600
sudo pmset -b sleep 10
sudo pmset -b autopoweroffdelay 40000
sudo pmset -b hibernatemode 25
@dunielpls
dunielpls / ping_host.py
Last active October 19, 2022 09:14
run fping and parse its output, "unreachable" or json stats. requires python 3.5. made for use with zabbix.
#!/usr/bin/env python3
import sys
import json
import subprocess
# '1.1.1.1 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 1.35/1.35/1.35'
def parse(s):
data = {}
@MatthewVance
MatthewVance / unbound.conf
Last active September 9, 2025 15:34
Config for running Unbound as a caching DNS forwarder (performance settings optimized for Raspberry Pi 2).
server:
###########################################################################
# BASIC SETTINGS
###########################################################################
# Time to live maximum for RRsets and messages in the cache. If the maximum
# kicks in, responses to clients still get decrementing TTLs based on the
# original (larger) values. When the internal TTL expires, the cache item
# has expired. Can be set lower to force the resolver to query for data
# often, and not trust (very large) TTL values.
cache-max-ttl: 86400
@shikendon
shikendon / ddos-mitigation-notes.md
Last active November 8, 2023 10:34
Best Practices for DDoS Protection and Mitigation on Linux