Skip to content

Instantly share code, notes, and snippets.

View MostafaNorzade's full-sized avatar
🎯
Focusing

Mostafa Norzade MostafaNorzade

🎯
Focusing
View GitHub Profile
1. upload all files to /home/user/public_html
2. edit /var/cpanel/userdata/$username/$domain.com
3. change the 'documentroot' path from 'public_html' to 'public_html/public'
4. /usr/local/cpanel/scripts/rebuildhttpdconf
5. /usr/local/cpanel/scripts/restartsrv_httpd
6. /usr/local/cpanel/scripts/restartsrv_apache
Done!
Check from cpanel > domains > your_domain_Document Root
SELECT COUNT(*) as count, created_at FROM `subscriptions` WHERE status != 0 GROUP BY DATE(`created_at`) ORDER BY count DESC
SELECT users.mobile FROM users
WHERE users.mobile NOT IN (
SELECT users.mobile FROM subscriptions
INNER JOIN users ON subscriptions.user_id = users.id
WHERE subscriptions.type IN (1,2) AND
subscriptions.status = 2 AND
users.mobile IS NOT NULL
);
kernel.panic=10
kernel.randomize_va_space=2
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.exec-shield = 1
kernel.randomize_va_space = 1
kernel.dmesg_restrict = 1
kernel.kptr_restrict = 1
net.ipv4.icmp_ignore_bogus_error_responses=1
################# change DNS for iran server #####################
lsattr /etc/resolv.conf
chattr -a /etc/resolv.conf
lsattr /etc/resolv.conf
chattr -i /etc/resolv.conf
lsattr /etc/resolv.conf
systemctl status zabbix-server.service
● zabbix-server.service - Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2020-09-05 14:47:17 +0430; 5s ago
Process: 32973 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=1/FAILURE)
#################################### run in commandline ##########
# ausearch -c 'zabbix_server' --raw | audit2allow -M my-zabbixserver
1- `ssh-keygen -t rsa -b 4096 -C "your_email@example.com" ` :create new ssh_key . insert any email
2- `ls -la ~/.ssh` : view all ssh_key
3- add pub key in gitlab setting ssh_key
4- `git remote show origin` : you have get git@gilab.com/username/repository.git. if not this :
5- `git remote set-url origin YOUR_SSH_GIT_ADDRESS_with_ssh`
6- `eval $(ssh-agent -s)` : check your ssh_key
7- `ssh -T git@gitlab.com` : check
`
sudo lsblk // Command to list block device on Linux
sudo dd if=/home/mostafa/Download/image.iso of=/dev/sdb bs=8M
install: pip install supervisor
configure:
mkdir -p /etc/supervisord/conf.d
echo_supervisord_conf > /etc/supervisord/supervisord.conf
echo "files = conf.d/*.conf" >> /etc/supervisord/supervisord.conf
setup as service: wget supervisord.service -O /usr/lib/systemd/system/supervisord.service
start service systemctl start supervisord
view service status: systemctl status supervisord
auto start service on system startup: systemctl enable supervisord
UPDATE subscriptions
SET status = 1
WHERE DATE(start)<'2020-06-28' and DATE(end)<'2020-06-28' and status=2
;