March 30, 2021uncategorized python script getting stuck: how to debug? python3 -m trace --trace /path to python string.py
March 22, 2021March 22, 2021uncategorized php: execute remote ssh script $command = "sudo ssh -p 22 root@XXX.XXX.XX.XX python3 /home/scripts/apps/xxx/xxx/email_address/email_builder.py"; shell_exec($command); note the you have to configure both server to be able […]
March 22, 2021March 22, 2021uncategorized execute command as www-data for example. add known_host to remote server. you cannot su www-data as its not permitted by default, so you can run: […]
March 21, 2021March 23, 2021uncategorized mysql foreign constraints cannot truncate tables because it has constraints. SET FOREIGN_KEY_CHECKS = 0; TRUNCATE table leads; SET FOREIGN_KEY_CHECKS = 1; […]
March 21, 2021uncategorized python: remove special characters from string re.sub('[^A-Za-z0-9]+', '', mystring)
March 20, 2021April 4, 2021uncategorized php composer: incompatible version 2 you can downgrade to version 1 , execute composer install and then revert back composer self-update --1 revert to version 2 […]
March 20, 2021March 20, 2021mysql mysql: min value per group surprisingly, to find the min date per company, which is a super basic query, on mysql you need to do a complicated […]
March 18, 2021March 18, 2021uncategorized jenkins: run jobs as root reference: https://stackoverflow.com/questions/29926773/run-shell-command-in-jenkins-as-root-user sudo vi /etc/default/jenkins $JENKINS_USER="root" sudo chown -R root:root /var/lib/jenkins sudo chown -R root:root /var/cache/jenkins sudo chown -R root:root […]
March 17, 2021March 18, 2021uncategorized openvpn: ubuntu server dns problems when connecting to an openvpn server (at least on ubuntu 20.04) you lose your dns server, meaning you're not able to access […]
March 17, 2021March 17, 2021uncategorized ubuntu: creates ssh-keys for non root user su user ssh-keygen it is saved on: Enter file in which to save the key (/var/lib/jenkins/.ssh/id_rsa)