Network - Server

How to prevent Linux SSH client from disconnecting using ServerAliveInterval

How to prevent Linux SSH client from disconnecting using ServerAliveInterval

 How to prevent Linux SSH client from disconnecting using ServerAliveInterval Usually when I work on a remote server, I like having multiple ssh sessions to that remote server for mult-itasking. But sometimes the server, due to network issues or server keepalives not reaching the client and terminating the ssh session,...

Read more

How do I configure SSH on OS X?

How do I configure SSH on OS X?

The SSHD configuration is stored in /private/etc/ssh/sshd_config To stop and start SSHD: sudo launchctl stop com.openssh.sshd sudo launchctl start com.openssh.sshd

Read more

show hiden folder .ssh in macos

show hiden folder .ssh in macos

 CMD+Shift+G will display a dialogue box to enter the path

Read more

Mac OSX PHP and XAMPP path issue, add bin of xampp to global

Mac OSX PHP and XAMPP path issue, add bin of xampp to global

sudo vim ~/.bash_profile then add export XAMPP_HOME=/Applications/XAMPP export PATH=${XAMPP_HOME}/bin:${PATH} export PATH Check php :  which php

Read more

How to Prevent & Disable Mac OS X From Sleeping From the Command Line Terminal Application

How to Prevent & Disable Mac OS X From Sleeping From the Command Line Terminal Application

You can use the caffeinate command. This command creates assertions to alter system sleep behavior. If no assertion flags are specified, caffeinate creates an assertion to prevent Another option is to use the pmset command to manipulate power management settings. Fig.01 Prevent System Sleep While a Safari Command is...

Read more

Avoiding SSH timeouts on Mac OS?

Avoiding SSH timeouts on Mac OS?

 Server Alive interval simply sends a null packet to the server at a set time to keep the connection alive, you should just be able to add some thing like into your config file: ~/.ssh/config   Host *  ServerAliveInterval 60 The second line must be indented with at least one space. * will match any host;...

Read more

Can not use move button, buttonArrow keys, tab-complete not working

Can not use move button, buttonArrow keys, tab-complete not working

When I login on the new account, instead of the normal prompt I only see a $ sign. If I try to tab-complete a command or file name it prints a normal tab. If I try to use the arrow keys it prints ^[[A, ^[[B, ^[[C or ^[[D. Also, ls no longer adds colors. Resolved: That probably means that the new user account was created...

Read more

Reset root password of mysql - Ubuntu

Reset root password of mysql - Ubuntu

 Step 1: Stop MySQL Service. sudo service mysql stop Step 2: Kill all running mysqld. sudo killall -9 mysqld Step 3: Starting mysqld in Safe mode. sudo mysqld_safe --skip-grant-tables --skip-networking & Step 4: Start mysql client mysql -u root Step 5: After successful login, please execute this command...

Read more

nginx 502 bad gateway

nginx 502 bad gateway

1) Open /etc/nginx/site-enabled/default and look at location ~ \.php$ {                 fastcgi_pass unix:/run/php/php5.6-fpm.sock; // make sure the path is correct     2) Go to /etc/php5/fpm/pool.d/www.conf and look at the line   listen = /run/php/php5.6-fpm.sock...

Read more

nginx showing blank PHP pages

nginx showing blank PHP pages

replace   include fastcgi_params; with   include fastcgi.conf;   and remove fastcgi_param SCRIPT_FILENAME ... in nginx.conf   or in /ext/nginx/site-enabled/default

Read more

Package php5 have no installation candidate (Ubuntu 16.04)

Package php5 have no installation candidate (Ubuntu 16.04)

 Ubuntu 16.04 comes with PHP7 as the standard, so there are no PHP5 packages However if you like you can add a PPA to get those packages anyways: Remove all the stock php packages List installed php packages with dpkg -l | grep php| awk '{print $2}' |tr "\n" " " then remove unneeded...

Read more

How to show hidden files in Mac OS X and macOS Sierra: Show hidden files using Terminal

How to show hidden files in Mac OS X and macOS Sierra: Show hidden files using Terminal

 The Terminal application is the best way to display hidden files in Mac OS X and macOS Sierra. The Terminal app enables you to control Mac OS X or macOS Sierra using the command line to enter Unix commands. We like to think of Terminal as the hood of a car; it allows you to open Mac OS X or macOS Sierra up and...

Read more

Use PPK file (privatekey for window) in Mac Terminal to connect to remote connection over SSH

Use PPK file (privatekey for window) in Mac Terminal to connect to remote connection over SSH

 You can ssh directly from the Terminal on Mac, but you need to use a .PEM key rather than the putty .PPK key. You can use PuttyGen on Windows to convert from .PEM to .PPK, I'm not sure about the other way around though. You can also convert the key using putty for...

Read more

How to launch SSH connections automatically in 1Password on your Mac

How to launch SSH connections automatically in 1Password on your Mac

  You can add your SSH accounts to 1Password and launch Terminal automatically. Edit a Login item and set its website field to ssh://user@hostname. Save the item, and the field becomes a link. Click the link to launch your SSH session.

Read more

link app, mysql, php to global in Terminal

link app, mysql, php to global in Terminal

We do it by following command, EX:  export PATH=$PATH:/usr/local/mysql/bin

Read more

How can I install MacVim on OS X?

How can I install MacVim on OS X?

  Step 1. Install homebrew from here: http://brew.sh Step 1.1. Run export PATH=/usr/local/bin:$PATH Step 2. Run brew update Step 3. Run brew install vim && brew install macvim Step 4. Run brew link macvim   Set macvim as default application after...

Read more

Ubuntu OAuth Installation

Ubuntu OAuth Installation

 Ubuntu OAuth Installation –  After astounding success of magento OpenERP Bridge  (MOB) we are going to update the next release of magento OpenERP bridge which will support the SOAP, XML-RPC and REST API’s as well . we were getting some trouble to function OAuth with our ubuntu server...

Read more

How can I restart redis-server?

How can I restart redis-server?

 Either connect to node instance and use shutdown command or if you are on ubuntu you can try to restart redis server through init.d:   /etc/init.d/redis-server restart or stop/start it:   /etc/init.d/redis-server stop /etc/init.d/redis-server start

Read more

Set up LetEncrypt for Nginx

Set up LetEncrypt for Nginx

LetEncrypt 1) Sudo git clone https:// github.com/letsencrypt/letsencrypt /opt/letsencrypt 2) Sudo service nginx stop 3) cd /opt/letsencrypt 4) ./letsencrypt-auto certonly --standalone    - Enter domain and email in steps   add to nginx default server { listen 443 ssl;        ...

Read more

How to test sendmail in linux ubuntu

How to test sendmail in linux ubuntu

 You can test sendmail to see if it is properly configured and setup by typing the following into the command line: $ echo "My test email being sent from sendmail" | /usr/sbin/sendmail myemail@domain.com

Read more

Cách sử dụng lệnh tail trong Linux

Cách sử dụng lệnh tail trong Linux

 1. Lệnh tail như thế nào – Dùng để liệt kê các dòng cuối cùng trong một file – Cú pháp thông thường: tail -n sốlượng /tên đường dẫn/tới file cần xem vd: xem log message ta gõ: tail -n 100 /var/log/message rồi ấn Enter 2....

Read more

Linux: change password of user root

Linux: change password of user root

 With sudo: if you have sudo permissions to run passwd, you can do: sudo passwd root Enter your password, then enter a new password for root twice. Done. Editing files: this works in the unlikely case you don't have full sudo access, but you do have access to edit /etc/{passwd,shadow}....

Read more

How To Set Up Nginx Server Blocks (Virtual Hosts) on Linux Ubuntu 14.04 LTS

How To Set Up Nginx Server Blocks (Virtual Hosts) on Linux Ubuntu 14.04 LTS

  Introduction When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server. In this guide, we'll discuss how to configure server blocks in Nginx on an Ubuntu 14.04 server.   Prerequisites We're...

Read more

Auto-restart mysql when it dies

Auto-restart mysql when it dies

  8down vote This is not a clean solution, it would obviously be better to avoid the problem in the first place. Anyway, I am not sure how CentOS manages services but I think it uses service. If so,...

Read more

Thay đổi thời gian hệ thống Linux

Thay đổi thời gian hệ thống Linux

Sử dụng lệnh Đầu tiên, bạn có thể chạy lệnh “date” để xem giờ hiện tại của hệ thống. huongdanit-laptop ~ # date Wed Mar 25 00:22:12 ICT 2015 ICT – Indochina Time, tức là giờ hệ thống hiện tại đang ở múi giờ +7 của một số nước như Việt...

Read more

Các câu lệnh (command) hữu ích trên hệ thống Linux

Các câu lệnh (command) hữu ích trên hệ thống Linux

1. Trên terminal¶   clear: xoá trắng cửa sổ dòng lệnh.   date: xem ngày, giờ hệ thống.   find /usr/share/zoneinfo/ | grep -i pst: xem Timezone.   ln -f -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime: Đổi Server Time về Timezone Việt Nam.   date -s...

Read more

18 Tar Command Examples in Linux

18 Tar Command Examples in Linux

he Linux “tar” stands for tape archive, which is used by large number of Linux/Unix system administrators to deal with tape drives backup. The tar command used to rip a collection of files and directories into highly compressed archive file commonly called tarball or tar, gzip and bzip in Linux. The tar is most...

Read more

How do you restart php-fpm?

How do you restart php-fpm?

  Using SysV Init scripts directly: /etc/init.d/php-fpm restart # typical /etc/init.d/php5-fpm restart # debian-style Using service wrapper script service php-fpm restart # typical service php5-fpm restart # debian-style Using Upstart (e.g....

Read more

Magento: Set Up Magento Cron Job

Magento: Set Up Magento Cron Job

  Setting up Cron In a UNIX Based Operating System If you have shell access to your server, you can use the crontab service command. If you don't have shell access, you can set up the cron job through cPanel or similar admin. The Magento cron needs to run every five minutes, so the time configuration is: */5 *...

Read more

Shell command to tar directory excluding certain files/folders

Shell command to tar directory excluding certain files/folders

 You can have multiple exclude options for tar so $ tar --exclude='file1' --exclude='patter*' --exclude='file2' OR $ tar -zcvf archive.tgz arc_dir --exclude=dir/ignore_this_dir

Read more

TAR - options

TAR - options

  NAME tar - The GNU version of the tar archiving utility SYNOPSIS tar <operation> [options] Operations: [-]A --catenate --concatenate [-]c --create [-]d --diff --compare [-]r --append [-]t --list [-]u --update [-]x --extract...

Read more

what does -zxvf mean in tar -zxvf ?

what does -zxvf mean in tar -zxvf <filename>?

x means --extract. v means --verbose. f means --file. z means --gzip. You can combine one-letter arguments together, and f takes an argument, the filename. There is something you have to watch out for

Read more

Các lệnh kiểm tra phiên bản hệ điều hành Linux

Các lệnh kiểm tra phiên bản hệ điều hành Linux

 Danh sách các lệnh dùng để kiểm tra uname -a uname -rms cat /etc/system-release cat /proc/version lsb_release -a Trong thực tế, đôi khi ta được bàn giao lại một máy chủ với hệ điều hành linux nói chung và centos nói riêng, lúc này cần kiểm...

Read more

fix error of directadmin can not send mail

fix error of directadmin can not send mail

chown -R mail:mail /var/spool/exim/input chown -R mail:mail /var/spool/exim/db chown -R mail:mail /var/spool/exim/msglog

Read more

10 "Screen" Command Examples to Manage Linux Terminals

10

 Screen is a full-screen software program that can be used to multiplexes a physical console between several processes (typically interactive shells). It offers a user to open several separate terminal instances inside a one single terminal window manager. The screen application is very useful, if you are dealing...

Read more

The Standard permission of folders and files in linux by command line

The Standard permission of folders and files in linux by command line

find /var/* -type f -exec chmod 644 {} ; // change /var by your folder find /var/* -type d -exec chmod 755 {} ; // change /var by your folder

Read more

Hướng dẫn chmod, bảo mật Hosting linux Directadmin

Hướng dẫn chmod, bảo mật Hosting linux Directadmin

 Hiện nay tất cả các server Linux đã được cấu hình để các bạn có thể chmod lại tăng bảo mật hơn rất nhiều cho hosting của bạn, cụ thể như sau: - Với thư mục bạn có thể chmod là 711 - Với file là php bạn có thể chmod những file quan trọng như config.php...

Read more

Warning: Remote Host Identification Has Changed error and solution

Warning: Remote Host Identification Has Changed error and solution

 When I run ssh command I get an error which read as follows: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It...

Read more

Thay chủ sở hữu file/folder

Thay chủ sở hữu file/folder

Mặc định các file và folder sẽ được sở hữu bởi user/group tạo ra nó. Chẳng hạn như mình dùng user là thach1 để tạo một folder thì các user khác ngoại trừ user root sẽ không thể tạo file hoặc thay đổi nội dung của file trong thư mục này, vì nó thuộc sở...

Read more

“Register” an .exe so you can run it from any command line in Windows

“Register” an .exe so you can run it from any command line in Windows

 You can put your .exe file's path into enviroment variable path. Go to "My computer -> properties -> advanced -> environment variables -> Path" and edit path by adding .exe's directory into path.

Read more

Auto login in PuTTY with a password?

Auto login in PuTTY with a password?

1) Create a shortcut on the desktop to putty.exe 2) Rename the shortcut to PuTTY - server.com 3) Right-click shortcut and choose Properties 4) Modify the target similar to: "C:\Program Files\PuTTY\putty.exe" user@server.com -pw password Click OK

Read more

Starting PuTTY session in a specific directory

Starting PuTTY session in a specific directory

 You can add the "cd /your_path" command to  ~/.profile or ~/.bash_profile (vi ~/.profile)as explained by gravity.

Read more

Upgrade mysql to 5.6 on Ubuntu 14.04

Upgrade mysql to 5.6 on Ubuntu 14.04

  apt-get install mysql-server-5.6

Read more

Check and create root user of mysql on Ubuntu

Check and create root user of mysql on Ubuntu

How about try this:  Code:   sudo /etc/init.d/mysql stopsudo mysqld --skip-grant-tables &mysqlmysql> use mysql;mysql> select user,host from user where user='root' G  If you see output, stop here and post the output. If you see no output,...

Read more

localhost/phpmyadmin root password recovery in ubuntu

localhost/phpmyadmin root password recovery in ubuntu

 Follow this steps to reset your password:   sudo service mysql stop sudo mysqld --skip-grant-tables & mysql -u root mysql  Change strong-passwd with the new password:   UPDATE user SET Password=PASSWORD('strong-passwd') WHERE...

Read more

make failed error when installing pdo via pecl

make failed error when installing pdo via pecl

sudo apt-get install php5-sqlite   The biggest issue here is that PDO is no longer supported in PECL and has been moved to CORE.    On that note all the PDO drivers for the respected databases have been moved into the main php5 database packages....

Read more

HOW TO INSTALL/SETUP A BASIC LAMP STACK (LINUX, APACHE, MYSQL, PHP) ON UBUNTU 14.04 LTS

HOW TO INSTALL/SETUP A BASIC LAMP STACK (LINUX, APACHE, MYSQL, PHP) ON UBUNTU 14.04 LTS

 This little tutorial shows how to setup Apache, MySQL and PHP on a Linux server, in this case Ubuntu 14.04 LTS (by the way, if you want to know what LTS means, have a look into the wikipedia article). Most tutorials are making it overcomplicated, and most commands (like apache restarting...

Read more

Ruby is not recognized as an internal or external command, operable or batch file error

Ruby is not recognized as an internal or external command, operable or batch file error

Ruby is not recognized as an internal or external command, operable or batch file error  We are lucky because installing ruby on Windows is pretty easy. However, people often get the following error and are wondering what to do: ruby...

Read more