find $DIR -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2- | tail -n 1
Found at StackOverflow.
find $DIR -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2- | tail -n 1
Found at StackOverflow.
Simply run:
apt-get install memtest86+
It will install memtest and reconfigure the menu.
It’s pretty easy:
apt install libipc-run-perl
apt-get install vlan
modprobe 8021q
grep -q 8021q /etc/modules || echo 8021q >> /etc/modules
vim /etc/network/interfaces
auto eth0.99 iface eth0.99 inet static address 192.168.99.1 netmask 255.255.255.0 vlan-raw-device eth0
ifup eth0.99
For some reason vim on Debian went crazy and stopped worked as vim. This is how to make it work like vim instead of vi.
cp /usr/share/vim/vim74/vimrc_example.vim ~/.vimrc
and change
" In many terminal emulators the mouse works just fine, thus enable it. if has('mouse') set mouse=a endif
to
" In many terminal emulators the mouse works just fine, thus enable it. if has('mouse') set mouse=r endif
Hooray.
Some host providers block all email ports (like TCP/25 and TCP/587). Here’s simple of example of how to setup two STMP servers, where SMTP1 is a relay server (forwarder), and SMTP2 uses SMTP1 to send email. Both are using default configuration files with slight changes.
SMTP1 (smart host)
This config line allows SMTP2 to send email without SMTP authorization. For the sake of security it would make sense to restrict access to port 2525 using iptabes.
mynetworks = 127.0.0.1 <IP_of_SMTP2>
This goes to /etc/postfix/main.cf.
And the following
2525 inet n - n - - smtpd
goes to /etc/postfix/master.cf on SMTP1. So that Postfix opens TCP port 2525.
SMTP2
Add this to /etc/postfix/main.cf on SMTP2.
smtp_always_send_ehlo = yes<br />relayhost = 199.101.134.4:2527<br /><br />
After restart you should be able to send emails from SMTP2 via SMTP1‘s using port 2525.
Sometimes you need to dump a mysql database, and there’s no free space on the server. Here’s you can do to back up the database:
ssh -p <ssh port> user@host "mysqldump -u dbuser -ppassword dbname | gzip -9" > database.sql.gz
At the end you will get mysq database on a local server. Although ssh is slow and it would take some time to transfer the database.
[root@host ~]# arcconf getstatus 1 Controllers found: 1 Logical device Task: Logical device : 0 Task ID : 100 Current operation : Rebuild Status : In Progress Priority : High Percentage complete : 0 Command completed successfully. [root@host ~]#
As easy as:
[root@web ~]# sqlite3 /var/www/wordpress/.svn/wc.db SQLite version 3.7.17 2013-05-20 00:56:22 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> SELECT "changed_revision" FROM "NODES" ORDER BY changed_revision DESC LIMIT 1; 586 sqlite> [root@web ~]#
To solve this problem:
Can't locate File/Which.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) BEGIN failed--compilation aborted
you just need to install perl-File-Which package:
yum install perl-File-Which