Skip to content

Instantly share code, notes, and snippets.

View DmitriyLyalyuev's full-sized avatar
💭
Trying to exit vim

Silver Ghost DmitriyLyalyuev

💭
Trying to exit vim
View GitHub Profile
#!/bin/bash
# Made by Dade Murphy (https://geeknest.ru)
# Related: https://habr.com/ru/articles/856602/
read -p "Enter Zone ID (can be found in domain overview): " ID_ZONE
read -p "Enter Global API Key (from Cloudflare profile): " GLOBAL_API_KEY
read -p "Enter Cloudflare account email: " ACCOUNT_EMAIL
echo "Sending request to Cloudflare API..."
@DmitriyLyalyuev
DmitriyLyalyuev / safari-summary.sh
Created December 29, 2024 10:13
Mistral AI summarizer for Raycast
#!/bin/bash
# @raycast.schemaVersion 1
# @raycast.title Summarize Safari page
# @raycast.mode fullOutput
#
# Optional parameters:
# @raycast.icon ✨
#
# @raycast.packageName Things
@DmitriyLyalyuev
DmitriyLyalyuev / gist:1440e4bf224a13707d7484bdeb7972d2
Created November 1, 2021 15:58
Remove all draft releases on GitHub
brew install hub
git clone [email protected]:username/reponame
cd reponame
hub release -f "%T (%S) %n" --include-drafts | grep " (draft)" | awk '{print $1}' | xargs -t -n1 hub release delete
#!/bin/bash
## Start and end months
MONTHS='1 2 3 4'
YEAR='2021'
### Downloading logs
echo "Making logs directory..."
mkdir -p logs && echo "...Success"
@DmitriyLyalyuev
DmitriyLyalyuev / htoprc
Created April 15, 2021 11:17
My htoprc
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=46
sort_direction=1
hide_threads=0
hide_kernel_threads=0
hide_userland_threads=0
shadow_other_users=0
show_thread_names=0
gdb
(gdb) file /opt/ruby-2.2.3/bin/ruby
(gdb) attach [pid]
# output of the C backtrace goes to the gdb console
(gdb) eval "backtrace"
# output of the Ruby application backtrace below goes to ruby stdout (rails logger?)
(gdb) call rb_backtrace()
(gdb) continue
@DmitriyLyalyuev
DmitriyLyalyuev / gist:645f06808eed24f9b081470ef9282156
Last active March 1, 2021 10:43
Install Nginx + Enterprise Passenger
# Setup Enterprise Passenger
# https://www.phusionpassenger.com/library/install/standalone/install/enterprise/rubygems_rvm/#step-1:-download-and-install-your-license-key
unset HISTFILE
export TOKEN=545d1d5b9e8c426b1.......................514dc2cb8a9b77309c054a38c9
gem source --add https://download:${TOKEN}@www.phusionpassenger.com/enterprise_gems/
gem install passenger-enterprise-server --no-rdoc --no-ri
# Compiling agent
export PASSENGER_ROOT=`passenger-config --root`
@DmitriyLyalyuev
DmitriyLyalyuev / setup_memcached_bitnami_wp.sh
Created November 17, 2019 12:32
Add memcached support to Bitnami WP stack
#!/bin/bash
export LIBMEMCACHED_VERSION='1.0.18'
export PHPMEMCACHED_VERSION='2.2.0'
# Install dependencies
sudo apt update
sudo apt install -y memcached
sudo apt install -y build-essential libtool autoconf unzip wget git pkg-config
@DmitriyLyalyuev
DmitriyLyalyuev / gist:91a8ff041691a8f5688b2ad50a8f0ea1
Created November 17, 2019 12:29
Install ruby via rbenv with jemalloc
sudo apt install libjemalloc-dev
sudo su - deployer
cd /home/deployer/.rbenv/plugins/ruby-build && git pull && cd -
CONFIGURE_OPTS="--with-jemalloc" rbenv install 2.6.5
@DmitriyLyalyuev
DmitriyLyalyuev / gist:4e61645c1b36771645f88daa8ba50b2e
Created August 15, 2019 11:20
s3 cross account replication with aws cli
aws s3 sync s3://SOURCE-BUCKET-NAME s3://DESTINATION-BUCKET-NAME --source-region SOURCE-REGION-NAME --region DESTINATION-REGION-NAME