Based on the following guides:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Define the current working directory and maximum file size (70 MB in bytes) | |
| directory_path=$(pwd) | |
| max_file_size=$((70 * 1024 * 1024)) | |
| # Iterate over all .mp3 files in the directory | |
| for file in "$directory_path"/*.mp3; do | |
| # Check if the file exists | |
| if [[ -f "$file" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo apt install build-essential checkinstall zlib1g-dev | |
| $ cd ~/Downloads | |
| $ wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz | |
| $ tar xf openssl-1.1.1o.tar.gz | |
| $ cd ~/Downloads/openssl-1.1.1o | |
| $ ./config --prefix=/opt/openssl-1.1.1o --openssldir=/opt/openssl-1.1.1o shared zlib | |
| $ make | |
| $ make test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'net/http' | |
| require 'json' | |
| require 'open-uri' | |
| require 'fileutils' | |
| HEROES_URI = "https://mapi.mobilelegends.com/hero/list" | |
| HERO_URI = "https://mapi.mobilelegends.com/hero/detail?id=%s" | |
| heroes_json = JSON.parse(Net::HTTP.get_response(URI(HEROES_URI)).body) | |
| heroes_json['data'].each do |hero_short| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /usr/bin/pg_dump --dbname=DB_NAME --file=/home/user/BACKUPS/localhost/DB_NAME-2020_02_11_13_30_27-dump.sql.tar.gz \ | |
| --format=c --compress=9 --no-owner --clean \ | |
| --exclude-table-data=activities --exclude-table-data=activity_logs \ | |
| --username=postgres --host=127.0.0.1 --port=5432 | |
| /usr/bin/pg_restore --dbname=DB_NAME --clean --format=c \ | |
| --username=postgres --host=127.0.0.1 --port=5432 \ | |
| /home/user/BACKUPS/localhost/starladder_dev-2020_02_11_13_30_27-dump.sql.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo wget -O /usr/share/anycable-go-v0.6.4-linux-amd64 https://github.com/anycable/anycable-go/releases/download/v0.6.4/anycable-go-v0.6.4-linux-amd64 | |
| sudo chmod +x /usr/share/anycable-go-v0.6.4-linux-amd64 | |
| sudo ln -s /usr/share/anycable-go-v0.6.4-linux-amd64 /usr/bin/anycable-go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ruby:2.6.3-alpine | |
| RUN apk add --update --no-cache bash build-base nodejs sqlite-dev tzdata postgresql-dev yarn | |
| RUN gem install bundler:2 | |
| WORKDIR /usr/src/app | |
| COPY package.json yarn.lock ./ | |
| RUN yarn install --check-files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| protected_branches=(develop master) | |
| current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
| if [[ " ${protected_branches[@]} " =~ " ${current_branch} " ]] | |
| then | |
| echo "Push to $current_branch is disabled" | |
| exit 1 # push will not execute | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Running: | |
| saved_changes | |
| { | |
| "status" => [ | |
| [0] 0, | |
| [1] 3 | |
| ], | |
| "updated_at" => [ | |
| [0] 2019-06-07 16:27:36 UTC, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'open3' | |
| require 'fileutils' | |
| require 'tempfile' | |
| CITIES_POPULATION = 500 | |
| LANGS = %w(ru en uk zh tr) | |
| IN_LANGS_QUERY_STR = LANGS.map{|w| "'#{w}'"}.join(',') | |
| def run_command(command) |
NewerOlder