Linux Ubuntu 🏴‍☠️

How to kill a nodejs process in Linux?

sudo netstat -lpn |grep :'3000'

3000 is port i was looking for, After first command you will have Process ID for that port

kill -9 1192

in my case 1192 was process Id of process running on 3000 PORT use -9 for Force kill the process

pkill is the easiest command line utility

pkill -f node


pkill -f nodejs

whatever name the process runs as for your os

digital ocean Linux Ubuntu 🏴‍☠️

Disable root ssh


PermitRootLogin yes -> PermitRootLogin no

sudo service ssh restart

Linux 🏴‍☠️

How do I zip/unzip a directory? [Ubuntu]


FTP do have two modes: binary and ASCII. By default most clients use ASCII mode, which breaks your binary files completely. I don’t know which FTP client you are using, but for example in ncftp you can use command “binary” to switch to binary mode.

If you want to create ZIP files using Ubuntu (or almost any other Linux), use zip. You can install it to Ubuntu by running

sudo apt-get install zip

Then you can create zip file by running

zip -r foldername


If you want to extract to a particular destination folder, you can use:

unzip -d destination_folder
Linux Ubuntu 🏴‍☠️

When restart apache server following error : Could not reliably determine the server’s fully qualified domain name

When I restart my apache server using the command

sudo /etc/init.d/apache2 restart

I get the following error:

Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using for ServerName
... waiting apache2:
Could not reliably determine the server's fully qualified domain name, using for ServerName

ubuntu 13.10 or newer

As of Apache 2.4 – which is available by default as of 13.10 – you cannot use the method about adding a config file in the conf.d directory.

Apache no longer uses the conf.d directory. All the configuration files are stored inside /etc/apache2/conf-available directory and all the configuration files should now have a .confextension.

In order to solve this message in Apache 2.4, we have to create a configuration file inside the conf-available directory. For example servername.conf.

sudo vi /etc/apache2/conf-available/servername.conf

And inside this we just need to add one line

ServerName localhost

You can combine the previous two commands in one with:

echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/servername.conf

If you want to use a domain name or any other name depending on the requirement its fine, just replace localhost with whatever you need. Next you have to enable this configuration. For this, you need to run the following command:

sudo a2enconf servername

a2enconf is a command to enable a configuration file in Apaches 2.4. Also note that servernameon the above command is from the name of the configuration file servername.conf. If your configuration file was ngenericserver.conf then you would have to write sudo a2enconf ngenericserver.

After this reload the server and the above message will no longer bug you.

sudo service apache2 reload


sudo apache2ctl graceful

Now after this you will see that the message will not be shown again and the problem will be fixed.

source :
digital ocean Linux MySQL Ubuntu 🏴‍☠️

เมื่อ Mysql Restart ไม่ได้ บน Digital Ocean

Swap Memory

The tiny droplet I have has 512MB RAM, and 20GB on SSD harddisk.
It’s a waste not to create swap memory out of the 20GB SSD!
So, add a few GB of swap memory to your Ubuntu.


# Confirm you have no swap
sudo swapon -s

# Allocate 1GB (or more if you wish) in /swapfile
sudo fallocate -l 1G /swapfile

# Make it secure
sudo chmod 600 /swapfile
ls -lh /swapfile

# Activate it
sudo mkswap /swapfile
sudo swapon /swapfile

# Confirm again there’s indeed more memory now
free -m
sudo swapon -s

# Configure fstab to use swap when instance restart
sudo nano /etc/fstab

# Add this line to /etc/fstab, save and exit
/swapfile none swap sw 0 0

# Change swappiness to 10, so that swap is used only when 10% RAM is unused
# The default is too high at 60
echo 10 | sudo tee /proc/sys/vm/swappiness
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf


digital ocean Linux Ubuntu 🏴‍☠️

mod_rewrite Apache LAMP on DigitalOcean

This did the work for me.

sudo nano /etc/apache2/sites-enabled/000-default.conf

Also edited the vhost with the following to enable .htaccess.

<Directory /var/www/html/public/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
Linux Ubuntu 🏴‍☠️

ติดตั้ง proftp บน Ubuntu

พอ sudo aptitude install proftpd เสร็จแล้ว
ให้ ใช้ text editor ที่ตัวเองถนัด อย่างผมก็ใช้ประมาณว่า
pico /etc/proftpd/proftpd.conf


UseIPv6            off
Servername      “ชื่อServerครับ”

DefaultRoot        ~
IdentLookips       off
ServerIdent on “FTP Server ready.”

พอแก้เสร็จแล้ว กด Ctrl + X แล้ว กด y เพื่อ save
พิมพ์ sudo /etc/init.d/proftpd restart  เพื่อ restart proftpd

#ถ้าเครื่องตั้ง Firewall ไว้ให้เปิด port ftp (port 21) ทำงานด้วยนะครับ
#ถ้า firewall เป็น iptables ก็
iptables -A INPUT -p tcp -m tcp –dport 21 –syn -j ACCEPT

Linux Ubuntu 🏴‍☠️

ติดตั้ง Apache, PHP, MySQL และ phpMyAdmin บน Ubuntu

การติดตั้ง Apache

1. เปิด Terminal จาก Applications/Utilities/Terminal จากนั้นให้พิมพ์คำสั่งนี้

sudo apt-get install apache2

2. หากใน Terminal เห็นข้อความว่า apache2: Could not reliably determine the server’s fully qualified domain name, using for ServerName สามารถแก้ไขได้โดยใช้พิมพ์คำสั่งนี้

gksu gedit /etc/apache2/conf.d/fqdn

เมื่อเปิดเสร็จแล้ว ให้พิมพ์ ServerName localhost ลงไปในไฟล์และบันทึก จากนั้นก็ปิดไฟล์

3. เมื่อติดตั้งเสร็จแล้ว ทดสอบโดยใฃ้เบราว์เซอร์ และเปิด http://localhost หากใช้งานได้จะพบข้อความว่า It works!

การติดตั้ง PHP5

1. พิมพ์คำสั่ง

sudo apt-get install php5 libapache2-mod-php5

2. เมื่อลง PHP5 เสร็จแล้วจำเป็นต้องเริ่มการทำงานของ Apache อีกครั้ง ด้วยการใช้คำสั่ง

sudo /etc/init.d/apache2 restart

3. ทดสอบการใช้งาน PHP โดยพิมพ์คำสั่ง

sudo gedit /var/www/info.php

เมื่อไฟล์ถูกเปิดขึ้นมาแล้ว ให้พิมพ์โค้ด PHP ดังนี้



Linux Ubuntu 🏴‍☠️

ติดตั้ง ssh server บน Ubuntu

ติดตั้ง ssh server ด้วยคำสั่ง

sudo apt-get install openssh-server

Linux 🏴‍☠️

Forward ports and config Bigbluebutton

forward three ports to the the internal IP address of the BigBlueButton server. These ports are 80 (HTTP), 9123 (Desktop Sharing), and 1935 (RTMP).

sudo bbb-conf --setip

Internally, BigBlueButton must be able to call to make API requests. In this example, if the internal BigBlueButton server is at, add the following line to /etc/hosts (you’ll need to edit this file as root user).

sudo vi /etc/hosts

insert line