Skip to content

Instantly share code, notes, and snippets.

@kerbrose
kerbrose / odoo_dev.sql
Last active November 13, 2024 14:57
useful psql commands
# used to delete a view that contains a removed field
delete from ir_ui_view where position('FIELD_NAME' in arch_db)>0;
# in odoo 16 ir_ui_view becomes a jsonb
delete from ir_ui_view where arch_db->>'en_US' ilike '%FIELD_NAME%' ;
update ir_ui_view set active = FALSE where position('FIELD_NAME' in arch_db)>0;
@kerbrose
kerbrose / firefox_about_config
Last active February 2, 2021 04:55
vscode_mess_open_folder
layout.css.devPixelsPerPx
@kerbrose
kerbrose / 00-homelab.conf
Last active March 30, 2021 20:30
manjaro configuration
# /etc/NetworkManager/dnsmasq.d/00-homelab.conf
#
# This file directs dnsmasq to forward any request to resolve
#server=/homelab/172.31.0.1 this is if you want .homelab
address=/localhost/127.0.0.1
@kerbrose
kerbrose / opened_port.sh
Last active January 18, 2021 10:26
check opened ports
netstat -ntlp
netstat -nulp
# for iprout2 packages
sudo ss -tulpn
( nmcli dev list || nmcli dev show ) 2>/dev/null | grep DNS
nmcli dev show | grep 'IP4.DNS'
@kerbrose
kerbrose / after_lets_encrypt
Created December 1, 2020 12:28
cool nginx conf
server {
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name loca.com;
location / {
try_files $uri $uri/ =404;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
cat list.txt | xargs -I{} find . -path \*{}
cat list.txt | xargs -I{} find . -path \*{} | xargs -I{} grep name {}
echo algorithm | xargs -I {} find . -type f \( -iname "*{}*.pdf" -or -iname "*{}*.epub" -or -iname "*{}*.mobi" -or -iname "*{}*.azw" -or -iname "*{}*.azw3" \)
@kerbrose
kerbrose / slideshow.sh
Created August 22, 2020 23:48
ffmpeg slideshow
# https://trac.ffmpeg.org/wiki/Slideshow
ffmpeg -framerate 1/5 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p out.mp4
@kerbrose
kerbrose / install.sh
Last active July 11, 2020 08:15
installing mongodb
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
# limit arch to amd64
echo "deb [arch=amd64] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt-get update && sudo apt-get install -y mongodb-org
# add the init.d file
# from https://github.com/microsoft/WSL/issues/1822#issuecomment-537486209
# https://github.com/mongodb/mongo/blob/master/debian/init.d
# path /etc/init.d/mongod
wget -O /etc/init.d/mongod https://raw.githubusercontent.com/mongodb/mongo/master/debian/init.d
@kerbrose
kerbrose / xfce.md
Created June 27, 2020 23:17
Change ALT key on xfce4 on MX Linux

go to Settings Editorxfwm4easy_click change ALT to Super

@kerbrose
kerbrose / artix_setup.sh
Last active February 9, 2021 10:13
step toward configuring artix
# Disable Beep PC Speaker
rmmod pcspkr
echo "blacklist pcspkr" | tee /etc/modprobe.d/nobeep.conf
# update pacman repos
pacman -Syu
# or
pacman -Syu --overwrite /usr/lib\*/p11-kit-trust.so
sudo pacman -S base-devel bzip2 clang code dnsmasq dnsmasq-openrc firefox-developer-edition gcc gcc-go git libffi libpqxx libreoffice-fresh \
llvm openssl otf-fira-mono noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra ncurses postgresql postgresql-openrc \
postgresql-libs python-pip python-pyopenssl python-virtualenv re2 readline sqlite tk ttf-fira-code xz zlib