Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop
    1. Home
    2. root
    3. Best
    • Profile
    • Following 27
    • Followers 23
    • Topics 14
    • Posts 724
    • Best 182
    • Controversial 1
    • Groups 4

    Best posts made by root

    • Linux Commands For Developers

      1. HARDWARE INFORMATION

      #Display messages in kernel ring buffer
      dmesg
      
      #Display CPU information.
      cat /proc/cpuinfo
      
      #Display memory information.
      cat /proc/meminfo
      
      #Display free and used memory ( -h for human readable, -m for MB, -g for GB.).
      free -h
      
      #Display PCI devices.
      lspci -tv
      
      #Display USB devices.
      lsusb -tv
      
      #Display DMI/SMBIOS (hardware info) from the BIOS.
      dmidecode
      
      #Show info about disk sda.
      hdparm -i /dev/sda
      
      #Perform a read speed test on disk sda.
      hdparm -tT /dev/sda
      
      #Test for unreadable blocks on disk sda.
      badblocks -s /dev/sda
      

      2. SYSTEM INFORMATION

      #Display Linux system information.
      uname -a
      
      #Display kernel release information.
      uname -r
      
      #Show which version of redhat installed.
      cat /etc/redhat-release
      
      #Show how long the system has been running + load.
      uptime
      
      #Show system host name.
      hostname
      
      #Display the IP addresses of the host.
      hostname -I
      
      #Show system reboot history.
      last reboot
      
      #Show the current date and time.
      date
      
      #Show this month's calendar.
      cal
      
      #Display who is online.
      w
      
      #Who you are logged in as
      whoami
      

      3. USER INFORMATION AND MANAGEMENT

      #Display the user and group ids of your current user.
      id
      
      #Display the last users who have logged onto the system.
      last
      
      #Show who is logged into the system.
      who
      
      #how who is logged in and what they are doing.
      w
      
      #Create a group named "test".
      groupadd test
      
      #Create an account named john, with a comment of "John Smith" and create the user's home directory.
      useradd -c "John Smith" -m john
      
      #Delete the john account.
      userdel john
      
      #Add the john account to the sales group.
      usermod -aG sales john
      

      4. FILE AND DIRECTORY COMMANDS

      #List all files in a long listing (detailed) format.
      ls -al
      
      #Display the present working directory.
      pwd
      
      #Create a directory.
      mkdir directory
      
      #Remove (delete) file.
      rm file
      
      #Remove the directory and its contents recursively.
      rm -r directory
      
      #Force removal of file without prompting for confirmation.
      rm -f file
      
      #Forcefully remove directory recursively.
      rm -rf directory
      
      #Copy file1 to file2.
      cp file1 file2
      
      #Copy source_directory recursively to destination. If destination exists, copy source_directory into destination, otherwise create destination with the contents of source_directory.
      cp -r source_directory destination
      
      #Rename or move file1 to file2. If file2 is an existing directory, move file1 into directory file2.
      mv file1 file2
      
      #Create symbolic link to linkname.
      ln -s /path/to/file linkname
      
      #Create an empty file or update the access and modification times of file.
      touch file
      
      #View the contents of file.
      cat file
      
      #Browse through a text file.
      less file
      
      #Display the first 10 lines of file.
      head file
      
      #Display the last 10 lines of file.
      tail file
      
      #Display the last 10 lines of file and "follow" the file as it grows.
      tail -f file
      

      5. FILE PERMISSIONS
      0_1543122821558_linux-permissions-chart.png

      PERMISSION EXAMPLE

      U   G   W
      rwx rwx rwx     chmod 777 filename
      rwx rwx r-x     chmod 775 filename
      rwx r-x r-x     chmod 755 filename
      rw- rw- r--     chmod 664 filename
      rw- r-- r--     chmod 644 filename
      

      6. PROCESS MANAGEMENT

      #Display your currently running processes.
      ps
      
      #Display all the currently running processes on the system.
      ps -ef
      
      #Display process information for processname.
      ps -ef | grep processname
      
      #Display and manage the top processes.
      top
      
      #Interactive process viewer (top alternative).
      htop
      
      #Kill process with process ID of pid.
      kill pid
      
      #Kill all processes named processname.
      killall processname
      
      #Start program in the background.
      program &
      
      #Display stopped or background jobs.
      bg
      
      #Brings the most recent background job to foreground.
      fg
      
      #Brings job n to the foreground.
      fg n
      

      7. PERFORMANCE MONITORING AND STATISTICS

      #Display and manage the top processes.
      top
      
      #Interactive process viewer (top alternative).
      htop
      
      #Display processor related statistics.
      mpstat 1
      
      #Display virtual memory statistics.
      vmstat 1
      
      #Display I/O statistics.
      iostat 1
      
      #Display the last 100 syslog messages  (Use /var/log/syslog for Debian based systems.).
      tail 100 /var/log/messages
      
      #Capture and display all packets on interface eth0.
      tcpdump -i eth0
      
      #Monitor all traffic on port 80 ( HTTP ).
      tcpdump -i eth0 'port 80'
      
      #List all open files on the system.
      lsof
      
      #List files opened by user.
      lsof -u user
      
      #Display free and used memory ( -h for human readable, -m for MB, -g for GB.).
      free -h
      
      #Execute "df -h", showing periodic updates.
      watch df -h
      

      8. NETWORKING

      #Display all network interfaces and ip address.
      ifconfig -a
      
      #Display eth0 address and details.
      ifconfig eth0
      
      #Query or control network driver and hardware settings.
      ethtool eth0
      
      #Send ICMP echo request to host.
      ping host
      
      #Display whois information for domain.
      whois domain
      
      #Display DNS information for domain.
      dig domain
      
      #Reverse lookup of IP_ADDRESS.
      dig -x IP_ADDRESS
      
      #Display DNS ip address for domain.
      host domain
      
      #Display the network address of the host name.
      hostname -i
      
      #Display all local ip addresses.
      hostname -I
      
      #Download http://domain.com/file.
      wget http://domain.com/file
      
      #Display listening tcp and udp ports and corresponding programs.
      netstat -nutlp
      

      9. ARCHIVES (TAR FILES)

      #Create tar named archive.tar containing directory.
      tar cf archive.tar directory
      
      #Extract the contents from archive.tar.
      tar xf archive.tar
      
      #Create a gzip compressed tar file name archive.tar.gz.
      tar czf archive.tar.gz directory
      
      #Extract a gzip compressed tar file.
      tar xzf archive.tar.gz
      
      #Create a tar file with bzip2 compression.
      tar cjf archive.tar.bz2 directory
      
      #Extract a bzip2 compressed tar file.
      tar xjf archive.tar.bz2
      

      10. SEARCH

      #Search for pattern in file.
      grep pattern file
      
      #Search recursively for pattern in directory.
      grep -r pattern directory
      
      #Find files and directories by name.
      locate name
      
      #Find files in /home/john that start with "prefix".
      find /home/john -name 'prefix*'
      
      #Find files larger than 100MB in /home.
      find /home -size +100M
      

      11. SSH LOGINS

      #Connect to host as your local username.
      ssh host
      
      #Connect to host as user.
      ssh user@host
      
      #Connect to host using port.
      ssh -p port user@host
      

      12. FILE TRANSFERS

      #Secure copy file.txt to the /tmp folder on server.
      scp file.txt server:/tmp
      
      #Copy *.html files from server to the local /tmp folder.
      scp server:/var/www/*.html /tmp
      
      #Copy all files and directories recursively from server to the current system's /tmp folder.
      scp -r server:/var/www /tmp
      
      #Synchronize /home to /backups/home.
      rsync -a /home /backups/
      
      #Synchronize files/directories between the local and remote system with compression enabled.
      rsync -avz /home server:/backups/
      

      13. DISK USAGE

      #Show free and used space on mounted filesystems.
      df -h
      
      #Show free and used inodes on mounted filesystems.
      df -i
      
      #Display disks partitions sizes and types.
      fdisk -l
      
      #Display disk usage for all files and directories in human readable format.
      du -ah
      
      #Display total disk usage off the current directory.
      du -sh
      

      14. DIRECTORY NAVIGATION

      #To go up one level of the directory tree.  (Change into the parent directory.).
      cd ..
      
      #Go to the $HOME directory.
      cd
      
      #Change to the /etc directory.
      cd /etc
      

      @Linux-Help

      posted in Linux
      root
      root
    • What's your programming language ?

      My base language is JavaScripts, I use Node Js for backend, VUE & Angular for frontend and ionic/angular & NativeScript with Angular for mobile applications.

      What are the programming languages did you use to develop softwares and web based applications ?

      banner-1.png

      posted in Comments & Feedback
      root
      root
    • The best Linux distro in 2018 (#1 in distrowatch.com)

      0_1545329970552_New_logo_tex.png

      Everyone who uses Linux has heard of the big names like Ubuntu, Debian, Arch, and Mint. Few people know about smaller distros like Manjaro. Those people don’t know what they are missing. The article will explain ‘why I use Manjaro and you should too’.

      Manjaro is one of the few Linux distributions that are not based on Ubuntu. Instead, it is built on the continually cutting edge Arch Linux.

      1. Arch Without All the Hassle


      Arch is a great distro, but unfortunately, if you want to install it you have to do a lot of work. Don't worry Manjaro takes all of the hassle out of installing Arch. Like most distros, all you have to do is download the ISO file, write it to a thumb drive, and install it. The Calamares installer gives you a smooth experience similar to Ubuntu’s Ubiquity installer.

      2. Great Hardware Support


      When installing Linux, it can be a pain to get all the hardware working. When you install Manjaro, it scans the system and installs the required drivers. On one of my computers, I have an old wireless card. Every time I install a new distro, I have to go through some extra steps to get that drivers working. When I install Manjaro, it works out of the box.

      3. Don’t Have to Worry About PPAs


      Before I switched to Manjaro, I used both Lubuntu and Linux Mint. The one thing that really bugged me was having to deal with PPAs (Personal Package Archive). Basically, a PPA is a repo for just a single application or a small group of applications. For those who never had to deal with this, allow me to explain.

      Every time I wanted to install a piece of software that was not in the offIcial Ubuntu repos, I had to link a new PPA to my system via the terminal. Once it was linked and I had run sudo apt-get update, then the program was available for installation.

      While adding the PPA doesn’t take a lot of time, it is a pain. When I upgraded from one version of Linux Mint to another I has a hell of a time getting the PPA I used switched over. If you use a lot of PPAs, it can quickly become a rat’s nest.

      Then there’s the security aspect. There have been several times in the past when people have gotten a hold of old and unused PPAs and used them to push out malware.

      Since Manjaro uses Arch as a base instead of Ubuntu, it doesn’t support PPAs. Instead, you have access to the Arch User Repository. for more info, read on.

      4. Tons of Software


      Just because Manjaro doesn’t have PPAs, don’t think that it lacks in software. The Manjaro team maintains a large software repository. Beyond that, Manjaro users also have access to the Arch User Repository. The AUR is made up of user created scripts to install applications not packaged for Arch (or in this case Manjaro).

      Quite a few of the applications in the AUR were either originally packaged for Ubuntu or are pulled directly from Github. The scripts in the AUR then modify the .deb files, so that they can be installed on Manjaro.

      5. Latest and Greatest without Killing Your System


      One of the problems that Arch users often have, because it is a rolling release, a new package will be released and it will break their system. The Manjaro team works to avoid that by testing new packages before making them available to users. While this might make Manjaro slightly less than bleeding edge, it also ensures that you’ll get new packages a lot sooner than distros with scheduled releases like Ubuntu and Fedora. I think that makes Manjaro a good choice to be a production machine because you have a reduced risk of downtime.

      6. Switching Kernels is Easy


      In order to switch kernels on most distros, you have to use some terminal wizardry. Manjaro has a nice little application that allows you to install as many kernels as you want. This is handy if you have an older laptop and it doesn’t like a new kernel. In my case, I have an HP laptop that slows way down when you use a kernel newer than 4.4. and switching kernels was just a couple of clicks away.

      7. Switching Kernels is Easy


      There are a number of distro communities (including Arch) that are known for not being very noob friendly. The same is not true for Manjaro. The official Manjaro forum is a great place for new people to find help. They also have forums available in over 29 languages for non-English speakers

      Source


      https://manjaro.org/
      https://distrowatch.com/

      0_1545330903641_manjaro-cinnamon-15-12-is-out-and-ready-for-download-498153-2.jpg

      0_1545331121897_manjaro cinnamon 17.0 nemo.jpg

      posted in Linux
      root
      root
    • RE: මොකක්ද ඉක්මන් Angular/React.js?

      react hodai, vue th hodai, angular wadiya web walata use wenne na dan.

      posted in Front-End Development
      root
      root
    • RE: App for Lanka Developers Community

      yah we can contribute to develop an app..

      posted in General Discussion
      root
      root
    • RE: Share your knowledge and experience and win a t-shirt

      Ohh wow, I want This .

      posted in Announcements
      root
      root
    • RE: jasper report printing problem

      @ChrisSachintha

      ayyo salli hema welema external files ekka load karaddi try catch ekak athule load karanna , ethakota oyata errors catch karanna puluwan

      posted in Programming
      root
      root
    • RE: පහසුන්වෙන්ම ඔබෙ Angular Application එක නොමිලෙ Netlify server එකෙ deploy කර ගමු. (Simple English)

      awesome bro, nelify is a great option for serverless technology, please do a article for heroku, that is all also free

      https://heroku.com

      posted in Front-End Development
      root
      root
    • RE: Is it possible to get Google Maps API key?

      use https://www.mapbox.com. this is awesome.

      posted in General Discussion
      root
      root
    • LankaDevelopers Core Update

      We did an update for LankaDevelopers core technologies to improve the website performance and scalability, in this update we have changed the session driver to Redis memory database, so old user sessions are no longer exists in the server, users have to login again to the LankaDevelopers, sorry for the inconvenience .

      if you forgot the password you can reset it by email, if you forgot your username or email contact us info[at]lankadevelopers.com

      we would like to introduce, our PWA version with this new update. We have applied the PWA concept to our web application. Users can enable the PWA just by clicking "Add to home screen" button in the web browser.

      Cheers !!

      posted in Announcements
      root
      root
    • RE: java application implementation

      @ChrisSachintha

      machan mysql default remote login off karala thiyenne. oya manual remote login on karanna one e wagema mysql port eka allow karanna one firewall eken.

      posted in Programming
      root
      root
    • RE: Send Emails without a server-side code with Angular

      Good article bro. Can we use SMTP js for ionic ?

      posted in Front-End Development
      root
      root
    • RE: Basic SEO for Web Developers Part 3

      Part One : https://lankadevelopers.com/topic/28/basic-seo-for-web-developers-part-1/6
      Paer Two : https://lankadevelopers.com/topic/32/basic-seo-for-web-developers-part-2/6

      Fatta bro. thanx

      posted in Web Development
      root
      root
    • RE: Software Engineering - Internship

      as a web developer you must learn javascripts, php, html, css and how to work with third party API's, that's it. inside this all languges there are lot of frameworks

      1. frontend frameworks ( react, vue, angular)
      2. server side php (laravel, slim)
      posted in General Discussion
      root
      root
    • RE: Deploy your Ionic 4/5 as a Web app on Firebase

      this is ionic PWA ??

      posted in Web Development
      root
      root
    • RE: need an advice

      @Dhanuka

      java web walata igana gena nam wedak na eth java anith dewal walata thamath use wenawa. man hithanne na danma java nathi wei kiyala oya web developer kenek nam wenna hadanne java igana gena wedak na

      posted in General Discussion
      root
      root
    • RE: Laravel groupBy #backend
      $grouped = $collection->groupBy('foreignkey_id');
      
      posted in Back-End Development
      root
      root
    • RE: Software Engineering - Internship

      @Nano

      wenama category ekak thiyenawa jobs kiyala ekema danna

      https://lankadevelopers.com/category/30/job-portal

      api me dawas wala job portal ekak hadana gaman inne haduwama meke dannam ethakota lesi wei lankawe ayata IT jobs hoyaganna

      posted in General Discussion
      root
      root
    • RE: Polymorphic Relations In Laravel
      "A polymorphic relationship allows the target model to belong to more than one type of model using a single association."
      

      That means you can associate one(1) table (Model) for different situations.

      Ex : Facebook has comments for Images and Videos, In the backend Facebook only has one "comments" table for both Images & Videos.

      And also this relationship can work with other relationships in Eloquent ORM

      • One To One (Polymorphic)
      • One To Many (Polymorphic)
      • Many To Many (Polymorphic)

      https://laravel.com/docs/5.7/eloquent-relationships#polymorphic-relationships

      posted in Back-End Development
      root
      root
    • 1
    • 2
    • 3
    • 4
    • 5
    • 9
    • 10
    • 1 / 10