use rsync with Filter option to include some files.
For example:
rsync -auvz -f'+ [Aa][Mm]*' -f'+ */' -f'- *' /SOURCE-Folder/ /TARGET-Folder/
It means: exclude all files and include only files beginning with A and M (insensitive).
Tuesday, November 11, 2014
Wednesday, November 5, 2014
Add line to the beginning of a file in Bash
To add a line to the beginning of a file, use this command:
sed -i '1s/^/YOUR NEW LINE\n/' YOUR-FILE.TXT
Thursday, October 30, 2014
Mysql 5.5 Innodb slow insert query issue
An upgrade MySQL from version 5.1 to 5.5 has very slowed Typo3 instances.
The reason was very slow insert queries in InnoDB tables.
In order to save you some distress, for a possible solution, add following line to my.cnf and restart the mysql:
The reason was very slow insert queries in InnoDB tables.
In order to save you some distress, for a possible solution, add following line to my.cnf and restart the mysql:
innodb_flush_log_at_trx_commit=0
Wednesday, October 15, 2014
Disable SSLv2 and SSLv3 in Apache
The best way to disable both SSLv2 and SSLv3 and only enable TLS 1.0-1.2 is to use this configuration in your Apache configuration file:
SSLProtocol TLSv1
SSLProtocol TLSv1
Example:
SSLEngine On
SSLProtocol TLSv1
SSLCertificateFile domain.crt
SSLCertificateKeyFile domain.key
Testing your SSL Version
if you want to test your ssl version details of perticular host use the following command:
openssl s_client -connect YOURDOMAIN:443
You need to replace YOURDOMAIN to your website hostname Output looks like below:
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : ....
Session-ID: ....
openssl s_client -connect YOURDOMAIN:443
You need to replace YOURDOMAIN to your website hostname Output looks like below:
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : ....
Session-ID: ....
Wednesday, September 24, 2014
Checking Varnish configuration syntax
If you have updated your Varnish configuration and want to check it,
run this command:
if everything is correct, Varnish will dump out the genrated configuration, otherwise you will get an error message pointing you to a specific line number.
run this command:
varnishd -C -f /etc/varnish/default.vclif everything is correct, Varnish will dump out the genrated configuration, otherwise you will get an error message pointing you to a specific line number.
Tuesday, September 23, 2014
Benchmarking LAN Network Connectivity in Linux
Using netcat:
on destination machine run this command:
(This tells netcat to open port 20000 and listen for connections.)
nc -l 20000 > /dev/null
on source machine execute this command:
(This command will transfer 30MB of data over the network (a blocksize of 1MB, and 30 blocks, is 30MB)
dd if=/dev/zero bs=1M count=30 | nc HERE.COMES.DEST.IP 20000
Once all data is transferred, you’ll get the output from the dd command, showing throughput:
30+0 records in
30+0 records out
31457280 bytes (31 MB) copied, 5.40742 s, 5.8 MB/s
source: http://techthrob.com/2014/01/benchmarking-lan-network-connectivity-in-linux/
on destination machine run this command:
(This tells netcat to open port 20000 and listen for connections.)
nc -l 20000 > /dev/null
on source machine execute this command:
(This command will transfer 30MB of data over the network (a blocksize of 1MB, and 30 blocks, is 30MB)
dd if=/dev/zero bs=1M count=30 | nc HERE.COMES.DEST.IP 20000
Once all data is transferred, you’ll get the output from the dd command, showing throughput:
30+0 records in
30+0 records out
31457280 bytes (31 MB) copied, 5.40742 s, 5.8 MB/s
source: http://techthrob.com/2014/01/benchmarking-lan-network-connectivity-in-linux/
Friday, September 19, 2014
TYPO3 extension manger won't work in XAMPP under Windows
Add these lines to all three apache configuration files (http.conf, http-ssl.conf,http-xampp.conf):
ThreadStackSize 8388608
then restart the apache.
<IfModule mpm_winnt_module>ThreadStackSize 8388608
</IfModule>then restart the apache.
Thursday, September 18, 2014
Getting HTTP HEAD from command line
Install libwww-perl (Debian) / perl-libwww-perl (CentOS):
Debian: apt-get install libwww-perl
CentOS: yum install perl-libwww-perl
Run this command:
GET -Used http://YOUR-WEBSITE.COM/
Debian: apt-get install libwww-perl
CentOS: yum install perl-libwww-perl
Run this command:
GET -Used http://YOUR-WEBSITE.COM/
Monday, September 15, 2014
MySQL Database Benchmark
Installing sysbench:
apt-get install sysbench
Preparing the Test Database:
sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=ADMIN-USER --mysql-password=ADMIN-PASSWORD prepare
Running Test:
sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=ADMIN-USER --mysql-password=ADMIN-PASSWORD prepare
Cleaning test Databse:
sysbench --test=oltp --mysql-db=test --mysql-user=ADMIN-USER --mysql-password= ADMIN-PASSWORDcleanup
apt-get install sysbench
Preparing the Test Database:
sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=ADMIN-USER --mysql-password=ADMIN-PASSWORD prepare
Running Test:
sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=ADMIN-USER --mysql-password=ADMIN-PASSWORD prepare
Cleaning test Databse:
sysbench --test=oltp --mysql-db=test --mysql-user=ADMIN-USER --mysql-password= ADMIN-PASSWORDcleanup
Thursday, May 8, 2014
Add locale to Ubuntu
check which locales are supported:
less /usr/share/i18n/SUPPORTED
Add locale (for example German) to list of generated:
echo de_DE.UTF8 >> /var/lib/locales/supported.d/local
Regenerate list (it will invoke locale-gen...):
sudo dpkg-reconfigure locales
Friday, January 3, 2014
How to download entire Youtube channel using commands in ubuntu
Use youtube-dl command to download videos straight off of YouTube.
Install it:
apt-get install youtube-dl
To download an entire channel
youtube-dl -citw ytuser:USER
To download all videos on a playlist:
youtube-dl -citw PLAYLIST-URL
Install it:
apt-get install youtube-dl
To download an entire channel
youtube-dl -citw ytuser:USER
To download all videos on a playlist:
youtube-dl -citw PLAYLIST-URL
Thursday, October 24, 2013
QMail Changing send IP
The default IP for outgoing connections can be set using the "ip" utility. Check how routing is configured on the server:
assume we have two network interfaces vnet0:0 (192.168.175.100) and vnet0:1 (192.168.175.200) and 192.168.175.1 is gateway:
[root@server]#/sbin/ip route
192.168.175.0/24 dev venet0 scope host
169.254.0.0/16 dev venet0 scope link
default via 199.168.175.1 dev venet0
If no "src" is listed in the "ip" output for the default route, the main IP on the interface is used for outgoing connections.
To change Plesk default Mail IP address, check ifconfig on the server first as :
lo Link encap:Lokale Schleife
inet Adresse:127.0.0.1 Maske:255.0.0.0
inet6 Adresse: ::1/128 Gültigkeitsbereich:Maschine
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:898825 errors:0 dropped:0 overruns:0 frame:0
TX packets:898825 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Sendewarteschlangenlänge:0
RX bytes:2333074597 (2224.9 Mb) TX bytes:2333074597 (2224.9 Mb)
venet0 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet Adresse:127.0.0.1 P-z-P:127.0.0.1 Bcast:0.0.0.0 Maske:255.255.255.255
UP BROADCAST PUNKTZUPUNKT RUNNING NOARP MTU:1500 Metric:1
RX packets:69429506 errors:0 dropped:0 overruns:0 frame:0
TX packets:109230137 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Sendewarteschlangenlänge:0
RX bytes:19231956377 (18341.0 Mb) TX bytes:136258969119 (129946.6 Mb)
venet0:0 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet Adresse:192.168.175.100 P-z-P:92.168.175.100 Bcast:0.0.0.0 Maske:255.255.255.255
UP BROADCAST PUNKTZUPUNKT RUNNING NOARP MTU:1500 Metric:1
venet0:1 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet Adresse:192.168.175.200 P-z-P:92.168.175.200 Bcast:0.0.0.0 Maske:255.255.255.255
UP BROADCAST PUNKTZUPUNKT RUNNING NOARP MTU:1500 Metric:1
Change the mail IP address through following command as :
[root@server]#/sbin/ip route change default via 192.168.175.1 dev venet0:1 src 192.168.175.200
now verify the mail IP address :
[root@server]#/sbin/ip route
192.168.175.0/24 dev venet0 scope host
169.254.0.0/16 dev venet0 scope link
default via 192.168.175.1 dev venet0 src192.168.175.200
If "ip route" command says nothing about gateway or gateway is 0.0.0.0, for example like this one:
[root@server]#/sbin/ip route
127.0.0.0/8 dev lo scope link
default dev venet0 scope link
you can use this command:
[root@server]#/sbin/ip route change default via 192.168.175.100 dev venet0 src 192.168.175.200
assume we have two network interfaces vnet0:0 (192.168.175.100) and vnet0:1 (192.168.175.200) and 192.168.175.1 is gateway:
[root@server]#/sbin/ip route
192.168.175.0/24 dev venet0 scope host
169.254.0.0/16 dev venet0 scope link
default via 199.168.175.1 dev venet0
If no "src" is listed in the "ip" output for the default route, the main IP on the interface is used for outgoing connections.
To change Plesk default Mail IP address, check ifconfig on the server first as :
lo Link encap:Lokale Schleife
inet Adresse:127.0.0.1 Maske:255.0.0.0
inet6 Adresse: ::1/128 Gültigkeitsbereich:Maschine
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:898825 errors:0 dropped:0 overruns:0 frame:0
TX packets:898825 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Sendewarteschlangenlänge:0
RX bytes:2333074597 (2224.9 Mb) TX bytes:2333074597 (2224.9 Mb)
venet0 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet Adresse:127.0.0.1 P-z-P:127.0.0.1 Bcast:0.0.0.0 Maske:255.255.255.255
UP BROADCAST PUNKTZUPUNKT RUNNING NOARP MTU:1500 Metric:1
RX packets:69429506 errors:0 dropped:0 overruns:0 frame:0
TX packets:109230137 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Sendewarteschlangenlänge:0
RX bytes:19231956377 (18341.0 Mb) TX bytes:136258969119 (129946.6 Mb)
venet0:0 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet Adresse:192.168.175.100 P-z-P:92.168.175.100 Bcast:0.0.0.0 Maske:255.255.255.255
UP BROADCAST PUNKTZUPUNKT RUNNING NOARP MTU:1500 Metric:1
venet0:1 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet Adresse:192.168.175.200 P-z-P:92.168.175.200 Bcast:0.0.0.0 Maske:255.255.255.255
UP BROADCAST PUNKTZUPUNKT RUNNING NOARP MTU:1500 Metric:1
Change the mail IP address through following command as :
[root@server]#/sbin/ip route change default via 192.168.175.1 dev venet0:1 src 192.168.175.200
now verify the mail IP address :
[root@server]#/sbin/ip route
192.168.175.0/24 dev venet0 scope host
169.254.0.0/16 dev venet0 scope link
default via 192.168.175.1 dev venet0 src192.168.175.200
If "ip route" command says nothing about gateway or gateway is 0.0.0.0, for example like this one:
[root@server]#/sbin/ip route
127.0.0.0/8 dev lo scope link
default dev venet0 scope link
you can use this command:
[root@server]#/sbin/ip route change default via 192.168.175.100 dev venet0 src 192.168.175.200
Subscribe to:
Posts (Atom)