Skip to content

Instantly share code, notes, and snippets.

View albenik's full-sized avatar

Veniamin Albaev albenik

  • Moscow, Russia
View GitHub Profile
@noelbundick
noelbundick / README.md
Created October 14, 2021 16:15
Optimizing Rust container builds

Optimizing Rust container builds

I'm a Rust newbie, and one of the things that I've found frustrating is that the default docker build experience is extremely slow. As it downloads crates, then dependencies, then finally my app - I often get distracted, start doing something else, then come back several minutes later and forget what I was doing

Recently, I had the idea to make it a little better by combining multistage builds with some of the amazing features from BuildKit. Specifically, cache mounts, which let a build container cache directories for compilers & package managers. Here's a quick annotated before & after from a real app I encountered.

Before

This is a standard enough multistage Dockerfile. Nothing seemingly terrible or great here - just a normal build stage, and a smaller runtime stage.

# Source: https://gist.github.com/84324e2d6eb1e62e3569846a741cedea
####################
# Create a Cluster #
####################
minikube start
#############################
# Deploy Ingress Controller #
@albenik
albenik / network-mamanger-wifi-nmcli.txt
Created May 8, 2018 21:39
WiFi setup from cli with NetworkManager and nmcli
# from here https://forums.kali.org/showthread.php?36275-Help-with-nmcli-and-connecting-to-specific-bssid-(error-53)&s=4a6691e9f86f22d4913fa5c5218c233f&p=71337#post71337
sudo nmcli dev status
sudo nmcli dev wifi list
sudo nmcli con add con-name <My_profile_name> ifname <My_interface> type wifi ssid <My_eSSID>
sudo nmcli con modify <My_profile_name> wifi-sec.key-mgmt wpa-psk
sudo nmcli con modify <My_profile_name> wifi-sec.psk <My_WiFi_WPA_key>
sudo nmcli connection up <My_profile_name>
sudo nmcli -p c
@rquadling
rquadling / Dockerfile
Last active October 5, 2020 01:52
Adding XDebug to Bitnami's php-fpm container.
# An example Dockerfile to build a Bitnami PHP-FPM minimal container with xDebug and some other extensions installed.
# Please note, I have cobbled this together from limited understanding as well as dissecting the Dockerfiles that
# Bitnami have used.
#
# If you find problems, or suggestions, PLEASE PLEASE help me and the rest of the community with your comments,
# suggestions, fixes, etc. Let's all learn something new!!!!
#
# If you want to contact me directly, then RQuadling at the Google Mail, and I'll be happy to answer any questions.
@sameoldmadness
sameoldmadness / README.md
Last active February 25, 2025 19:26
Нагрузочное тестирование c Yandex.Tank и JMeter

Нагрузочное тестирование c Yandex.Tank и JMeter

На этой странице описывается процесс настройки нагрузочного тестирования внешних ресурсов.

Кратко

Для тестирования поведения сервиса под нагрузкой используется утилита Yandex Tank.

Танку можно указать патроны (HTTP-запросы, которые будут отправлены на целевой сервер) и расписание (количество запросов в секунду к целевому серверу в каждый момент времени стрельб, а также продолжительность стрельб). Также к танку можно подключить плагин мониторинга, позволяющий снимать показатели (например, количество свободной памяти или загрузку процессора) с целевого сервера.

#how to install tinc
sudo eopkg install -c system.devel
sudo eopkg install lzo-devel git
mkdir Source
cd Source
git clone https://github.com/gsliepen/tinc.git
cd tinc
autoreconf --install
./configure
sudo make install
@chadrien
chadrien / README.md
Last active April 22, 2025 15:52
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@jpillora
jpillora / sshd.go
Last active March 28, 2025 03:25
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@chrismccoy
chrismccoy / gitcheats.txt
Last active February 27, 2025 15:51
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# aliases to change a git repo from private to public, and public to private using gh-cli
alias gitpublic="gh repo edit --accept-visibility-change-consequences --visibility public"
alias gitprivate="gh repo edit --accept-visibility-change-consequences --visibility private"
# delete all your repos using gh-cli (please do not run this unless you want to delete all your repos)
gh repo list --limit 300 --json url -q '.[].url' | xargs -n1 gh repo delete --yes
@cviebrock
cviebrock / select2-foundation5.css
Created December 20, 2013 15:56
Select2 CSS for Zurb Foundation 5
/*
Version: 3.4.5 Timestamp: Mon Nov 4 08:22:42 PST 2013
*/
.select2-container {
margin: 0 0 1rem 0;
position: relative;
vertical-align: middle;
font-family: inherit;
-webkit-appearance: none !important;
font-size: 0.875rem;