Skip to content

Instantly share code, notes, and snippets.

View manti-by's full-sized avatar
🚀
Waiting for spaceship

Alexander Chaika manti-by

🚀
Waiting for spaceship
View GitHub Profile
@manti-by
manti-by / nginx-install.sh
Last active March 18, 2024 13:23
Install NGINX 1.25 with brottli and header more modules
#!/bin/bash
sudo adduser --disabled-password --gecos "" nginx
git clone --recurse-submodules git@github.com:google/ngx_brotli.git
cd ngx_brotli/deps/brotli/ && mkdir out && cd out
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed ..
cmake --build . --config Release --target brotlienc && cd ../../../../
git clone git@github.com:openresty/headers-more-nginx-module.git ngx_headers_more

Install Pyenv

Install system libraries

sudo apt install curl make git build-essential zlib1g-dev tk-dev \
    libssl-dev libxml2-dev libxmlsec1-dev libreadline-dev \
    liblzma-dev libbz2-dev libsqlite3-dev libffi-dev \
    libsasl2-dev libldap2-dev

Install NVM, NPM and Elasticdump

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install --lts
npm install elasticdump -g

Dump data into file

elasticdump \

--input=http://localhost:9200/sample_index \

@manti-by
manti-by / elasticsearch.yml
Last active April 19, 2023 14:06
Elasticsearch dev config
# ======================== Elasticsearch Configuration =========================
#
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ------------------------------------------------------------------------------
discovery.type: single-node
cluster.name: vormir
node.name: vormir-zero
@manti-by
manti-by / install-ubuntu.sh
Last active March 18, 2024 16:29
Ubuntu installation
#!/bin/bash
echo "Add user and disable password prompt"
adduser manti
usermod -aG sudo manti
echo "manti ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
echo "Remove unnecessary packages"
apt remove -y needrestart
echo "Install base system packages"

Setup Traktor Audio 6 on Ubuntu

Update pulsaduio config

When plugged-in, the soundcard was given a different idProduct than expected (1011 instead of 1010).

  1. Open file /lib/udev/rules.d/90-pulseaudio.rules
  2. Find line with text usb 1-2: New USB device found, idVendor=17cc, idProduct=1011

Compile ffmpeg with basic CPU support

sudo apt install -y yasm libtheora-dev libvorbis-dev libx264-dev libx265-dev \
    libopus-dev libaom-dev libwebp-dev libmp3lame-dev libfdk-aac-dev

git clone https://git.ffmpeg.org/ffmpeg.git && cd ffmpeg/

./configure --enable-gpl --enable-nonfree \

--enable-libfdk-aac --enable-libmp3lame --enable-libopus \

@manti-by
manti-by / git_rewrite.sh
Created November 21, 2016 14:10
Rewrite git commit author
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then