Author: Alex
installing java and maven on CentOS
java, maveninstalled java:
export PATH=${M2_HOME}/bin:${PATH}
installing git on CentOS
gitto install git on CentOS, simply follow these instructions:
Open MySQL for all IP addresses
mysqlGRANT ALL ON *.* TO root@’%’ IDENTIFIED BY ‘yourpassword’;
MySQL insert into user database failure
mysqlI kept getting an error for “Column count doesn’t match value count at row 1″.
My MySQL [5.0.96] version probably had some extra columns. So…
INSERT INTO user VALUES (‘localhost’,’root’,password(‘newpassword’),’Y’,’Y ‘,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’, ‘Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,” ,”,”,”,0,0,0,0);
mysql remote connection kept failing
iptables, mysqlMy connection to a remote server on a local network kept failing. Of course the problem was iptables. The error for MySQL was an error code 113.
iptables -I RH-Firewall-1-INPUT -p tcp –dport 3306 -j ACCEPT
iptables -I RH-Firewall-1-INPUT -p udp –dport 3306 -j ACCEPT
Sending mail with exim
exim/path/to/exim -v ‘me@mysite.com’
message here
(CTRL+D)
Redirecting outbound email with exim
exim, linuxI wanted to build a replica of our production environment on a development environment, one problem being that our production environment sends a lot of emails to our clients.
I therefore needed to redirect or restrict all of our outbound emails.
With that in mind, I needed to make sure that exim [typically what we use to send mails] would not be able to send any mail to our clients, and instead it would be sending mails to a manually defined inbox.
The first thing I needed to do, was check that exim was actually working.
I sent myself an email:
/usr/sbin/exim -v ‘alex@myemail.com’
Some message here
[CTRL+D]
That then responded with the 250 OK codes to confirm that the mail had been delivered to myself.
That’s no good on this environment though, as I needed to ensure that exim would be redirecting to a defined mailbox. Let’s call it “some@mailbox.com”
To do this, I needed to change the routers on the exim configuration file (/etc/exim/exim.cnf).
In vim, search for the string “begin routers”
The crucial point here is that the order of which the routers are defined is important, so you will need to put the new, first rule for routers at the top of this section. What did I include?
blah:
driver = redirect
domains = whereitscomingfrom.com
data = some@mailbox.com
I then repeated the mail send:
/usr/sbin/exim -v ‘alex@myemail.com’
Some message here
[CTRL+D]
I could then see a 250 OK code, but it was actually going to some@mailbox.com instead.
Some useful links for NFS Sharing
iptables, linuxI’d forgotten to set my ip tables:
http://eduardo-lago.blogspot.jp/2012/02/installing-nfs-on-centos-62.html
So my NFS shares weren’t working.
This was a useful page:
http://qugstart.com/blog/linux/centos-nfs-how-to-guide-exporting-and-mounting-a-nfs-drive/
MySQL limited records in mysqldump
mysqlWhen I wanted to mysqldump a limited amount of records, I used the below command to limit my mysql dump to just 1 million records.
mysqldump -uroot -hsome-db02 -P3313 a_shard_07 table –where=”TRUE ORDER BY table_id LIMIT 1000000″ | gzip -c | cat > /db/disk/myDump.sql.gz