Skip to content

Instantly share code, notes, and snippets.

View daltondiaz's full-sized avatar
😁
Coding ...

Dalton daltondiaz

😁
Coding ...
View GitHub Profile
@bashbunni
bashbunni / .zshrc
Created January 4, 2023 16:28
CLI Pomodoro for Linux
# study stream aliases
# Requires https://github.com/caarlos0/timer to be installed. spd-say should ship with your distro
declare -A pomo_options
pomo_options["work"]="45"
pomo_options["break"]="10"
pomodoro () {
if [ -n "$1" -a -n "${pomo_options["$1"]}" ]; then
val=$1
local M = {}
function M.setup()
local on_attach = function(client, bufnr)
require'jdtls.setup'.add_commands()
require'jdtls'.setup_dap()
require'lsp-status'.register_progress()
-- require'lspkind'.init()
-- require'lspsaga'.init_lsp_saga()
@RogerRiggs
RogerRiggs / SensitiveData.java
Last active March 12, 2025 09:54
Example Using java.lang.ref.Cleaner as a Replacement for Finalize and Testing of the cleanup.
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@mvtenorio
mvtenorio / config_linux.md
Last active January 25, 2021 19:21
Configuração do meu ambiente Linux
@andrebrait
andrebrait / keychron_linux.md
Last active April 24, 2025 05:27
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@qiangxue
qiangxue / cloudwatch_log_insights_mysql_slow_query_examples.md
Created October 20, 2020 19:28 — forked from grocky/cloudwatch_log_insights_mysql_slow_query_examples.md
CloudWatch Log Insights query examples for MySQL slow query log.

Filtering queries

Find slowest write queries

parse @message /Query_time: (?<queryTime>.*?) Lock_time: (<?lockTime>.*?) Rows_sent: (?<rowsSent>.*?) Rows_examined: (?<rowsExamined>.*?)\s(?<query>.*?)$/
  | filter @message like /(?i)insert/
  | sort queryTime desc
  | limit 10
@asvignesh
asvignesh / php_zts_pthread.md
Last active December 29, 2024 04:14
Install PHP ZTS and enable the pThread

Install packages needed for compiling

sudo apt-get update

sudo apt install autoconf automake bison build-essential curl flex \
  libtool libssl-dev libcurl4-openssl-dev libxml2-dev libreadline7 \
  libreadline-dev libsqlite3-dev libzip-dev libzip4 nginx openssl \
  pkg-config re2c sqlite3 zlib1g-dev
 
@christophengelmayer
christophengelmayer / tailwind-resonsive-embed.html
Last active September 10, 2024 11:52
Tailwind CSS responsive Video embed
<div class="relative" style="padding-top: 56.25%">
<iframe class="absolute inset-0 w-full h-full" src="https://www.youtube-nocookie.com/embed/FMrtSHAAPhM" frameborder="0" …></iframe>
</div>
@alicoskun
alicoskun / Create local SSL certificate for NGINX on Windows.md
Last active March 15, 2025 07:26
Create local SSL certificate for NGINX on Windows

1. Run following script in PowerShell

param (
    [Parameter(Mandatory=$true)][string]$certificatename,
    [Parameter(Mandatory=$true)][SecureString]$certificatepassword
 )
# setup certificate properties including the commonName (DNSName) property for Chrome 58+
$certificate = New-SelfSignedCertificate `
    -Subject localhost `
    -DnsName localhost `

Adjusting child processes for PHP-FPM (Nginx)

Problem:

The following warning message appears in the logs:

[26-Jul-2012 09:49:59] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 8 idle, and 58 total children  
[26-Jul-2012 09:50:00] WARNING: [pool www] server reached pm.max_children setting (50), consider raising it  
It means that there are not enough PHP-FPM processes.