Skip to content

Instantly share code, notes, and snippets.

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

Danish Aziz Satkut danishsatkut

🏠
Working from home
View GitHub Profile
@danishsatkut
danishsatkut / sidekiq.log
Created August 7, 2023 09:02
sidekiq-throttled@e5ac585
2023-08-07T08:56:37.049Z pid=3981 tid=511 INFO: Booted Rails 7.0.6 application in development environment
2023-08-07T08:56:37.049Z pid=3981 tid=511 INFO: Running in ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
2023-08-07T08:56:37.049Z pid=3981 tid=511 INFO: See LICENSE and the LGPL-3.0 for licensing details.
2023-08-07T08:56:37.049Z pid=3981 tid=511 INFO: Upgrade to Sidekiq Pro for more features and support: https://sidekiq.org
2023-08-07T08:56:37.049Z pid=3981 tid=511 INFO: Sidekiq 7.1.1 connecting to Redis with options {:size=>10, :pool_name=>"internal", :url=>nil}
2023-08-07T08:56:37.052Z pid=3981 tid=511 INFO: Sidekiq 7.1.1 connecting to Redis with options {:size=>5, :pool_name=>"default", :url=>nil}
2023-08-07T08:56:37.052Z pid=3981 tid=511 INFO: Starting processing, hit Ctrl-C to stop
2023-08-07T08:56:47.776Z pid=3981 tid=ggt class=SampleJob jid=2cc5d10e1526cfea570e63e2 INFO: start
@danishsatkut
danishsatkut / sample_job.rb
Created August 7, 2023 05:14
Concurrency issue and duplicate jobs due to sidekiq-throttled
# frozen_string_literal: true
class SampleJob
include Sidekiq::Job
include Sidekiq::Throttled::Job
sidekiq_throttle concurrency: { limit: 1 }
def perform(id)
puts "Processing ##{id}"
@danishsatkut
danishsatkut / no-ip-access-http-only.conf
Last active October 9, 2023 21:20
NGINX - Doesn't allow a server to be accessed by ip
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name "";
return 444;
}
@danishsatkut
danishsatkut / crontab_list.sh
Created August 15, 2022 19:26
Ordered crontab list
crontab -l | grep -E '^@|^\*|^[0-9]' | sort -n -k2 -k1
@danishsatkut
danishsatkut / set_mysql_password.sh
Created August 13, 2022 14:31
Set mysql password through a prompt
export MYSQL_PWD=$(>&2 read -s -p "Input password (will not echo): "; echo "$REPLY")
@danishsatkut
danishsatkut / databases_size.sql
Last active August 13, 2022 08:48
Get database/tables size
SELECT *
FROM (SELECT table_schema AS `DB Name`,
ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) AS `DB Size in MB`
FROM information_schema.tables
GROUP BY `DB Name`) AS tmp_table
ORDER BY `DB Size in MB` DESC;
@danishsatkut
danishsatkut / index.html
Last active February 14, 2021 00:27
S3 Uploader
<div id="drag-drop-area"></div>
@danishsatkut
danishsatkut / dabblet.css
Created July 7, 2017 15:56
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@danishsatkut
danishsatkut / dabblet.css
Created July 7, 2017 15:56
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
numbers.filter(function (n) {
return n % 2 == 0;
});