Lanka Developers Community

    Lanka Developers

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

    root

    @root

    Linux Help

    There is a no place like 127.0.0.1

    212
    Reputation
    1724
    Profile views
    724
    Posts
    23
    Followers
    27
    Following
    Joined Last Online
    Website 127.0.0.1 Location Localhost

    root Unfollow Follow
    Node.js Web Development Game Development Linux Help

    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

    Latest posts made by root

    • The Next 100x Crypto Meme Gem

      PEIPEI 100x GEM in 2025

      be846b82-b105-40a3-8ee2-63cd26aa350c-image.png

      PeiPei Token Analysis: A Rising Meme Coin with Serious Potential

      PeiPei (PEIPEI), a meme coin launched just last month, is quickly becoming a notable contender in the crypto market. Its distinctive blend of meme culture and strategic endorsements has garnered significant attention and substantial growth.

      Major Endorsement from Bitcoin Expert Davinci Jeremie

      One of the most influential factors in PeiPei's early success is the endorsement from Davinci Jeremie, a well-known Bitcoin OG who advised investing in Bitcoin back in 2011. Jeremie's endorsement is not just superficial; he has proclaimed himself as the “official ambassador” of PeiPei and has invested heavily in the token. His Etherscan account reveals holdings of over $775,000 worth of PEIPEI, equivalent to 2.1 trillion tokens. Such a significant endorsement from a seasoned crypto expert underscores PeiPei's potential.

      Impressive Market Performance

      Since its launch on June 5, PeiPei has shown remarkable growth. The token’s price surged by 997%, pushing its market cap close to $150 million. Currently, PEIPEI trades at approximately $0.000000363 per token and ranks as the 10th most traded meme coin globally. Over the past month, PeiPei's price has surged 222.40%, securing the 284th position in the global cryptocurrency market list with a capitalization of $147.70 million. This bullish sentiment is supported by the token’s performance within an ascending channel pattern, suggesting potential for further growth.

      Unique Design and Ambitious Roadmap

      PeiPei sets itself apart by incorporating elements of Chinese culture with the iconic Pepe the Frog meme. This unique design has attracted a significant following, with over 22,000 Twitter followers. The development team’s roadmap includes ambitious plans for partnerships, marketing campaigns, and even the audacious goal of challenging the US dollar. The token's supply is capped at 420.60 trillion, with no buy/sell tax on trades, enhancing its appeal to investors.

      Technical Analysis and Market Sentiment

      From a technical perspective, PeiPei's price is bolstered by its SMA indicator, which acts as a support in the daily time frame. Although the Relative Strength Index (RSI) has not breached the overbought range, indicating mixed sentiment, the overall trend remains positive. The token has shown a consistent increase in trading volume, with a 7% price rise in just one day and a 67.79% surge over the past week. Its trading volume reached $208.7 million, and it recently recorded an all-time high (ATH) of $0.0000003943.

      Conclusion: A Promising Future
      PeiPei's rapid rise, combined with strategic endorsements and a robust market performance, suggests that it is more than just another meme coin. With Davinci Jeremie's backing and a unique cultural twist, PeiPei is well-positioned to continue its upward trajectory. However, like all meme coins, its future will depend on maintaining momentum and investor interest. Given its current trajectory, PeiPei is undoubtedly a token to watch in the coming months.

      Find more info

      posted in Crypto
      root
      root
    • RE: The third-party login system is not working on LankaDevelopers.lk.

      ohh thanks for the reporting, we'll solve asap;.

      posted in Comments & Feedback
      root
      root
    • RE: TALL STACK - Application optimize

      what you mean optimize ?

      posted in Laravel Framework
      root
      root
    • RE: Mora UXplore 1.0 - University of Moratuwa IEEE Student Branch

      Glad here that, thanks for the sharing ,

      posted in Events ( Free & Paid )
      root
      root
    • RE: Lanka Developers Community T-shirts

      @kupeshanth

      you can place the order here

      posted in Announcements
      root
      root
    • LocalAI: A drop-in replacement for OpenAI

      LocalAI

      LaMA, alpaca, gpt4all, vicuna, koala, gpt4all-j


      Self-hosted, community-driven simple local OpenAI-compatible API written in go. Can be used as a drop-in replacement for OpenAI, running on CPU with consumer-grade hardware. Supports ggml compatible models: LLaMA, alpaca, gpt4all, vicuna, koala, gpt4all-j


      Using LocalAI is straightforward and easy. You can simply install LocalAI on your local machine or server via docker and start performing inferencing tasks immediately, no more talkings let's start ,

      1. Install docker in your pc or server ( installation depend on the os type, check here)

      2. Open terminal or cmd and clone the LocalAi repo from github

          git clone https://github.com/go-skynet/LocalAI
        
      3. Go to the LocalAi/models folder in terminal

          cd LocalAi/models
        
      4. Download the model ( in here i use gpt4all-j model , this model coming with Apache 2.0 Licensed , it can be used for commercial purposes.)

         wget https://gpt4all.io/models/ggml-gpt4all-j.bin
        

        in here i use wget for download, you can download bin file manually and copy paste to the LocalAi/models folder

      5. Come back to the LocalAi root

      6. Start with docker-compose

           docker compose up -d --build
        

      After above process finished, let's call our LocalAi via terminal or cmd , in here i use curl you can use also any other tool can perform http request ( postman, etc.. )

      curl http://localhost:8080/v1/models
      

      This request showing what are the models we have added to the models directory

      Let's call the AI with actual Prompt.

      curl http://localhost:8080/v1/completions -H "Content-Type: application/json" -d '{
           "model": "ggml-gpt4all-j",            
           "prompt": "Explain AI to me like A five-year-old",
           "temperature": 0.7
         }'
      

      Windows compatibility

      It should work, however you need to make sure you give enough resources to the container. See

      Kubernetes
      You can run the API in Kubernetes, see an example deployment in kubernetes


      API Support
      LocalAI provides an API for running text generation as a service, that follows the OpenAI reference and can be used as a drop-in. The models once loaded the first time will be kept in memory.

      Example of starting the API with docker:

      docker run -p 8080:8080 -ti --rm quay.io/go-skynet/local-api:latest --models-path /path/to/models --context-size 700 --threads 4
      

      Then you'll see:

      ┌───────────────────────────────────────────────────┐ 
      │                   Fiber v2.42.0                   │ 
      │               http://127.0.0.1:8080               │ 
      │       (bound on host 0.0.0.0 and port 8080)       │ 
      │                                                   │ 
      │ Handlers ............. 1  Processes ........... 1 │ 
      │ Prefork ....... Disabled  PID ................. 1 │ 
      └───────────────────────────────────────────────────┘ 
      

      if you want more info about API, go to the github page
      https://github.com/go-skynet/LocalAI#api

      posted in Artificial Intelligence
      root
      root
    • RE: How To Clone A Private Github Repo To A cPanel Server

      is this can apply to the plesk ?

      posted in Blogs
      root
      root
    • RE: What are good technologies to learn in sri lanka

      i think rust, python and go lang is the best for future .

      posted in General Discussion
      root
      root
    • RE: Golang: Beego vs Revel. How to Choose?

      if you a nodejs express developer go for Fiber

      posted in Web Development
      root
      root
    • RE: How to reconnect next.js localhost

      npm run dev

      posted in General Discussion
      root
      root