Archive for the ‘Linux’ Category

Configuring a samba server

install samba via yum etc. Create the smb.conf config file in /usr/local/samba/lib/smb.conf Basic smb.conf sample: [global] workgroup = DEVELOPMENT encrypt passwords = yes [homes] guest ok = no read only = no browseable = no

rsync backups

rsync can be used as an effective backup tool: rsync -avz –delete -e “ssh -i rsync/mirrorkey” backup@85.222.111.000:/var/www/vhosts/mydomain.com/httpsdocs /backup/mydomain.com If there’s a lot of data and speed takes importance over security, a weaker cipher such as blowfish could be used: “ssh -c blowfish -ax -i rsync/mirrorkey” Be careful with the –delete flag, it will delete files […]

RPM Examples

Install RPM: rpm -ivh package.rpm Upgrade RPM: rpm -Uvh package.rpm Import an RPM GPG key: rpm –import /media/cdrom/RPM-GPG-KEY Getting detailed information about the package wget: rpm -qi wget Showing all the files installed by the package wget: rpm -ql wget

Enable Disk Quotas on plesk for Linux

First of all make sure that quota is supported by kernel. It should be compiled into the kernel or loaded as module. You can check if quota is configured properly with this command line: /usr/local/psa/admin/sbin/usermng –isquotable Normally, it should return “0”. If the utility returns the following error message: usermng: Unable to turn on user […]

openssl unable to write random state

openssl genrsa -out test.pem 1024 -rand $HOME/httpdocs/cert/.rnd Generating RSA private key, 1024 bit long modulus …………………….++++++ …………………..++++++ unable to write ‘random state’ e is 65537 (0x10001) Causing non-random keys to be generated This is because openssl tries to create a .rnd file in the users home directory by default to create the random file.  The […]

MySQL Replication over SSL

##Tutorial for MySQL Replication over SSL (one-way)## ##################################################### ##Check that SSL has been compiled in SSL on both the master and the client: SHOW VARIABLES LIKE ‘have_openssl'; or mysql –ssl –help If it says disabled or yes then its fine.  If it says no then an SSL enabled version of MySQL needs to be installed. […]

Mailman reset password

Reset a mailing list password in Mailman: /usr/lib/mailman/bin/change_pw -d mydomain.com -ptemppass

Linux reset root password

A Linux servers root password can be reset in a few simple steps via single-user mode. To enter single-user mode, reboot your computer. If you use the default boot loader, GRUB, you can enter single user mode by performing the following: 1. At the boot loader menu, use the arrow keys to highlight the installation […]

Linux / nix Error Codes

Not comprehensive, but comes in handy: *  EPERM 1 /* Operation not permitted */ (Linux) *  EPERM 1 /* Not owner */ (SCO Unix) *  ENOENT 2 /* No such file or directory */ *  ESRCH 3 /* No such process */ *  EINTR 4 /* Interrupted system call */ *  EIO 5 /* I/O […]

IPTables Examples

As it is a table of rules, the first rule has precedence. If the first rule dis-allows everything then nothing else afterwards will matter. * INIVIDUAL REJECTS FIRST * THEN OPEN IT UP * THEN BLOCK ALL List iptable rules: iptables -n -L (-n prevents slow reverse DNS lookup) Add rule to Reject all from […]