Rabu, 14 Maret 2018

How To Proceed Parse Server Dashboard Running Or Initiatory Of All At Organization Boot

Parse-Dashboard-

By-Default parse dashboard industrial plant until your final is active, in i lawsuit your connectedness intermission parse dashboard volition non endure available.
We tin move ii methods to proceed dashboard running always.

Method 1- Use nohup command.


Step 1- move nohup ascendence amongst parse dashboard
 Use nohup command to proceed running parse dashboard inwards the background. move the ascendence below.
Go to the parse dashboard directory-
 root@Server16: #  cd /opt/parse-dashboard
use nohup "parse command" &


root@Server16:/opt/parse-dashboard# nohup parse-dashboard --config parse-dashboard-config.json --allowInsecureHTTP imitation &

nohup ascendence volition proceed running parse dashboard inwards the background


Step 2- setup this ascendence to run at organization boot.
above ascendence volition aid us to run parse dashboard inwards the background but inwards illustration our server gets the reboot or crashed due to ability failure or other reason. In such case, nosotros postulate to brand certain to run our parse dashboard at organization kick up. follow the steps below to run dashboard at organization boot.

open in addition to edit rc.local file
root@Server16: # vi /etc/rc.local
Append the parse dashboard path in addition to then ascendence to offset parse dashboard. Add the ruby-red highlighted trace of piece of occupation to your rc.local, brand certain y'all are adding both the trace of piece of occupation earlier exit 0.
# In gild to enable or disable this script only alter the execution # bits. # # By default this script does nothing. #path of parse dashboard cd /opt/parse-dashboard # Command to offset parse dashboard inwards the backgroupnd nohup parse-dashboard --config parse-dashboard-config.json --allowInsecureHTTP imitation & exit 0 
Your file should endure similar to a higher identify inwards the screenshot

Method 2- Use PM2 npm module to offset parse dashboard.

We can  PM2 ascendence to start, halt in addition to banking concern fit the condition of parse dashboard. The wages is nosotros tin stop, offset in addition to banking concern fit the condition of our dashboard anytime. Follow the steps below to brand PM2 ascendence available inwards your environment.
Step 1- Install PM2
To install PM2 on your Linux machine move ascendence below.
sudo npm install -g pm2
Once pm2 installed, 
Step 2- Create parse-dashboard.json file.
create a script to brand parse dashboard available globally at Linux shell.
Create a parse-dashboard.json file using vim editor.
root@Server16: # vi parse-dashboard.json
Append the follow lines in addition to alter the highlighted trace of piece of occupation amongst your path
{   "apps" : [{     "name"        : "parse-dashboard-wrapper",     "script"      : "/usr/bin/parse-dashboard",     "watch"       : true,     "merge_logs"  : true,     "cwd"         : "/opt/parse-dashboard",     "args"         : "--config /opt/parse-dashboard/parse-dashboard-config.json --allowInsecureHTTP=1"   }] } 
Save in addition to driblet dead from the editor.
Step 3- Start parse dashboard.
root@Server16: # pm2 offset parse-deshboard.json
Parse dashboard is upward in addition to running.
Step 4- Check status:
root@Server16: # pm2 condition parse-deshboard.json
Step 4-Check condition of specific pm2 ID
To banking concern fit the item of ascendence move ID of running app
root@Server16: # pm2 demonstrate 0
In the screenshot below y'all volition detect Script path in addition to executed command.

Step 5- Mark pm2 ascendence execute during organization boot.
Your application volition endure available until the system is upward in i lawsuit your organization kick upward y'all in i lawsuit again postulate to run this ascendence to brand available your dashboard.
Let's laid upward our ascendence to execute during organization boot.
open in addition to edit rc.local file
root@Server16: # vi /etc/rc.local
Add the next trace of piece of occupation earlier exit 0 line
# bits. # # By default this script does nothing. #Start parse dashboard at organization kick upward pm2 offset /home/amar/parse-deshboard.json exit 0  
Save in addition to driblet dead from the file.

Now, your parse dashboard volition endure available if your organization gets the reboot.



Sumber https://linuxhowtoguide.blogspot.com/

Sabtu, 10 Maret 2018

Mongodb Basic Direction Command- Exercise Db, Exercise User, Assign Permission, Restrain Access

MongoDB:
MongoDB is an open-source document database that provides high performance, high availability, as well as automatic scaling. MongoDB obviates the involve for an Object Relational Mapping (ORM) to facilitate development.


  • Basic MongoDB admin related commands:
1- Check MongoDB server version:
Run below ascendance mongo to banking company gibe mongodb version
root@US16: # mongo MongoDB crunch version v3.6.0 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.6.0 
2-List all the database: To listing all the DBs hitting ascendance show dbs;
> show dbs; admin   0.000GB config  0.000GB local   0.000GB > 
3-Enable MongoDB authentication:
By default, mongodb installation convey opened upwards access to the shell. that hateful anyone tin forcefulness out run the ascendance as well as modify the dbs.

Let's enable authentication : Follow the steps below
3A-Create a user amongst total privileges: Run the next command 
use admin db.createUser({user:"admin", pwd:"redhat", roles:[{role:"root", db:"admin"}]})
Command output would hold upwards similar this:
source document database that provides high functioning Mongodb basic direction command- Create DB, Create User, Assign Permission, trammel access

Now leave of absence from the mongo shell- type ascendance exit
3B- Stop mongod service
root@US16: # systemctl halt mongod.service
3C-Modify /lib/systemd/system/mongod.service :

root@US16: # vi /lib/systemd/system/mongod.service
Append --quiet --auth syntax inwards trouble starting fourth dimension with 
ExecStart=/usr/bin/mongod --quiet --auth --config /etc/mongod.conf
[Service] User=mongodb Group=mongodb ExecStart=/usr/bin/mongod --quiet --auth --config /etc/mongod.conf # file size LimitFSIZE=infinity 
Your ExecStart trouble should hold upwards like 

Save as well as Exit from the file
4- Reload service daemon: Run the ascendance below
root@US16: # systemctl daemon-reload
5- Start mongo service:Run the ascendance below
root@US16: # systemctl starting fourth dimension mongod.service
6- Check mongo service status: We involve to validate mongo service afterward applied the changes let's banking company gibe mongo service condition using below command.
root@US16: # systemctl condition mongod.service
7- Everything hold off adept as well as mongo service is dorsum authentication has enabled, allow validate access.
7A- Access mongo crunch amongst authentication 
root@US16: # mongo -u root -p
We are successfully able to login amongst username as well as password!
8- List all users: Login to mongo crunch amongst admin user
select database admin
> utilisation admin
Execute the next ascendance show users; to listing users
> demo users; {         "_id" : "test.admin",         "user" : "admin",         "db" : "test",         "roles" : [                 {                         "role" : "root",                         "db" : "admin"                 }         ] } {         "_id" : "test.amar",         "user" : "amar",         "db" : "test",         "roles" : [                 {                         "role" : "root",                         "db" : "admin"                 }         ] } >  
In the higher upwards out at that spot are 2 user available highlighted inwards cerise color 
9- Check electrical flow selected database:
To banking company gibe electrical flow choose database utilisation ascendance db

> db admin > 
10- Check electrical flow selected database's collection:
 To banking company gibe electrical flow choose database's collection utilisation ascendance show collections

> demo collections system.users system.version > 
11- Update password for existing user:
Use the next ascendance to update existing user's password

> utilisation admin switched to db admin > db.changeUserPassword("amar", "newpassword") > 
Where "use admin" ascendance to choose database as well as db.changeUserPassword("username","Newpassword")



Sumber https://linuxhowtoguide.blogspot.com/

Selasa, 27 Februari 2018

How To Piece Of Occupation Sudo Ascendance Without Entering Password Inwards The Linux

Sudo ascendence without Password: - We cause got to perform twenty-four hours to twenty-four hours activities inwards our information technology infrastructure, Sometime nosotros postulate to run simply about ascendence inwards whatever application or within simply about script that may require sudo alongside the command. 

Therefore, inwards this guide, I am going to explicate how to configure password less sudo. As per our requirement nosotros tin setup sudo for all the ascendence or nosotros tin exclusively specify simply about ascendence to run equally sudo without password.

Prerequisites- 

  • One user alongside sudo access (amar)
  • One normal user (sudotest)

Step 1- setup sudo access for all the commands.

  • Login to Linux Machine user alongside sudo access.
  • modify /etc/sudoers file together with grant permission to sudotest user.
  • Open sudoers file

amar@U16: $ sudo vi /etc/sudoers 
  • Add next line 
sudotest ALL=(ALL) NOPASSWD:ALL


  • Save together with larn out From the file.
Step 2- Verify sudo access without password for user sudotest

  • Login to linux machine using sudotest user.
  • To verify sudotest user's sudo access without entering password, let's endeavor to halt Apache2 service using ascendence below

 sudo /etc/init.d/apache2 stop



  • Apache2 Service has been stopped successfully using sudo without entering password.
Please Note:- If you lot are working alongside an organization, where you lot cause got to assign permission to multiple user, inwards such instance you lot tin practice a grouping together with allow grouping to execute sudo ascendence without entering password, afterward add together all those user inwards this group.

Step 3- Allow a user to run specify command  only.

  • Some scheme administrator may required to grant permission to simply about user to execute few commands  alongside sudo equally per the projection requirement.  In such instance nosotros tin grant sudo access to exclusively specific commands.
  • Let's cause got an example- H5N1 user postulate to reload apache2 service to apply modified changes but User is non fellow member of Sudo group.
Try to reload apache2 service without granting access:

sudo /etc/init.d/apache2 reload
here is output of the command:

  • Grant user raj permission to reload apache2 service.
  • Open /etc/sudoers file - I am editing this file alongside user amar (have sudo access)

amar@U16: $ sudo vi /etc/sudoers
Append follow line-
raj             ALL=(ALL) NOPASSWD:/bin/systemctl
Save together with larn out from the file.
Save together with larn out from the file.

  • Let's verify past times reloading apache2 service.

sudo /etc/init.d/apache2 reload

Systemctl ascendence working successfully without entering password.

Sumber https://linuxhowtoguide.blogspot.com/

Kamis, 22 Februari 2018

How To Setup Jenkins Projection In Addition To Specify Windows Node To Execute Builds.

Jenkins Job:
In the Jenkins Master in addition to Slave surroundings nosotros tin direct the specific node to execute build.
in around cases nosotros may required windows platform to run build. 

In my previous blog- I accept explained how to setup Windows Node equally Slave, Let's setup basic chore to execute on Windows platform.


Prerequisites-

  • Jenkins Windows node. 
  • In my representative i am using Linux equally Master in addition to Windows equally Slave. As inward moving-picture demonstrate below.

Step 1- Setup Job in addition to assign Windows node to execute build.

  • Login to Jenkins equally Admin > New Item > Enter Item name(Win_Powershell) > Type Freestyle >OK

  • On the side yesteryear side concealment select Restrict where this projection tin last run
  • In the Label Expression> Windows Node name.

  • In the Build steps > add > execute Windows batch ascendancy > in box type ascendancy to execute 
  • %SystemRoot%\system32\windowspowershell\v1.0\powershell.exe get-date > C:\Jenkinstest.txt
  • Apply and Save.

Step 2- Run the laid upward in addition to banking concern lucifer output at Windows Node.
  • After setting upward Project, let's run kickoff Build.
  • Select Build Now

  • Check laid upward logs
  • Build history > direct Build Number > Console Output










  • After success amount laid upward y'all Job output volition last similar this.

Basic Jenkins Job configured successfully amongst Windows Slave node. You tin customized chore script equally per your requirement.



Sumber https://linuxhowtoguide.blogspot.com/

Rabu, 21 Februari 2018

How To Setup Jenkins Slave On Windows Alongside Principal On Linux Macine

Jenkins: Windows every bit Slave Node-  

Jenkins Master comes amongst the basic installation in addition to you lot tin configure projection every bit per your requirement. Jenkins Master handles all the configuration in addition to task for your build.


Now, sometime you lot demand to stimulate got Slave Windows Jenkins to run projection that actually demand Windows environment to execute to a greater extent than or less script, ascendancy etc.

In Jenkins Master in addition to Slave surround you lot tin configure multiple projection amongst unlike OS environment. Jenkins Master operate JNLP (JAVA Network Launch Protocol) agent to communicate amongst Slave node.

Jenkins Master is to schedule all the hit task in addition to assign Slave node for specific Project. It is easier to stimulate got online in addition to offline slave node every bit per requirement. To avoid manual commencement of JNLP nosotros tin install it every bit a service in addition to Slave node tin easily come upward online afterward a reboot.

Let's commencement setting upward Jenkins Slave on Windows spell Master on Linux.

Prerequisites-
  • Jenkins Master on Linux  (IP-192.168.102.12)
  • Windows Machine - IP 10.0.1.107 (JAVA Must last installed)
Step 1- Install Windows Slaves Plugins-
  • Login to Jenkins Master > Manage Jenkins > Manage Plugins


  • At Plugins page pick out Available > inward the filter search - type Windows Slaves > Install without restart

Step 2- Enable the TCP port of JNLP agent

  • Login to Jenkins every bit admin
  • Manage Jenkins > Configure Global Security  
  • On the adjacent enshroud select TCP port for JNLP agents > Random > Apply > Save




Step 3- Add Windows node to Master Jenkins.
  • Login to Jenkins Master > Manage Jenkins > Manage Nodes


  • On adjacent enshroud click on new node > Node Name (i.e. Windows-Agent)


  • On the Next Scree fill the node details

  • At adjacent Screen click on Launch



  • It volition download the file Slave-Agent.jnlp
  • Copy slave-agent.jnlp to the Windows machine.
Step 4-  Install slave-agent.jnlp at Windows Machine.
  • Before starting agent installation at Windows brand sure, Windows machine stimulate got JAVA installed, If non delight download in addition to install Java.
  • Download in addition to install Java from the next link.
    http://javadl.oracle.com/webapps/download/AutoDL?BundleId=230542_2f38c3b165be4555a1fa6e98c45e0808

  • Once Java installation finished. Go to Java path: C:\Program Files\Java\jre1.8.0_161\bin
  • Right click on JAVA.exe executable file in addition to send shortcut to desktop
  • Now correct click on Java shortcut available at desktop in addition to modify target.

  • Now Right click on Java shortcut at desktop in addition to Launch it.

  • At adjacent Screen click Run












  • On the Next Page you lot encounter that your agent is instantly connected with Jenkins Master.
  • Let's install the Jenkins slaves every bit a service in addition to thus that whenever your Windows machine larn restarted. Slave Agent come upward online automatic.

  • To Install Jenkins Slave service - File > Install every bit a service > OK
  • Jenkins Slave service installation volition last consummate in addition to you lot volition see jenkinsslave-C__Jenkins in Services console.
  • Go to Run > Services.msc
  • Let's banking corporation fit Node condition inward the Master Jenkins





  • Login to Jenkins Master > Manage Jenkins > Manage Nodes



  • Jenkins Windows Slave Node installation procedure completed.

    Troubleshooting: 
    You may sense to a greater extent than or less issues during service installation process.

    • If you lot ran into the same upshot spell installing jenkins slave service delight follow the steps.
    • Open ascendancy prompt every bit Administrator.




    • Change the directory (cd C:\Users\asingh\Desktop) to desktop Java shortcut.
    • Run the shortcut - It volition destination the installation. 
    • After jenkins Slave service successful installation, you lot volition encounter the slaves service inward services console.

    • Let's banking corporation fit Node condition inward the Master Jenkins
    • Login to Jenkins Master > Manage Jenkins > Manage Nodes


    Jenkins Slave Windows Node communication established. Now nosotros hit to setup Build amongst Windows Node.



    Part 2-  How to Setup Jenkins Project in addition to specify Windows Node to execute builds.







    Sumber https://linuxhowtoguide.blogspot.com/

    Minggu, 04 Februari 2018

    How To Delete Bash Ascendancy History Inwards Linux

    Bash History:- Bash history keeps the history of commands executed past times user inwards the final session. This allow us to re-use previous commands using up arrow key or nosotros tin run history command to cheque whole listing of commands.

    Generally, it's non required to delete whatever dominance from the history simply approximately fourth dimension nosotros bespeak to delete few commands.
    Example-  By mistake, In a dominance i cause got entered password inwards plainly text format in addition to I don't desire permit the history tape this password. In this instance i volition delete that dominance from the history.

    Let's cause got a await at dominance below.

    During MySQL connecter command, i mentioned password inwards command. equally inwards pic below.
    root@PVM-Linux-UDev: # history 

    Now, I desire to delete this dominance from the history list.

    Let's role below dominance to delete the specific dominance from the history.

    To delete unmarried dominance role next command.

    root@PVM-Linux-UDev: # history -d 2008


    In the higher upward dominance role dominance ID amongst history -d dominance .
    Let's confirm deleted entry using history command.
    root@PVM-Linux-UDev: # history 

    To clear entire dominance listing role next command.

    root@PVM-Linux-UDev: # history -c



    Using history -c command,  yous tin clear entire bash history. See inwards higher upward illustration cypher is there.
    Alternatively yous tin run below dominance to clear entire bash history.
    root@PVM-Linux-UDev: # cat /dev/null >  /.bash_history 

    Please note:- Generally, Normal user tin stance his ain bash history in addition to tin perform whatever activity over them. But root user in addition to stance anyone's bash history.



    Sumber https://linuxhowtoguide.blogspot.com/

    Kamis, 21 Desember 2017

    How To Buy The Farm Systems Inventory I.E. Ram, Disk, Cpu In Addition To Operating Systems Data Using Powershell Inward Domain.

    Every System Administrator needs to hold Server Inventory together with operate yesteryear on it update, So hither is an automated script to delineate all the information using Powershell script. 

    Let's re-create the script below together with salvage it equally Server_Inventory.PS1.
    If y'all convey few servers y'all tin dismiss define mention manually or y'all tin dismiss read northward release of the organisation from a file.   


    Create Pc.txt file equally inward below format

    Server1 Server2 Server2 

    Copy the Script together with Save as Server_Inventory.PS1.
    #Define Systems Name or y'all tin dismiss read them from a file using ascendancy (Get-Content -Path D:\pc.txt) $pc = (Get-Content D:\PC.txt) #change this path amongst your .txt file $infocoll = @() foreach ($PCS inward $pc) {         #Here We tin dismiss role multiple ascendancy to become the data          $hostname = (Get-WmiObject -Class win32_processor -ComputerName $PCS).systemname          $HDDInfo = Get-WmiObject -Class win32_diskdrive -ComputerName $PCS | Measure-Object -Property size -Sum | % { [math]::Round(($_.sum / 1GB ), 2) }         $RamInfo = Get-WmiObject -Class win32_physicalmemory -ComputerName $PCS | Measure-Object -Property Capacity -Sum | % {[math]::Round(($_.sum / 1GB), 2)}         $Cdrive = Get-WmiObject -Class win32_logicaldisk -ComputerName $PCS |   where deviceid -EQ 'C:'          $CDrivePercentuse= (($Cdrive).size -($Cdrive).freespace)*100/($Cdrive).size         $CpuInfo = (Get-WmiObject -Class win32_processor -ComputerName $PCS).Name         $OSInfo = (Get-WmiObject -Class win32_operatingsystem -ComputerName $PCS).Name                 foreach($CPU inward $hostname)         { $infoObject = New-Object PSObject         #Define the Value to each objet y'all desire to add together into the .CSV file.          Add-Member -InputObject $infoObject -MemberType NoteProperty -Name "ServerName" -Value $hostname         Add-Member -InputObject $infoObject -MemberType NoteProperty -Name "HDD SIZE inward GB" -Value $HDDInfo         Add-Member -InputObject $infoObject -MemberType NoteProperty -Name "C Drive Use IN %" -Value $CDrivePercentuse         Add-Member -InputObject $infoObject -MemberType NoteProperty -Name "CPU Detail" -Value $CpuInfo         Add-Member -InputObject $infoObject -MemberType NoteProperty -Name "RAM Detail inward GB" -Value $RamInfo         Add-Member -InputObject $infoObject -MemberType NoteProperty -Name "O.S Name" -Value $OSInfo                 $infoObject         $infocoll += $infoObject                  }     }  # Export all the information to a .CSV file together with shop the somewhere else y'all want.  $infocoll | Export-Csv -Path "D:\Serverinvt.csv" -NoTypeInformation  

    Run the Script together with y'all volition become output inward a CSV file equally inward the event below.




    Thank y'all All!!



    Sumber https://linuxhowtoguide.blogspot.com/