Tuesday, October 13, 2015

jenkins

1. View available environment variables in Jenkins Slave machine" In any jenkins job, click on 'Add Pre-build step' and choose either 'Execute Windows Batch Command' or 'Execute Shell' This will show a text box to enter the batch/shell command and beneath this box, there will be link displayed as See the list of available environment variables All multiple triggering of the same job while it is still running Select check box -Concurrent Job


Saturday, October 10, 2015

Linux Commands

1 MOUNT A DOS PARTITION
$sudo fdisk -l               -shows all partitions
$sudo mount /dev/sda9 /mnt/DATA1  -mount partition sda9 as noted from fdisk -l to the directory /mnt/DATA1 which is already created

2 UNMOUNT
$sudo unmount /mnt/DATA1

3 VIEW ALL MOUNTED PARTITIONS
$cat /etc/mtab

4 CHANGE DEFAULT BOOT OS in GRUB2
$gksudo gedit /etc/default/grub
modify GRUB_DEFAULT=<> and save the file
$sudo update-grub

5 MOUNT A .ISO FILE
$sudo mkdir /mnt/iso
$sudo mount -o loop //.iso /mnt/iso

...

$sudo umount /mnt/iso


6. ADD A GRUB ENTRY IN BOOT MENU TO BOOT A .ISO FILE IN HARD DISK
PRE-REQUISITE:
i. GRUB IS ALREADY INSTALLED
ii. Any version of UBUNTU/MINT LINUX already installed

a. Boot into Linux an open a terminal
b. $gksudo gedit /etc/grub.d/40_CUSTOM
   append the following lines 

menuentry "Ubuntu 12.04 ISO" {
 Set isofile="/downloads/ubuntu/ubuntu-12.4-desktop-i386.iso"
loopback loop (hd0,msdos9)$isofile
      |
      |--> equivalent to sda9 partition

linux (loop)/casper/vmlinux boot=casper iso-scan/filename=$isofile noprompt noeject
initrd (loop)/casper/initrd.lz
}

b. save 40_custom file
$sudo update-grub

when you boot now, this 40_CUSTOM menu should be available in GRUB menu

7. TO BOOT FROM AN UBUNTU .ISO FILE IN HARD DISK WITHOUT ADDING AN ENTRY IN GRUB 
a. Reboot machine and press C in GRUB menu page
b. grub> ls  <-- know the partitions available
c. ls (hd1,mdos9)       <-- check label to confirm the partition
                            that has to the .iso file to boot
d. ls (hd1,msdos9)/ press tab <-- all files are displayed
                                  locate the .iso file
e. run each line from line 35 above (containing Set isofile="/down.." with this file path 
   If no messages are displayed on entering the command, then it means the command ran successfully
f. grub> boot


 ---------------
Add system wide PATH  and environment vars
-------------------------------------------------
open terminal
$ su 
add new file myenvvars.sh in /etc/profiled/ 
(eg. if you want to add jdk and maven path add below) after restart this works

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_77
export M2_HOME=/opt/apache-maven-3.3.9
export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH


-----------
Set bash in vi mode (by default it will be in Emacs key shortcut mode
$ set -o vi 



Citrix on Linux Mint

1. download citrix receiver icaclient_13.2.1.328635_amd64.deb from Citrix download site and install it http://downloads.citrix.com/10837/icaclient_13.2.1.328635_amd64.deb?__gda__=1444457994_9d824d09e2f16b2db01f4c7986f5e48d
2. Trying to connect to VDI throws error "You have not chosen to trust “AddTrust External CA Root”, the issuer of the server’s security certificate." - http://ubuntuforums.org/showthread.php?t=1975705 sudo ln -s /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacerts http://discussions.citrix.com/topic/249493-exit-full-screen-with-citrix-receiver-on-linux-ubuntu-9/ Citrix on Linux
3. Switch back to Linux Host from Citrix VDI. Press Ctrl + F2 and then Windows Key/SUPER KEY. User arrow keys to navigate menu and open any app (DO NOT USE MOUSE TO CLICK on Linux Task - it doesn't work)