Skip to content

Instantly share code, notes, and snippets.

# Data source: https://storage.googleapis.com/books/ngrams/books/datasetsv2.html
# extraction pattern: ngram TAB year TAB match_count TAB volume_count NEWLINE
# out: unique_ngram TAB sum(match_count) NEWLINE
import os, sys
from pathlib import Path
from concurrent.futures import ProcessPoolExecutor
from multiprocessing import freeze_support
import polars as pl
@kossoy
kossoy / .Laravel-Jetstream-Inertia.md
Last active October 23, 2023 08:40
Setup project with Laravel, Jetstream (FB and Google through Socialite), and Inertia.js with Vue.js
import http.client, urllib.request, urllib.parse, urllib.error, base64
import json
import csv
names = ['YOUR LIST OF NAMES']
companies = ['YOUR LIST OF COMPANIES FOR EACH NAME']
YOUR_API_KEY = 'YOUR_API_KEY'
linkedin = []
@deergod1
deergod1 / pfSense config.md
Last active April 5, 2023 10:39
pfSense Easy Configuration Guide for HP t620 Plus

pfSense Simple Home Configuration - 2.4.3 / 2.4.4

Starting from Scratch

This is my personal guide for installing pfSense. Hope you find it useful. I made these notes to capture the details of my "install from scratch" to ensure I didn't miss important details. Also, I'm trying build my network with discrete "disposable" components that make the system mutable and less rigid. It does not cover installing any packages like Squid or Suricata as that's way beyond the scope of a basic, functional install.

I migrated from an environment that was at various times running Tomato Toastman 1.28 or Asuswrt-Merlin on Netgear and ASUS routers across four "access points" (one always acting as the firewall/gateway, the rest as APs). It was OK pre-gigabit, but had roaming problems, and I was using large Wifi routers with most of the features disabled. Also, I found that I could easily swamp the network and tank VOIP and Wifi Calling without even trying. The only fix was to throttle everything by using Bandwidth Limit

@rubot
rubot / docker_ufw_setup.sh
Last active January 4, 2024 09:57
easy fix for DOCKER-USER and ufw
#!/usr/bin/env bash
set -eu
# Solves the problem with open ports with docker and ufw
# As Docker uses the nat table, the filter table FORWARD chain is used and does not touch ufw-input chains as expected.
# Even for ufw-forward chains it would not work, as DOCKER chains are inserted in front.
# This is a simple fix that worked for me.
# https://github.com/moby/moby/issues/4737#issuecomment-420264979
# Unfortunately this fix stops forwarding users origin ip to host mode configured service
@tdmalone
tdmalone / static-site-watch.sh
Last active June 17, 2021 08:03 — forked from senko/onchange.sh
Watch specified directory recursively for file changes, and sync it to S3 when anything is created, modified, moved or deleted. Designed for use with a static site generator.
#!/usr/bin/env bash
#
# Watch specified directory recursively for file changes, and sync it to S3 when anything is
# created, modified, moved or deleted. Designed for use with a static site generator.
#
# Originally based on a script by Senko Rasic <senko.rasic@dobarkod.hr>
# Modified by Tim Malone <tdmalone@gmail.com>
# Ideas included from Lambros Petrou <lambrospetrou@gmail.com>
# Released to public domain.
# See https://gist.github.com/senko/1154509
const puppeteer = require('puppeteer');
class Webpage {
static async generatePDF(url) {
const browser = await puppeteer.launch({ headless: true }); // Puppeteer can only generate pdf in headless mode.
const page = await browser.newPage();
await page.goto(url, { waitUntil: 'networkidle', networkIdleTimeout: 5000 }); // Adjust network idle as required.
const pdfConfig = {
path: 'url.pdf', // Saves pdf to disk.
format: 'A4',
@kamermans
kamermans / configure_docker0.sh
Last active April 26, 2024 00:58
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# NOTE: Since Docker 1.10 (February 4, 2016), it has been possible to configure the
# Docker daemon using a JSON config file. On Linux, this file is normally located at
# /etc/docker/daemon.json. You should use this JSON config method if you are running
# a version of Docker that is at least 1.10!
# Here is an example configuration that sets the docker0 bridge IP to 192.168.254.1/24:
# {
# "bip": "192.168.254.1/24"
# }
@michaeldyrynda
michaeldyrynda / Envoy.blade.php
Last active July 13, 2023 17:40
Laravel 5 Envoy deploy configuration
@servers([ 'remote' => 'server.example.com', ])
@setup
if ( ! isset($repo) )
{
throw new Exception('--repo must be specified');
}
if ( ! isset($base_dir) )
{
@arkadijs
arkadijs / _README.md
Last active October 16, 2018 19:02
Registrator / SkyDNS for CoreOS / Deis cluster

Registrator and SkyDNS

We use progrium/registrator and yaronr/skydns (SkyDNS2) to publish information about Docker containers to DNS via A and SRV records. All nodes runs skydns and registrator, and first three nodes are inserted as NS-s into Route53 DNS for services.cluster-name.domain.io. Note, v4 registrator must be used until registrator/124 is resolved.

$ host -t srv mysql-1.services.deis.r53.acp.io deis-6-1.eu.r53.acp.io
Using domain server:
Name: deis-6-1.eu.r53.acp.io
Address: 54.171.239.227#53
Aliases: