Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Jun 1, 2022

Basic Jenkins Setup

  1. Download the Jenkins war (LTS) file from https://www.jenkins.io/download/
  2. Setup JDK 11+ and set java to the path environment variable.
  3. Set JENKINS_HOME to any directory
  4. Run >java -jar jenkins.war
  5. Access Jenkins Server @ http://localhost:8080

  6. Provide Administrator password, generated at highlight path above.
  7. Proceed with 'Install suggested plugins.

Steps to open firewall port to access Jenkins server.
YOURPORT=8080
PERM="--permanent"
SERV="$PERM --service=jenkins"

firewall-cmd $PERM --new-service=jenkins
firewall-cmd $SERV --set-short="Jenkins ports"
firewall-cmd $SERV --set-description="Jenkins port exceptions"
firewall-cmd $SERV --add-port=$YOURPORT/tcp
firewall-cmd $PERM --add-service=jenkins
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload

Oct 13, 2020

Running VNC Server on OCI Linux 7

 Step 1: Install the GUI server

$ sudo yum group install "Server with GUI" -y

Step 2: Install VNC Server

$ sudo yum install tigervnc-server tigervnc-server-module -y

Step 3: Create a password for vncserver

$ vncpasswd

Step 4: Copy vncserver@.service to /etc/systemd/system/

$ sudo cp /usr/lib/systemd/system/vncserver@.service /etc/systemd/system/. 

Step 5: Edit /etc/systemd/system/vncserver@.service for Linux user.

$ sudo vi /etc/systemd/system/vncserver@.service

Search for below line and replace <USER> with opc as mentioned 
ExecStart=/usr/bin/vncserver_wrapper opc %i -geometry 1366x768

Step 6: Starting VNC Server

$ sudo systemctl daemon-reload

$ sudo systemctl start vncserver@:1.service (Here :1 is the port of vncserver)

$ sudo systemctl enable vncserver@:1.service

$ sudo systemctl status vncserver@:1.service

 Step 7: Tunneling VNC server port onto localhost (use Git Bash, in case of Windows OS)

$ ssh -v -C -L 5901:localhost:5901 opc@<public_ip> -i <private_key>

Step 8: Connect to VNC session using "localhost:5901"


// We can also access the VNC session directly, by opening 5901 open in Linux firewall. 

Step 7a: Open port '5901' in the firewall configuration.

$ sudo firewall-cmd --zone=public --permanent --add-port=5901/tcp

$ sudo firewall-cmd --reload 

 


 

Sep 27, 2015

Setting up 'yum' in Oracle Linux 6

https://blogs.oracle.com/wim/entry/setting_up_oracle_linux_6

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-ol6.repo

Jan 28, 2015

Weblogic command-line deployment

Weblogic command-line deployment in Linux with Java

1. Set java to PATH
2. Go to $WLS_HOME/server/bin
3. perform ". setWLSEnv.sh" - to set weblogic jars to classpath.
4. perform "echo $CLASSPATH" to check whether jars are properly set to classpath.
5. java weblogic.Deployer -adminurl http://: -username -password -deploy -name -source -targets -securityModel -plan

eg: java weblogic.Deployer -adminurl http://192.168.0.2:7001 -username weblogic -password weblogic1 -deploy -name HelloWorld -source /opt/sureshba/HelloWorld.ear -targets AdminServer -securityModel CustomRoles -plan /opt/sureshba/plan/HelloWorld.xml

For more info: http://docs.oracle.com/cd/E13222_01/wls/docs90/deployment/wldeployer.html


Oct 28, 2014

Reset forgotten/lost main user password in Linux

You can reset your password following the next steps:
  1. Reboot your computer / Turn your computer on.
  2. Hold down the Shift key at the start of the boot process to enable the GNU GRUB boot menu (if it does not show)
  3. Press ESC at the GNU GRUB prompt.
  4. Press e for edit.
  5. Use the Arrow keys to highlight the line that begins with kernel and press the e key.
  6. Go to the very end of the line and add rw init=/bin/bash
  7. Press Enter and then press b to boot your system.
  8. Your system will boot up to a passwordless root shell.
  9. Type in passwd yourusername
  10. Set your new password.
  11. Restart your system.
Note:- Above steps only work with Linux installed with 'grub'

Source:http://community.linuxmint.com/tutorial/view/339

Feb 21, 2014

Linux disk sharing.


-->
Disk sharing between two Linux systems:-

Machine1:-
  1. Find the folder/directory you want to share (eg: /opt/directory)
  2. Add this directory in /etc/exports (need root permission) as mentioned
    • /opt/directory *(rw)
    • Format: directory machine1(option11,option12)
      • directory - the directory that you want to share. It may be an entire volume though it need not be. If you share a directory, then all directories under it within the same file system will be shared as well.
      • machine1 - client machines that will have access to the directory. The machines may be listed by their DNS address or their IP address (e.g., machine.company.com or 192.168.0.8). Using IP addresses is more reliable and more secure.
      • optionxx
        the option listing for each machine will describe what kind of access that machine will have. Important options are:
        • ro: The directory is shared read only; the client machine will not be able to write to it. This is the default.
        • rw: The client machine will have read and write access to the directory.
        • no_root_squash: By default, any file request made by user root on the client machine is treated as if it is made by user nobody on the server. (Excatly which UID the request is mapped to depends on the UID of user "nobody" on the server, not the client.) If no_root_squash is selected, then root on the client machine will have the same level of access to the files on the system as root on the server. This can have serious security implications, although it may be necessary if you want to perform any administrative work on the client machine that involves the exported directories. You should not specify this option without a good reason.
        • no_subtree_check: If only part of a volume is exported, a routine called subtree checking verifies that a file that is requested from the client is in the appropriate part of the volume. If the entire volume is exported, disabling this check will speed up transfers.
        • sync: By default, all but the most recent version (version 1.11) of the exportfs command will use async behavior, telling a client machine that a file write is complete - that is, has been written to stable storage - when NFS has finished handing the write over to the filesysytem. This behavior may cause data corruption if the server reboots, and the sync option prevents this.
  3. Run /etc/init.d/nfs restart

Machine 2:-
  1. mkdir /opt/directory (any other directory also fine.)
  2. mount machine1.hostname:/opt/directory /opt/directory or
  3. Add “machine1.hostname:/opt/directory /opt/directory nfs auto 0 0” to your /etc/fstab file.

Feb 20, 2014

How to install Open Office in Oracle Enterprise Linux?

1. Use below yum command:
sudo yum -y install openoffice.org*

2. Download rpm file from http://sourceforge.net/projects/openofficeorg.mirror/files/4.0.1/binaries/en-US/Apache_OpenOffice_4.0.1_Linux_x86-64_install-rpm_en-US.tar.gz/download
and follow the instructions mentioned @ http://www.openoffice.org/download/common/instructions.html#linux-rpm
Another download link http://www.openoffice.org/download/other.html with language specific installers.

Oct 7, 2009

Steps to Increase ulimit

Steps to Increase ulimit for RedHat Linux

for more info about ulimit:- http://uw713doc.sco.com/en/man/html.1/ulimit.1.html

Add below line to /etc/profile
ulimit -n 10000

Add below lines to /etc/security/limits.conf
GUID  hard    nofile  10000
GUID  hard    nofile  10000

& Restart the system.