Skip to content

Instantly share code, notes, and snippets.

View wiedzmin's full-sized avatar

Alex Ermolov wiedzmin

View GitHub Profile
@ramimac
ramimac / Cloud Security Orienteering Checklist.md
Last active April 24, 2024 03:54
A Checklist of Cloud Security Orienteering

Cloud Security Orienteering: Checklist
by Rami McCarthy
via TL;DR sec

How to orienteer in a cloud environment, dig in to identify the risks that matter, and put together actionable plans that address short, medium, and long term goals.

Based on the Cloud Security Orienteering methodology.

Checklist

@akagr
akagr / em.scpt
Last active November 17, 2023 10:34
MacOS launch helper to start emacs daemon or attach to one
-- ███████╗███╗░░░███╗░█████╗░░█████╗░░██████╗
-- ██╔════╝████╗░████║██╔══██╗██╔══██╗██╔════╝
-- █████╗░░██╔████╔██║███████║██║░░╚═╝╚█████╗░
-- ██╔══╝░░██║╚██╔╝██║██╔══██║██║░░██╗░╚═══██╗
-- ███████╗██║░╚═╝░██║██║░░██║╚█████╔╝██████╔╝
-- ╚══════╝╚═╝░░░░░╚═╝╚═╝░░╚═╝░╚════╝░╚═════╝░
--
-- Open this script with 'Script Editor' on MacOS, then save it
-- inside /Applications as an 'Application', not 'Script'.
@tttuuu888
tttuuu888 / package-loading-notice.el
Last active June 6, 2021 02:57
Eye-candy for Emacs package loading time
(defvar sk-package-loading-notice-list '(org yasnippet))
(defun sk-package-loading-notice (old &rest r)
(let* ((elt (car r))
(mode
(when (stringp elt)
(let ((ret (assoc-default elt auto-mode-alist 'string-match)))
(and (symbolp ret) (symbol-name ret)))))
(pkg
(cond ((symbolp elt) elt)
@PatrLind
PatrLind / protect-kube-config.md
Created April 26, 2021 08:43
How to protect your ~/.kube/ configuration

How to protect your ~/.kube/ configuration

I had a need to protect my Kubernetes config file on my computer against accidental or malicious change or reading, so I came up with this way of protecting the config files.

How it works

The ~/.kube folder is mounted using encfs. By using the --ondemand flag it will automatically ask for the encryption key/password when accessed and keep

@pkkm
pkkm / git-ml.el
Created February 26, 2021 16:51
Asynchronous git modeline (rough prototype)
;;; Asynchronous detailed git modeline.
;; git-ml is free software: you can redistribute it and/or modify it under the
;; terms of the GNU General Public License as published by the Free Software
;; Foundation, either version 3 of the License, or (at your option) any later
;; version.
;; This is a rough sketch. Things to do before publishing it as a package:
;;
;; * Consider doing the checks per git directory instead of per buffer, then
WARNING: Logging before flag parsing goes to stderr.
W0730 21:03:55.281007 139779186857856 deprecation_wrapper.py:119] From /content/drive/My Drive/ml/2019-07-30/gpt-2-elisp-untab/src/model.py:147: The name tf.AUTO_REUSE is deprecated. Please use tf.compat.v1.AUTO_REUSE instead.
W0730 21:03:57.490804 139779186857856 deprecation_wrapper.py:119] From /content/drive/My Drive/ml/2019-07-30/gpt-2-elisp-untab/src/memory_saving_gradients.py:13: The name tf.GraphKeys is deprecated. Please use tf.compat.v1.GraphKeys instead.
W0730 21:04:02.302061 139779186857856 deprecation_wrapper.py:119] From ./train.py:87: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.
W0730 21:04:02.302422 139779186857856 deprecation_wrapper.py:119] From ./train.py:90: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.
2019-07-30 21:04:02.319198: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2200000000 Hz

Nix Flake MVP

Goals

  • To provide Nix repositories with an easy and standard way to reference other Nix repositories.

  • To allow such references to be queried and updated automatically.

  • To provide a replacement for nix-channel, NIX_PATH and Hydra

(defun read-journal (path)
(with-temp-buffer
(insert-file-contents (concat "~/notes/journal/" path))
(split-string (buffer-string) "\n" t)))
(defun read-first-three-lines (list)
(cond ((>= (length list) 4) (subseq list 1 3))
((>= (length list) 1) (nthcdr 1 list))
(t list)))
@perfecto25
perfecto25 / bitbucket_branch_cleaner.py
Last active January 11, 2019 18:08
Deletes Pull Requests and Branches from a given repository in BitBucket
#!/usr/bin/env python
# coding=utf-8
# Deletes all branches and pull requests from a Repo unless its 'master' or 'production'
# TO BE USED ON DEV BITBUCKET INSTANCE ONLY!!!
from __future__ import print_function
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
@edolstra
edolstra / nix-lang.md
Last active May 22, 2024 19:03
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to