Tag: linux
FTP not working?
by z3n on May.24, 2011, under Linux Happyness
Problem:
FTPd is working however when you try to login you get access denied on user’s home folder, no matter what accesses and group/user combination.
Solution:
Check /var/log/audit/autit.log and /var/log/messages
This usually is a SELinux block, fix it using:
setsebool -P ftp_home_dir=1
Change sendmail’s outgoing ip
by admin on Apr.16, 2011, under Linux Happyness
Problem:
How to change sendmail’s outgoing ip?
Solution:
This is the ip that will be used to deliver messages, this ip might get blacklisted if one of your happy clients on a shared server decides to send a mass email.
Sendmail is always a bitch to config, but this time it wasn’t, just change your .m4 file adding:
CLIENT_OPTIONS(`Addr=123.456.789')dnl
rebuild the .cf file, restart sendmail and you’re done. In my case, I had a specific ip on the server that got “temporary” (permanently) blocked by gmail. Although new mail wasn’t being sent after the flood, google never unblocked my server, even after a week i still getting “limit rate exceeded” messages. Since I have many IPs on the server it was easier just to bind sendmail to another IP.
Source:
Finding big files on linux
by z3n on Apr.02, 2011, under Linux Happyness
Problem:
How to find big files on linux?
Solution:
find / -type f -size +50000k
This will find files bigger than 50MB (50000k)
rsync over ssh with custom port
by z3n on Oct.29, 2010, under Linux Happyness
Problem:
How to do a rsync with custom ssh port ?
Solution:
This was a bit hard to find, so i’m posting it.
add:
-e “ssh -p PORT_NUMBER -C -oCompressionLevel=9″
to the command, like this:
rsync -azv --bwlimit=400 -e "ssh -p 12345 -C -oCompressionLevel=9" YOUR_HAPPY_USER@YOUR_SERVER:/path/to/files/from/server /path/to/local
Source:
Disable local email delivery on hosted domains
by z3n on Sep.04, 2010, under Linux Happyness
Problem:
There’s some domains on a server that users a external server to process the emails (eg. google servers, aspmx.l.google.com) those emails are all fine when sent from outside the box but when sent from the box they fail to reach the destination or get delivered to a local user.
Solution:
define(`MAIL_HUB', `example.com.')dnl define(`LOCAL_RELAY', `example.com.')dnl
For sendmail, this will make the domain’s emails to be delivered to the ip address assigned at the domain’s MX record.
Note:
This seemed promising for me at first look, but it will redirect ALL local domains to this MX record, ruining everything. Nothing new when dealing with sendmail, anyway when i find a better solution for this i will update this post again.
Source:
How to find disk UUID
by z3n on Jul.05, 2010, under Linux Happyness, Tips & Hints
Problem:
I wanted to change the default mounts at /etc/fstab, but i couldn’t find the disks UUID.
Solution:
blkid /dev/DEVNAME
How to figure out how many sectors a disk has on linux
by z3n on Jul.05, 2010, under Linux Happyness
Problem:
How to find out the absolute count of sectors on a disk at linux?
Solution:
hdparm /dev/YOURDEV
How to clone a disk on linux
by z3n on Jul.05, 2010, under Linux Happyness
Problem:
How to do a 1:1 copy of a disk on linux?
Solution:
dd bs=4k if=/dev/SOURCE of=/dev/DESTINATION conv=noerror,sync
This will make a 1:1 copy directly into the destination device, you should be aware that both devices should have the same size, so make sure you know which one is the source and destination in order to avoid catastrophic fail.
For your enjoyment, you can also make a iso image:
dd if=/dev/SOURCE of=/path/to/image.iso
Source:
How to scroll on a bash screen
by z3n on May.25, 2010, under Notes, Tips & Hints
Problem:
It’s so cool to have many screens at bash, but i never figured out how to scroll up on them, somehow i never looked after as well.
Solution:
CTRL + A -> ESC -> PAGE UP / PAGE DOWN
Source:
Find dependencies of a rpm with yum
by z3n on May.08, 2010, under Coding, Linux Happyness, Tips & Hints
Problem:
While installing virtualbox on my server i found out that it had a hell of deps, which i can’t seem to find.
Solution:
Search around i found out that yum is able to find and install deps off a rpm, like this:
yum localinstall --nogpgcheck VirtualBox-2.1.2_41885_fedora9-1.i386.rpm