Halaman

Jumat, 03 Juli 2015

Install Desktop on Linux VPS

Follow the following simple steps :

  1. sudo apt-get update
  2. sudo apt-get upgrade
  3. sudo apt-get install xfce4
  4. sudo apt-get install vnc4server
  5. vncserver :3000
  6. sudo fallocate -l 4G /swapfile
  7. sudo chmod 600 /swapfile
  8. sudo mkswap /swapfile
  9. sudo swapon /swapfile
  10. Set permanent swapfile: nano /etc/fstab
  11. add the line to /etc/fstb : /swapfile   none    swap    sw    0   0
now your vncserver is running on port : 8900 (because when running vnc server, we specify :3000, so it is 5900 + 3000 = 8900)

Connect using vncviewer client to the ip address xxx.xxx.xxx.xxx:8900 specify the password you typed on step 5, and then when loged in to the desktop on the terminal run startxfce4

Enjoy!

Senin, 08 Juni 2015

More simpler, setup wildcard subdomain on Ubuntu

$ sudo nano /etc/NetworkManager/NetworkManager.conf
- search for "dns=dnsmasq"
- replace with "#dns=dnsmasq"
$ sudo apt-get install dnsmasq
$ sudo nano /etc/dnsmasq.conf
- append line: "listen-address=127.0.0.1"
- append line: "bind-interfaces"
- append line: "address=/dev/127.0.0.1"
$ sudo netstat -plant | grep :53
- look for "NUMBER/dnsmasq"
$ sudo kill -9 NUMBER
- fill in the number you found for "NUMBER"
$ sudo service dnsmasq restart
$ sudo nano /etc/dhcp/dhclient.conf
- append line: "prepend domain-name-servers 127.0.0.1;"
$ sudo service network-manager restart

and to add a wildcard subdomain add to the virtual host directive
ServerAlias *.vhostdomain.com

On the courtesy of: http://www.leaseweblabs.com/2013/08/wildcard-dns-ubuntu-hosts-file-using-dnsmasq/

Selasa, 14 April 2015

Recursively chmod only on directories or files

A Very simple neat trick to chmod the directories/files
chmod 755 $(find /path/to/base/dir -type d)
and
chmod 644 $(find /path/to/base/dir -type f)
alternative: executing one by one, instead..
for files:
sudo find . -type f -exec chmod 644 {} \;
for directories
sudo find . -type d -exec chmod 755 {} \;
And if you are using that chmod, you are likely using that for your web server. Don't forget to install suPHP on apache, and then setup the configuration at /etc/suphp/suphp.conf and on your virtual host(s) add the 
php_admin_flag engine off
suPHP_Engine on

or perhaps using the fast-cgi approach

Cheers! :D

Setup Wildcard SubDomain on local computer


  1. Install Bind
  2. Install Webmin
  3. Configure server using webmin
    1. check if webmin service is run by running sudo service webmin start
    2. browse to the http://{YOUR_IP or LOCALHOST}:10000
    3. enter your root / sudoer account password
      1. Configure the bind service
        1. Forwarding and Transfer
          1. Enter google dns servers (8.8.8.8, 8.8.4.4)
      2. Configure the server (Servers >> Existing DNS Zones), if this is not shown, use the following command to install the bind-server:
        sudo apt-get install bind9 bind9utils bind9-doc and then refresh the modules on webmin
        1. Create master zone
        2. Domain name: enter your domain, example domain.do
        3. Email address: enter your valid email address format
        4. Edit master zone domain.do
          1. Name: domain.do
            Address: 127.0.0.1
          2. Name: *.domain.do
            Address: 127.0.0.1
        5. try to ping domain.do it should returns 127.0.0.1
If you are receiving a 503 error, try to change the directory mode to 0755 and the file to 0644
It is also important to put index.php (indexes file) on your root.
Don't forget to also add the directory to the list of accessible directory by Apache, **see the Apache configuration files**

:) Cheers!