Category: Linux

  • List and run last used commands in Linux

    To list through most recently used commands one by one use Arrow-Up key To display all used commands:history To run a command from the history list:!391 where 391 command number

  • Installing LDAP support in PHP on Ubuntu LAMP server

    LDAP support in PHP is not enabled by default. To enable LDAP support on an existing Ubuntu Apache web server you need to install php5-ldap package. Install php5-lda:sudo apt-get install php5-ldapReboot apache/etc/init.d/apache2 restart

  • Install network traffic monitoring utility vnStat on Ubuntu server

    vnStat is a console based network traffic monitoring utility for Linux which collects bandwidth statistic for selected interface(s).To install vnStat run:sudo apt-get install vnstat To create and configure database run:sudo vnstat -u -i eth0Note 1: This assumes that you want to monitor eth0 interface. To find all your active interfaces run ifconfig.Note 2: Some manuals…

  • Ubuntu Grub – Change Default OS

    If you install Ubuntu as a second Operating System alongside Windows, every time computer boots you will be presented with a Grub boot menu where you can make a choose which OS to boot. If you don’t make any choice in 10 seconds your default OS will boot. Obviously after installing Ubuntu it will become…

  • Importing large sql file into MySQL database

    The easiest way to import an .sql file into MySQL database is use phpMyAdmin web interface. Login into phpMyAdmin control panel Select your database Click on Import tab Select your .sql file, click Go and you are done Problem with this is that PHP configuration normally limits size of files you can upload. There should…

  • Ubuntu Server Tips

    Check remaining disk space df -hReports free space on each mount. Monitor web server in real time tail -f /var/www/yoursite/logs/access.logReads Apache access long file and displays changes in real time. Your log file may be in different location depending on settings.

  • Check Ubuntu Server Linux version

    Ubuntu Server doesn’t have GUI, but you can find version using number of terminal commands lsb_release -a cat /etc/issue cat /proc/version uname -a

  • Disable Ubuntu Unity Launcher Autohide

    Unity 3D on Ubuntu 11.04 (Natty Narwhal) and Ubuntu 11.10 (Oneiric Ocelot) Use this method to disable Unity Launcher autohide on Ubuntu 11.04. On Ubuntu 11.10 this will only work if you use Unity 3D. For Unity 2D check the second method below. Unity 2D was introduced in Ubuntu 11.10 to provide Unity interface for…

  • Set up Linux (Ubuntu) server to synchronise clock with NTP time server

    ntupdate ntupdate comes built in into Ubintu server. To manually adjust server time run:sudo ntpdate ntp.ubuntu.comYou can choose another ntp server instead of  ntp.ubuntu.com ntpd To automatically keep server time up to date use ntp. Install ntpd:sudo apt-get install ntp ntpd should start working immediately without any additional configuration. However you obviously can adjust settings…

  • Ubuntu – Disable Music File Preview on Mouseover

    In Ubuntu by default if you click on a music file or just mouseover it will automatically start playing the file. Even if there is another file playing. To disable this behaviour:Nautilus (File Explorer) > Edit > Preferences > Preview > Preview Sound Files – Never Ubuntu 10.10

  • Ubuntu – disable auto screen lock after suspend and hibernate

    Disable auto screen lock after suspend and hibernate Even if during installation you chose “Login in automatically” Ubuntu will prompt you for a password after starting from suspend (sleep) and hibernate. To change this behaviour try this: Option 1 System > Preferences > Screensaver Disable “Lock screen when screensaver is active“ If this doesn’t work…

  • Disable directory listing (index) in Apache

    Open the file:/etc/apache2/httpd.confAnd add the following line line:Options –IndexesRestart Apache:sudo /etc/init.d/apache2 reload OR /etc/apache2/sites-availabl/[sitename]find line:Options Indexes FollowSymLinks MultiViewsAnd add “–” in front of the “Indexes“:Options -Indexes FollowSymLinks MultiViewssudo /etc/init.d/apache2 reloadUbuntu Server