Search Results

Mounting Windows drives and shares in Linux

The following have come in handy for mounting a Windows share on a Linux computer: mount -t cifs -o username=user,password=password,umask=000 //winbox/winshare /mnt/home/ or smbmount //winbox/winshare /mnt/home/ -o username=user,password=password,rw An example of mounting a local NTFS partition held on the same machine: ntfsmount /dev/sda2 /mnt/windows -o umask=0002,silent

Random integers in BASH

Never really had a need for it before in BASH, but the following formula allows you to create random integers between two values: rnumber=$(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+min)) Useful for example to create random passwords that have a length within a set range. < /dev/urandom tr -dc A-Za-z0-9_$*?!.:=@#% | head -c$((RANDOM %4 +8))

Plesk for Windows MySQL Access

Plesk uses two Mysql servers. One for clients databases (port 3306) and second server for Plesk databases (8306). You can connect to Plesk DB using the following command: %plesk_dir%\mysql\bin\mysql.exe -uadmin -pPlesk_admin_passwd -P8306 “C:\Program Files\Parallels\Plesk\Databases\MySQL\bin\mysql.exe” -uadmin -pPlesk-admin_passwd -P8306 Plesk-admin_passwd = “C:\Program Files\Parallels\Plesk\admin\bin\plesksrvclient.exe” -get However if you want to connect to Clients’ Mysql Server you should use […]

Mounting Windows shares on Linux

mount -t cifs -o username=user,password=pass,rw //192.168.0.100/mydir /mnt/mydir/ You could make this persistent on boot by putting it in /etc/rc.local for example.

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

Installing Ruby on Rails on Plesk

To Install Ruby on Rails on a Plesk Server: yum groupinstall “Plesk 8.1 Ruby” yum install psa-miva (If Miva required) yum groupinstall “Plesk 8.1 FastCGI” (if FastCGI required) To Configure Ruby on Rails on a Plesk Server: 1. Create a domain in Plesk with Physical hosting. 2. Ensure that bin/bash access is enabled. 3. Ensure […]

PHP IMAP SSL error

if you are getting a certificate error when using the PHP IMAP function, add the /notls flag: ie: $mbox = imap_open (“{localhost:995/pop3/notls}”, “user_id”, “password”);

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. […]

MySQL Dump database to Email

To backup a database and send it to email, add a cron job like: mysqldump -ce –user=user –password=pass dbname | gzip |uuencode dbbackup.gz| mail -s “xxxx Database Backup” me@mydomain.com

Apache MySQL Authentication

mod_auth_mysql will need to be loaded. in vhost.conf add: AuthType Basic AuthName “Auth required” AuthMySQLHost localhost AuthMySQLUser auth_user AuthMySQLPassword mypassword AuthMySQLDB mysqlauth AuthMysqlUserTable clients AuthMySQLNameField username AuthMySQLPasswordField passwd AuthMySQLPwEncryption none AuthMySQLEnable on require valid-user Then in MySQL: create database mysqlauth; use mysqlauth; CREATE TABLE `clients` ( `username` varchar(25) NOT NULL default ”, `passwd` varchar(25) NOT […]