[1] https://qgis.org/resources/installation-guide/#debian--ubuntu
Shapefiles
[1] Perú https://www.geogpsperu.com/2014/03/base-de-datos-peru-shapefile-shp-minam.html
Software Developer, Programming, Web resources and entertaiment. Desarrollo de software, programación, recursos web y entretenimiento.
[1] https://qgis.org/resources/installation-guide/#debian--ubuntu
Shapefiles
[1] Perú https://www.geogpsperu.com/2014/03/base-de-datos-peru-shapefile-shp-minam.html
Automate Horizontal flip by command line single and secure
First:
#!/bin/bash
for f in "$@"; do
# Extract path, filename, and extension
DIR="$(dirname "$f")"
FILE="$(basename "$f")"
NAME="${FILE%.*}"
EXT="${FILE##*.}"
OUTPUT="$DIR/${NAME}_flipped.$EXT"
gimp -i -b "(let* (
(image (car (gimp-file-load RUN-NONINTERACTIVE \"$f\" \"$f\")))
(drawable (car (gimp-image-get-active-layer image)))
)
(gimp-item-transform-flip-simple drawable ORIENTATION-HORIZONTAL TRUE 0)
(gimp-file-save RUN-NONINTERACTIVE image drawable \"$OUTPUT\" \"$OUTPUT\")
(gimp-quit 0)
)"
done
Second:
#!/bin/bash
for f in "$@"; do
DIR="$(dirname "$f")"
FILE="$(basename "$f")"
NAME="${FILE%.*}"
EXT="${FILE##*.}"
OUTPUT="$DIR/${NAME}_flipped.$EXT"
TMP="$(mktemp --suffix=".$EXT")"
# Run GIMP flip
gimp -i -b "(let* (
(image (car (gimp-file-load RUN-NONINTERACTIVE \"$f\" \"$f\")))
(drawable (car (gimp-image-get-active-layer image)))
)
(gimp-item-transform-flip-simple drawable ORIENTATION-HORIZONTAL TRUE 0)
(gimp-file-save RUN-NONINTERACTIVE image drawable \"$TMP\" \"$TMP\")
(gimp-quit 0)
)" >/dev/null 2>&1
# Check result
if [ $? -eq 0 ] && [ -s "$TMP" ]; then
mv "$TMP" "$OUTPUT"
echo "✔ Flipped: $OUTPUT"
else
echo "✖ ERROR flipping $f"
rm -f "$TMP"
fi
done
Disable timers on current web page
in console write the following command
let id = setTimeout(() => {}, 0); while (id--) { clearTimeout(id); clearInterval(id); }
Unminify JavaScript code
https://unminify.com/
Install odoo as service
Step 1: Create a script
user ~ vi /usr/local/bin/odoo-start.sh
#!/bin/bash
# Optional: Port forward example with socat (install via apt install socat)
#socat TCP-LISTEN:8080,fork TCP:localhost:8069 &
# Your Odoo command (example for Odoo 17)
#exec /path/to/odoo-bin -c /path/to/odoo.conf --addons-path=/path/to/addons -d your_db --workers=2
export PYTHONHOME=/usr/local # Or remove if not required
exec /home/user/Software/odoo-17.0/venv/bin/python3 /home/user/Software/odoo-17.0/odoo-bin --http-port=8070 -d casa17g4
Step 2: Create service
user ~ vi /etc/systemd/system/odoo17.service
[Unit]
Description=Odoo 17 Service
After=network.target postgresql.service
[Service]
Type=simple
User=user
Group=user
WorkingDirectory=/home/user/Software/odoo-17.0
ExecStart=/usr/local/bin/odoo-start.sh
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Step 3: Run and Debug
sudo systemctl daemon-reload
sudo systemctl reset-failed odoo17
sudo systemctl start odoo17
sudo journalctl -u odoo17 -e # See error
sudo journalctl -u odoo17 -f # See live
Step 4: Set it for boot
systemctl list-unit-files --type=service --state=enabled | grep odoo
sudo systemctl enable odoo17
systemctl list-unit-files --type=service --state=enabled | grep odoo
sudo systemctl disable odoo17 # disable from boot list
Interactive learn for example docker, kubernetes, linux, python and more
Resources:
[1] extract endpoints/URLs https://github.com/s0md3v/Diggy/tree/master
[2] alternative to nmap https://github.com/s0md3v/Smap
awk -F\| '{print>$1}' file1awk -F\| '{print $1","$2","$5","$6" "$7" "$10","$8" "$9}' padron_reducido_ruc.txt > padron_reducido_rucname.c
sv
iconv -f ISO-8859-1 -t UTF-8 in.txt > out.txt
Solving multiple python installation: sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 3
sudo update-alternatives --config python3 Solving:
Error: Command '['/home/DRIVE/Temp/aa/bin/python3.9', '-Im', 'ensurepip', '--upg
rade', '--default-pip']' returned non-zero exit status 1.
apt-get install python3.6-dev python3.6-venvpython3.6 -m venv myVenv Upgrade pip
pip3 install --upgrade pip
Menu settings/keyboard
gnome-screenshot #default print screen
xfce4-screenshooter #dialog to choose complete/area screen to capture
Ubuntu 18.04.5 LTS (Bionic Beaver)
pgadmin4-desktop pgadmin4-server pgadmin4-web
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /usr/pgadmin4/venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/_rust.abi3.so)
fincahuanaco ~ ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1.4) 2.27
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
fincahuanaco ~ sudo /usr/pgadmin4/bin/setup-web.sh
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by
/usr/pgadmin4/venv/lib/python3.8/site-packages/cryptography/hazmat/bindings/_rust.abi3.so)
Error setting up server mode. Please examine the output above.
Docker Alternative
fincahuanaco ~ docker pull dpage/pgadmin4
sudo docker run -p 5050:5050 -e 'PGADMIN_DEFAULT_EMAIL=email@gmail.com' -e 'PGADMIN_DEFAULT_PASSWORD=password' -e 'PGADMIN_LISTEN_PORT=5050' -d dpage/pgadmin4
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2b0f1c329504 dpage/pgadmin4 "/entrypoint.sh" 25 minutes ago Up 25 minutes awesome_darwin
sudo docker stop 2b0f1c329504
sudo docker inspect 2b0f1c329504 | grep IPAddress #discovery ip
#force use local network
sudo docker run -p 5050:5050 --network host -e 'PGADMIN_DEFAULT_EMAIL=email@gmail.com' -e 'PGADMIN_DEFAULT_PASSWORD=password' -e 'PGADMIN_LISTEN_PORT=5050' -d dpage/pgadmin4
Resume docker containers
$ sudo docker start $(sudo docker ps -q -l)
Docker References:
[1] https://hub.docker.com/r/dpage/pgadmin4/
[2] Deploy https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html
[3] https://stackoverflow.com/questions/53610385/docker-postgres-and-pgadmin-4-connection-refused
[4] Resume docker container https://stackoverflow.com/questions/21928691/how-to-continue-a-docker-container-which-has-exited
#!/bin/bash
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8069
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8070
iptables-save
Permanent in system by:
$sudo vi /etc/rc.local
References:
https://www.odoo.com/forum/help-1/change-to-port-80-instead-of-8069-23031
select name->'es_PE',* from product_template where name->>'es_PE' like '%MEGACI%'
References:
[1] https://popsql.com/learn-sql/postgresql/how-to-query-a-json-column-in-postgresql
References:
[1] https://pendrivelinux.com/vga-boot-modes-to-set-screen-resolution/
$sudo adduser pharmaquipa$sudousermod -aG sudopharmaquipa#add to sudo group
References
[1] https://www.digitalocean.com/community/tutorials/how-to-create-a-new-sudo-enabled-user-on-ubuntu
[2] https://phoenixnap.com/kb/how-to-create-sudo-user-on-ubuntu
/usr/lib/jvm/java-8-openjdk-amd64/bin/java -jar ./facturadorApp-2.1.jar server prod.yaml
References:
[1] SFS(Sistema Facturador SUNAT) https://orientacion.sunat.gob.pe/6790-07-descarga-del-facturador
[2] Make temp certificate for test https://llama.pe/facturador-sunat-see-sfs-certificado-digital
Winamp skins for Linux
https://lunduke.substack.com/p/miss-winamp-try-audacious-the-winamp
Using previous virtual environment (~python 3.10)
pip install --upgrade pip
pip install lxml==5.1.0
pip3 install Werkzeug==2.0.2
pip install pyOpenSSLpip3 install docutils
pip3 install num2words
Trying on python3.8 by empy virtual environment
python3.8 -m pip install virtualenv
python3.8 -m virtualenv test
source test/bin/activate
sudo apt install python3.8-dev
pip install -r requirements.txt
python3 odoo-bin --http-port=1616 -d enter02
Kazam in ubuntu 20 does not show box when you choose area for screen capture sudo add-apt-repository ppa:sylvain-pineau/kazam sudo apt up...