Etiket arşivi: linux

ISPConfig 3 web arayüz şifre resetleme

Öncelikle sunucudaki mysql’e bağlanıyoruz. Eğer mysql’in de şifresini hatırlamıyorsanız aşağıdaki kodla mysql bilgilerini elde edebilirsiniz.

cat /usr/local/ispconfig/server/lib/mysql_clientdb.conf

Daha sonra aşağıdaki kod ile mysql’deki dbispconfig veri tabanına bağlanıyoruz.

mysql -h localhost -p dbispconfig

Şifre alanına bir önceki kod ile öğrendiğimiz şifreyi girdik. Daha sonra aşağıdaki kodlarla şifreyi güncelleyerek mysql’den çıkıyoruz. Arayüzden yeni şifrenizle bağlanabilirsiniz.

UPDATE sys_user SET passwort = md5('YourNewPassword') WHERE username = 'admin';
FLUSH PRIVILEGES;
quit;

Kaynak: https://www.e-rave.nl/how-to-reset-the-admin-password-for-ispconfig-3

linux add path

add new paths to .bash_profile file and logoff and login again.

export PATH=$PATH:$HOME/ncbi-blast-2.2.29+/bin
export BLASTDB=$HOME/blastdb

Başka bir yöntem de şudur; /etc/profile.d/dosya.sh şeklinde bir dosya açılır. İçerik aşağıdaki gibidir.

!/bin/bash
export PATH=$PATH:/lustre/nuh/ncbi-blast-2.5.0+/bin/

Dosya kaydedildikten sonra çalıştırılabilir olarak ayarlanır. İşlem tamamdır.

chmod +x /etc/profile.d/dosya.sh

Apache2 redirect subdomains http to https

Edit /etc/apache2/sites-available/000-default as;

ServerAdmin admin@domain.com
ServerName domain.com
ServerAlias www.domain.com
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [NC,R,L]

Source: https://www.digitalocean.com/community/questions/ubuntu-14-04-apache2-how-to-confi-https-and-subdomain

Raspberry Pi / Linux : Change mac address permanently

To change mac address of raspberry pi, edit /etc/network/interfaces file as shown below;

auto eth0
iface eth0 inet dhcp
hwaddress ether 00:00:00:00:00:00 # (mac address)

And then reboot the pi. It’s ok.

Some Iptables Commands

allow an IP to traffic –> sudo iptables -I INPUT 1 -s 192.168.5.6 -j ACCEPT 
allow an IP to traffic –> sudo iptables -I INPUT 1 -s 192.168.5.7 -j DROP 
allow to reach a port –> sudo iptables -A INPUT -p tcp –dport 993 -j ACCEPT 
allow server to ping –> sudo iptables -A INPUT -p icmp –icmp-type echo-request -j ACCEPT 
delete a rule –> sudo iptables -D INPUT sequence_number_of_the_rule