#debian #supervisor #super #systemctl #bot #superpupper
Supervisor installation & configuration:
Supervisor installation & configuration:
sudo apt update && sudo apt install supervisor
sudo systemctl status supervisor
sudo nano /etc/supervisor/conf.d/bot.conf
[program:bot]
command=/var/www/bot.sh
autostart=true
autorestart=true
stderr_logfile=/var/log/bot.err.log
stdout_logfile=/var/log/bot.out.log
sudo chmod +x /var/www/bot.sh
sudo supervisorctl
sudo supervisorctl stop
sudo supervisorctl start
sudo supervisorctl reread
sudo supervisorctl restart
sudo supervisorctl update
Reconfigure Locales on Debian Server:
#debian #locales #server #кракозябры #characters #кодировка #encoding
dpkg-reconfigure locales
#debian #locales #server #кракозябры #characters #кодировка #encoding
Some docker PHP container errors:
Error:
Solution:
Error:
Solution:
Error:
Solution:
Error:
Solution:
#docker #php #error #errors #dockerfile
Error:
=> ERROR [php stage-0 5/9] RUN docker-php-ext-install curl
...
1.877 configure: error: Package requirements (libcurl >= 7.29.0) were not met:
...
Solution:
RUN apt -y install libcurl4-openssl-dev
Error:
=> ERROR [php stage-0 8/10] RUN docker-php-ext-install pdo_pgsql
...
1.853 configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
...
Solution:
RUN apt -y install libpq-dev
Error:
=> ERROR [php stage-0 9/10] RUN docker-php-ext-install zip
...
1.930 configure: error: Package requirements (libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0) were not met:
...
Solution:
RUN apt -y install libzip-dev
Error:
=> ERROR [php stage-0 11/11] RUN docker-php-ext-install mbstring
...
1.758 configure: error: Package requirements (oniguruma) were not met:
...
Solution:
RUN apt -y install libonig-dev
#docker #php #error #errors #dockerfile
Bash script automatically execution after system startup on your Xubuntu system:
🖱
#xubuntu #autostart #linux #bash #autostart #startup
cd ~
nano bootstrap.sh
nohup "/home/roman/.local/share/JetBrains/Toolbox/apps/phpstorm/bin/phpstorm.sh" > /dev/null 2> /dev/null &
nohup "google-chrome-stable" > /dev/null 2> /dev/null &
nohup "/opt/Telegram/Telegram" > /dev/null 2> /dev/null &
sudo chmod 777 bootstrap.sh
MenuSession and StartupApplication Autostart Fill name, description & command/home/roman/bootstrap.sh
Add & Close#xubuntu #autostart #linux #bash #autostart #startup
Please open Telegram to view this post
VIEW IN TELEGRAM
Host: Xubuntu 23.10 (mantic)
# id
uid=1000(roman) gid=1000(roman) ...
Docker Container: Debian 12 (bookworm)
Dockerfile:
FROM node:21.6.2-bookworm
RUN apt-get update && apt-get install sudo
RUN echo "node:root" | chpasswd && usermod -aG sudo node
# Other RUN instructions ...
USER node
#docker #fix #php #dockerfile #chmod
Please open Telegram to view this post
VIEW IN TELEGRAM
🤝1
Please open Telegram to view this post
VIEW IN TELEGRAM
Tampermonkey take page screenshot button:
// ==UserScript==
// @name Screenshot Downloader
// @namespace http://your.namespace.com
// @version 1.0
// @description Take a screenshot and download it as an image
// @include *://*/*
// @grant GM_download
// @require https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js
// ==/UserScript==
(function() {
'use strict';
// Function to convert the screenshot to a base64 image
function takeScreenshotAndDownload() {
html2canvas(document.body, {
onrendered: function(canvas) {
var screenshotUrl = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
GM_download({
url: screenshotUrl,
name: 'screenshot.png'
});
}
});
}
// Add a button to trigger the screenshot download
var button = document.createElement('button');
button.innerText = 'Photo';
button.onclick = takeScreenshotAndDownload;
button.style.position = 'absolute';
button.style.top = '70px';
button.style.right = '50px';
document.body.appendChild(button);
})();
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
sudo yum install bluez || sudo apt install bluez
bluetoothctl connect A1:B2:C3:E4:F5:G6 # MAC Address
#bluetooth #headphones #bluez #bluetoothctl
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Workaround Yandex Music Script
setInterval(() => {
navigator.mediaSession.setActionHandler("pause", (details) => {
const nextButton = document.getElementsByClassName('d-icon d-icon_track-next')[0];
if (nextButton) {
nextButton.click();
console.log('Clicked on the next button successfully.');
} else {
console.log('Element not found. Make sure the class selector is correct.');
}
console.log('Pause');
});
}, 1);#yandex #music #js #tampermonkey #workaround #bluetooth #pause
Please open Telegram to view this post
VIEW IN TELEGRAM
❤1🔥1
echo "Enter your slave branch:"
read your_branch
echo "Enter your main branch:"
read master_branch
changes=$(git --no-pager diff --name-only "$master_branch" "$your_branch")
while IFS= read -r file;
do
file_changes=$(git --no-pager diff "$master_branch" "$your_branch" -- "$file")
line_count=$(echo "$file_changes" | wc -l)
if [ "$line_count" -eq 3 ]; then
line2=$(echo "$file_changes" | sed -n '2p') # Get the second line
line3=$(echo "$file_changes" | sed -n '3p') # Get the third line
if [[ "$line2" == "old mode"* ]] && [[ "$line3" == "new mode"* ]]; then
chmod -x "$file"
fi
fi
done <<< "$changes"
echo "Success! Happy codding!"
Fast execution:
curl -so fix-git-mode.sh https://gist.githubusercontent.com/makhnanov/275672ed5d139170d62d338ddf18faab/raw/abf3998b9198b64962c4e3e9ec5aa4e4e532018a/fix-git-mode.sh && chmod +x fix-git-mode.sh && ./fix-git-mode.sh && rm fix-git-mode.sh
#permission #mode #chmod #git #rollback
Please open Telegram to view this post
VIEW IN TELEGRAM
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
nvm i node
Alternative:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
nvm install 20.16.0
Check Current NodeJS Versions
#js #javascript #nvm #npm #node
Please open Telegram to view this post
VIEW IN TELEGRAM
nodejs.org
Node.js — Node.js Releases
Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.
Please open Telegram to view this post
VIEW IN TELEGRAM