Skip to content

Instantly share code, notes, and snippets.

View l13t's full-sized avatar
🦇
Working from home

Dmytro Prokhorenkov l13t

🦇
Working from home
View GitHub Profile
@l13t
l13t / recover_source_code.md
Created March 17, 2017 14:52 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@l13t
l13t / day-mode
Created April 17, 2017 21:40 — forked from Skehmatics/day-mode
#!/bin/bash
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me
PID=$(pgrep -u USER gnome-session-b)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
/usr/bin/gsettings set org.gnome.shell.extensions.user-theme name 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://WALLPAPER-PATH'
/usr/bin/gsettings --schemadir ~/.local/share/gnome-shell/extensions/drop-down-terminal@gs-extensions.zzrough.org set org.zzrough.gs-extensions.drop-down-terminal background-color 'rgb(69,90,100)'

Keybase proof

I hereby claim:

  • I am l13t on github.
  • I am l13t (https://keybase.io/l13t) on keybase.
  • I have a public key whose fingerprint is C991 4EC2 E2B1 BBBC E46F D00F BF78 F47F 0CF8 E569

To claim this, I am signing this object:

@l13t
l13t / hb_all_books_dl.js
Created May 9, 2018 12:59 — forked from kfatehi/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
this fork downloads all formats and does so without using jquery (since that didnt work for me)
note that if you are in chrome, chrome will not download the pdfs for you by default, to fix this
type “about:plugins” in the address bar and disable chrome's pdf viewer
*/
var pattern = /(MOBI|EPUB|PDF)$/i;
@l13t
l13t / 0_article.md
Created May 11, 2018 16:14 — forked from hemebond/0_article.md
A SaltStack AWS Auto Scaling Solution

A SaltStack AWS Auto Scaling Solution

Overview

The AWS Auto Scaling Goup, configured with a customised Cloud-Init file, sends a notification to an SNS Topic, which in turn passes it onto an SQS queue that the Salt Master is subscribed to. A Reactor watches for the auto scaling events and pre-approves the new minion based on its Auto Scaling group name and instance ID.

Salt Master Configuration

@l13t
l13t / baibako.yml
Created August 17, 2018 09:34 — forked from asm0dey/baibako.yml
Flexget config, which helps to put series from different russian-languaged trackers to organized folder structure using deluge.Also here is filtering based on quality, usual replacements for qualities and episode numberingFinally, one can find here filtering based on content size
series:
h264:
- 'Downton Abbey':
alternate_name: 'Аббатство Даунтон'
- 'Bones':
alternate_name: 'Кости'
- 'Delirium':
alternate_name: 'Делириум'
- 'Gang Related':
alternate_name: 'Преступные связи'
@l13t
l13t / keybase.md
Created September 27, 2018 17:13
keybase.md

Keybase proof

I hereby claim:

  • I am l13t on github.
  • I am l13t (https://keybase.io/l13t) on keybase.
  • I have a public key ASA7ZVp7ZdEmsdiLxEmq52FOBzgRf20kApPq1u94qPUg2go

To claim this, I am signing this object:

@l13t
l13t / README.md
Created November 29, 2018 14:40 — forked from mashdot/README.md
Bacula concurrent jobs multiple storage devices client labeled pools debian installation configuration.
Time-stamp: <2012-03-30 Fri 16:56 README.md>
Author....: 'Mash (Thomas Herbert)

TOSHINE-BACULA

Bacula concurrent jobs multiple storage devices client labeled pools Debian installation and configuration.
Please see http://toshine.org/etc for full article.

Bacula Debian Installation.

@l13t
l13t / terraform.diff
Created January 10, 2019 14:09
aws_emr_cluster problems
2019/01/10 14:44:07 [DEBUG] plugin: waiting for all plugin processes to complete...
-/+ module.emr.aws_emr_cluster.data_emr_519 (new resource required)
id: "j-1UFF5WCYUON3U" => <computed> (forces new resource)
applications.#: "2" => "2"
applications.1557323817: "Spark" => "Spark"
applications.3006569794: "Hadoop" => "Hadoop"
bootstrap_action.#: "1" => "1"
bootstrap_action.1567847425.args.#: "0" => "0"
bootstrap_action.1567847425.name: "bootstrap" => "bootstrap"
bootstrap_action.1567847425.path: "s3://sf.dev.data.bootstrap.actions/bootstrap.sh" => "s3://sf.dev.data.bootstrap.actions/bootstrap.sh"
@l13t
l13t / values.yaml
Created January 16, 2019 13:21
alertmanager alerts to slack for prometheus-operator
.......some config.....
alertmanager:
## Deploy alertmanager
##
enabled: true
## Service account for Alertmanager to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##