Skip to content

Instantly share code, notes, and snippets.

☢️
Feeling radiant 😎

Filip Sobalski pinkeen

☢️
Feeling radiant 😎
View GitHub Profile
@pinkeen
pinkeen / cleanup.gs
Created May 30, 2020
Clean GMail Google Apps Script
View cleanup.gs
/*************************************************************************************************
* Simple Google Apps script for removing GMail messages
*
* Rationale: If you've got hundreds of thousands of e-mails (automated error reports in my case)
* filling up your account's quota and there's too many of them creating huge threads so
* GMail GUI, IMAP or anything else cannot handle this removal.
*
* Usage: Set up your query and run this script using a trigger every 5/10 minutes - it took days
* for my Inbox to be finally free from the crap.
*************************************************************************************************/
@pinkeen
pinkeen / transfer-network-config
Created Apr 15, 2020 — forked from makuk66/transfer-network-config
Notes about using point-to-point links for routing IP addresses in virtual machines
View transfer-network-config
Some experiments, which worked but were eventually not used.
See http://www.greenhills.co.uk/2011/06/10/lxc.html
Now, the next big milestone is to get networking working.
In the config, we told lxc-create to use br0 as the link,
and inside the container we have eth0:
root@thunder:/# brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.962e6bb72480 no vethP70LNx
@pinkeen
pinkeen / ssh-tuntap-vpn.md
Last active Apr 13, 2020
TunTap pseudo-VPN Over SSH
View ssh-tuntap-vpn.md

Poor Man's VPN over SSH

If you have ssh then you can setup a "bridge" to any external network or server in minutes.

This doesn't replace standard VPN solutions, but it has the advantage of being really simple and fast and will serve a lot of use-cases.

Drawbacks

@pinkeen
pinkeen / CSML_IDEAS.md
Last active Mar 20, 2020
Computational Solid Modeling Language - IDEA
View CSML_IDEAS.md

Computational Solid Modeling Language - IDEA

Lets kickstart the 3D printing open things revolution!

...by creating a vibrant, coherent open things ecosystem modeled after the best practices already established by the Open Source Software community.

  • Purely functional and almost declarative - no mutations or side-effects allowed
  • Transpiled to JS which is then evaluated calling native libs or optimized computation cores for heavy-lifting.
@pinkeen
pinkeen / oom.c
Created Jan 13, 2020
Small C tool for testing OOM killers
View oom.c
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<unistd.h>
#include<signal.h>
#define MIB_SZ(SZ) ((SZ) / 0x100000)
#define PER_SZ(SZ, TOTAL) ((SZ * 100) / (TOTAL))
#ifdef __linux__
View aws.py
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import re
import sys
import json
import datetime
import itertools
import traceback
import configparser
View bash_supervisor.sh
#!/usr/bin/env bash
NAME="$1"
CONCURRENCY="$2"
MAX_MESSAGES="$3"
LOGFILE="var/log/worker-${NAME}.log"
PIDFILE="var/run/worker-${NAME}.pid"
@pinkeen
pinkeen / .0-MAGENTO-CLOUD-HELPER-SCRIPTS.md
Last active Sep 24, 2019
Helper scripts for Magento Commerce Cloud prod/stage envs
View .0-MAGENTO-CLOUD-HELPER-SCRIPTS.md

Magento Cloud helper scripts

I drop them into the root project's dir and push them to the repo. Mostly they should use whatever env you've got checked out with magento-cloud command.

Tested only on Mac with Pro/Stage envs, use at your own risk YMMV.

Tip: You can adjust .gitignore like this for convenience:

View string_hash_word_poc.c
#include <stdio.h>
#include <stdint.h>
/**
* Simple string hash with minimal memory requirements.
*
* This is meant for uCs with 128-512 byte SRAM -
* the purpose is to avoid having to store string
* identifier in RAM when parsing some incoming data.
*
You can’t perform that action at this time.