Category: Linux

How to login to a ftp server in linux 0

How to login to a ftp server in linux

From your command line type

ftp
ftp > open ftp.myserver.com

Or Alternatively,

ftp ftp.myserver.com

It will prompt you for a username and/or password and you can just fill those in.

After you are in, you can see a list of commands by using the command:

ftp> help
Commands may be abbreviated.  Commands are:

!               cr              mdir            proxy           send
$               delete          mget            sendport        site
account         debug           mkdir           put             size
append          dir             mls             pwd             status
ascii           disconnect      mode            quit            struct
bell            form            modtime         quote           system
binary          get             mput            recv            sunique
bye             glob            newer           reget           tenex
case            hash            nmap            rstatus         trace
ccc             help            nlist           rhelp           type
cd              idle            ntrans          rename          user
cdup            image           open            reset           umask
chmod           lcd             passive         restart         verbose
clear           ls              private         rmdir           ?
close           macdef          prompt          runique
cprotect        mdelete         protect         safe

If you are familiar with linux this should be fairly straight forward. The only ones Ill cover for anyone completely new are ls, get and put. (more…)

How to get a previous date in bash (linux) 0

How to get a previous date in bash (linux)

Simply put

date -d '1 day ago' +'%Y-%m-%d'
# For multiple days
date -d '7 days ago' +'%Y-%m-%d'

If you wish to place in a shell script:

RMDATE=$(date -d '7 days ago' +'%Y_%m_%d')

will place for example ‘2013-07-01’ in the RMDATE variable which of course you can use like

echo $RMDATE

 

How to setup open MySQL Port (3306) on Ubuntu 0

How to setup open MySQL Port (3306) on Ubuntu

Step 1: ensure we have mysql-server installed.

apt-get install mysql-server

Then: vim /etc/mysql/my.cnf

COMMENT OUT (with a '#'): 
"bind-address = 127.0.0.1"

Restart Server with

service mysql restart

——– To test with another linux client, use

mysql -h ip.or.hostname -u root -p

(ERROR 2003 (HY000): Can’t connect to MySQL server on ‘xyz’)

iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT

( ERROR 1130 (HY000): Host ‘69.80.43.240’ is not allowed to connect to this MySQL server)

Fix in phpmyadmin
Privileges Tab > root > add a new root with All hosts '%'