Tags » Ubuntu/Linux

Linux/Ubuntu: How to use grep and find command

How to use grep to find text including sub directories:
grep -rl {yoursearchstring} {pathtosearch} e.g.,

$ grep -rl "hello" /var/
/var/lib/dpkg/status-old
/var/lib/dpkg/status
/var/log/test.log:1:hello world

where: 200 more words

How to install Firefox in Ubuntu

How to install Firefox 55 on Linux Mint, Ubuntu, Debian, CentOS, Fedora…
… or any other Linux distribution.

This red panda (Firefox) has not much to do with installing Firefox on Linux… 1,056 more words

Target filesystem doesn' t have requested /sbin/init No init found. Try passing init = bootarg.

mount: mounting /dev/loop0/ on /root failed : Invalid argument
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /sys on /root/sys failed: No such file or directory…
219 more words

Linux common problems and its solutions

Problem:
$ apt-get install vim
E: Unable to locate package vim
Solution:

$ apt-get update && apt-get install apt-file
$ apt-file update && apt-get install vim
# Note: for non-root user, just use sudo apt-get ...

Setup nginx

Create a configuration file
vi /etc/nginx/conf.d/railsapp.conf and copy the content below

server {
        listen 80;
        server_name railsApp.com;
        rewrite ^ https://$host$request_uri? permanent;
}

server {
        server_name railsApp.com;

        listen 443 ssl;
        ssl_certificate /etc/nginx/ssl/nginx.crt;
        ssl_certificate_key /etc/nginx/ssl/nginx.key;

        gzip on;
        gzip_types      text/plain text/css application/javascript;
        gzip_min_length 1000;

        location / {
                proxy_pass http://localhost:3474;
                proxy_set_header Host $host;
                proxy_buffering off;
                proxy_set_header X-Forwarded-Host $host;
                proxy_set_header X-Forwarded-Server $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                # Adding support for WebSocket
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }

        location /forum {
                proxy_pass http://localhost:4001;
                proxy_set_header Host $host;
                proxy_buffering off;
                proxy_set_header X-Forwarded-Host $host;
                proxy_set_header X-Forwarded-Server $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                # Adding support for WebSocket
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
        }
}

Ubuntu/linux

How to install php curl ?

### First, check if there is enabled curl.
$ php info | grep -i curl

### If no result then install the php curl library
$ sudo apt-get install php5-curl

### Once its installed restart the server
$ sudo /etc/init.d/apache2 restart

### Verify if the curl is enabled. 22 more words

How to setup a supervisor - monitor Linux processes

Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.

More info at http://supervisord.org/ 83 more words