Skip to content

Instantly share code, notes, and snippets.

View alekpopovic's full-sized avatar
🏠
Working from home

Aleksandar Popovic alekpopovic

🏠
Working from home
View GitHub Profile
@alekpopovic
alekpopovic / docker-compose.yml
Created October 12, 2022 10:46 — forked from cmackenzie1/docker-compose.yml
Docker Compose for DynamoDB Local and Admin UI
version: '3.7'
services:
dynamodb-local:
image: amazon/dynamodb-local:latest
container_name: dynamodb-local
ports:
- "8000:8000"
dynamodb-admin:
image: aaronshaf/dynamodb-admin
@alekpopovic
alekpopovic / gh-deploy.sh
Created October 5, 2022 13:32 — forked from patarapolw/gh-deploy.sh
Vite on Github Pages with HTML5 History Mode
#!/usr/bin/env bash
set -e
rm -rf dist
GH=1 yarn build
GIT_URL=$(git remote get-url origin)
cd dist
@alekpopovic
alekpopovic / bigkeys (new)
Created October 3, 2022 15:24 — forked from michael-grunder/bigkeys (new)
redis-cli --bigkeys (new)
➜ src git:(cli_improved_bigkeys) ✗ time ./redis-cli --bigkeys
# Scanning the entire keyspace to find biggest keys as well as
# average sizes per key type. You can use -i 0.1 to sleep 0.1 sec
# per 100 SCAN commands (not usually needed).
[00.00%] Biggest hash found so far '530f8e1db5876:1:hash:146377' with 44 fields
[00.00%] Biggest list found so far '530f8ed14a8b0:17:list:269378' with 193 items
[00.00%] Biggest set found so far '530f8da537194:83:set:63043' with 432 members
[00.00%] Biggest string found so far '530f8f2de7045:95:string:333887' with 345 bytes
@alekpopovic
alekpopovic / osx_setup.md
Created September 30, 2022 10:50 — forked from mcls/osx_setup.md
Setup mac for ruby dev
@alekpopovic
alekpopovic / nginx-server-block-generator.sh
Created September 28, 2022 11:36 — forked from 0xAliRaza/nginx-server-block-generator.sh
A handy shell script to create Nginx server-block (virtual host).
#!/usr/bin/env bash
#
# Nginx - new server block
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
die() {
echo -e '\e[1;31m'$1'\e[m'
exit 1
}
@alekpopovic
alekpopovic / rails_new_options_help.md
Created September 22, 2022 14:26 — forked from kirillshevch/rails_new_options_help.md
List of "rails new" options to generate a new Rails 7 application

Run rails new --help to view all of the options you can use to generate new Rails application:

Output for Rails 7+

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-namespace], [--no-skip-namespace]              # Skip namespace (affects only isolated engines)
@alekpopovic
alekpopovic / gist:e63e03055c2da9d18f5e685291e64112
Created August 10, 2022 09:14 — forked from dkam/gist:9755012
Postgresql pub/sub in Ruby
require 'sequel'
DB = Sequel.connect('postgres://user:pass@localhost/db')
DB.listen(:my_channel, loop: true) {|channel, pid, payload| puts "Got payload '#{payload}' on channel '#{channel}'" }
@alekpopovic
alekpopovic / README
Created June 21, 2022 23:31 — forked from deeja/README
Kubernetes Dashboard on Docker for Windows
## Instructions
https://collabnix.com/kubernetes-dashboard-on-docker-desktop-for-windows-2-0-0-3-in-2-minutes/
## Dashboard URL
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default
@alekpopovic
alekpopovic / 1 Setup vps.md
Created May 5, 2022 15:46 — forked from deHelden/"torn" 1 Setup vps.md
Deploy Rails 6.0.0 to VPS(DigitalOcean Ubuntu 19). Nginx, Puma, Capistrano3, PostgreSQL, Rbenv.

SETUP VPS

based on DigitalOcean guide

Create local project

local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
@alekpopovic
alekpopovic / nginx_global_domains.config
Created April 27, 2022 22:13 — forked from Greegko/nginx_global_domains.config
nginx setup for dynamic domains and their subdomains
# Source: https://stackoverflow.com/questions/8199231/how-to-setup-mass-dynamic-virtual-hosts-in-nginx
server {
listen 80 default_server;
listen [::]:80 default_server;
# Match any server name with the format [subdomain.[.subdomain...]].domain.tld.dev
server_name ~^(?<subdomain>([\w-]+\.)*)?(?<domain>[\w-]+\.[\w-]+)\.dev$;
# Map by default to (projects_root_path)/(domain.tld)/www;