Skip to content

Instantly share code, notes, and snippets.

View felipsmartins's full-sized avatar
🇧🇷
loading, please wait a few seconds...

Martins, F. felipsmartins

🇧🇷
loading, please wait a few seconds...
View GitHub Profile
@felipsmartins
felipsmartins / sql_mode_max_int
Created February 13, 2023 15:24
mysql max int sql_mode
MySQL [xxx]> desc teste;
+----------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+------------------+------+-----+---------+-------+
| int_positivo | int(10) unsigned | YES | | NULL | |
| int_sinalizado | int(11) | YES | | NULL | |
+----------------+------------------+------+-----+---------+-------+
2 rows in set (0,003 sec)
MySQL [xxx]> set sql_mode = 'STRICT_TRANS_TABLES';
@felipsmartins
felipsmartins / gpu-screen-recorder.sh
Last active January 7, 2023 05:23
gpu-screen-recorder -o ~/clips -c mp4 -f 60 -r 15 -w DP-2 -a "$X_AUDIO1.monitor" -a "$X_AUDIO2"
# # pactl list sinks short
X_AUDIO1=alsa_output.pci-0000_08_00.4.analog-stereo
# pactl list sources short
X_AUDIO2=alsa_input.usb-Kingston_HyperX_SoloCast-00.analog-stereo
gpu-screen-recorder -o ~/clips -c mp4 -f 60 -r 15 -w DP-2 -a "$X_AUDIO1.monitor" -a "$X_AUDIO2"
# obs: infelizmente gravando mic e output n funciona. Mas só gravando audio do desktop funciona
@felipsmartins
felipsmartins / environment
Last active November 5, 2023 18:18
/etc/environment
# adicionando em 19/02/2022 para apps flatpak iniciarem no cinnamon
XDG_CURRENT_DESKTOP=GNOME
# Stop minimizing with BorderlessFullscreen
# https://steamcommunity.com/app/281990/discussions/0/357286119110496701/
SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0
# refresh rate multiple displays (this is only for GNOME with NVIDIA)
@felipsmartins
felipsmartins / uwsgi.ini
Created May 23, 2022 00:36
python uwsgi example
; #CMD uwsgi --ini uwsgi.ini --threads 2
[uwsgi]
chdir = /code
http-socket = 0.0.0.0:8051
http-enable-proxy-protocol = 1
;workers = 3
processes = 5
module = <PROJECT>.wsgi:application
env = DJANGO_SETTINGS_MODULE=<PROJECT>.settings.$(APP_ENVIRONMENT)
single-interpreter = true
@felipsmartins
felipsmartins / debian-kernel-update.md
Created February 13, 2022 23:05
debien update kernel from backports
sudo apt -t bullseye-backports install linux-headers-amd64
sudo apt -t bullseye-backports install linux-image-amd64
# optional
sudo apt -t bullseye-backports install linux-firmware

 sudo grub-probe -t device /boot/grub # in my case results: /dev/sdc2
 # pick result from above command and:
 sudo grub-install /dev/sdc
 sudo update-grub
@felipsmartins
felipsmartins / comma-to-dot.md
Last active July 7, 2023 16:10
switch comma to dot in numpad
  1. open dconf-editor
  2. navigate to org.gnome.desktop.input-sources xkb-options
  3. add/append to the list (array): 'kpdl:dot'
  4. Save!

Short way: gsettings set org.gnome.desktop.input-sources xkb-options "['kpdl:dot']"
//gsettings set org.gnome.desktop.input-sources xkb-options "['kpdl:comma']"

credits: https://askubuntu.com/a/524843/107915

@felipsmartins
felipsmartins / replace-coma-by-dot-numkeypad.sh
Created May 12, 2021 13:26
Numeric Keypad - switch comma "," to period "."
# from: https://askubuntu.com/questions/816610/numeric-keypad-switch-comma-to-period-german-keyboard-layout
setxkbmap de -option kpdl:dot
# OR
# /etc/default/keyboard
# KEYBOARD CONFIGURATION FILE
# XKBMODEL="pc105"
@felipsmartins
felipsmartins / jetbrains-ide-common-issues.md
Last active April 2, 2023 22:54
JETBRAINS IDE - Toggle Case (Ctrl-Shift-U) not working under (Linux)

Toggle Case (Ctrl-Shift-U) not working under (Linux)

From: https://youtrack.jetbrains.com/issue/IDEA-112533

  1. Run ibus-setup (from command-line)
  2. Switch to Emoji tab
  3. Click the ... button next to Unicode Code Point
  4. Modify (or delete) the shortcut, click Apply
@felipsmartins
felipsmartins / php-5.5-compile.sh
Last active March 31, 2021 15:44
PHP 5.5 compile, PHP55 compiling
# compilado no debian bullseye (testing)
export PHP_SOURCE_DIR=~/Downloads/php-5.5.30
export OPENSSL_PREFIX_DIR=/opt
# se não der pra usar o openssl dev (libssl?) do OS, baixar os fontes
wget https://ftp.openssl.org/source/old/1.0.2/openssl-1.0.2s.tar.gz
cd ./openssl-1.0.2s
./config --prefix=$OPENSSL_PREFIX_DIR --openssldir=$OPENSSL_PREFIX_DIR/openssl
@felipsmartins
felipsmartins / local.conf
Last active March 18, 2021 18:23
linux-sound-intel-i915-dell-3410 (dummy-output issue) Debian testing (Bullseye)
# /etc/modprobe.d/local.conf
options snd-hda-intel dmic_detect=0
options snd-hda-intel index=0