Copy files from Linux to Windows using pscp

Google pscp and download it, save it so a directory i.e c:\utils\ Also create a directory on C where you want to save your restored files, i.e c:\restoredfiles

open a command prompt and type
[su_note]pscp username@hostname(or IP):/home/remoteusername/sampledir/* c:\restorefiles\ [/su_note]


Puppet, puppet server, vagrant and virtual box

1.- Download Vagrant

2.- Create a directory in your home directory, i.e vagrantfiles

3.- Create a vagrant file inside your new directory
[su_note]vagrant init[/su_note]

4.- edit Vagrantfile to match the following,
MEMORY = “1024”
CPUS = “1”
Vagrant.configure(“2”) do |config| = “centos/7”
config.vm.hostname = “master.puppet.vm”

config.vm.provider “virtualbox” do |vb| = “master.puppet.vm”
vb.memory = MEMORY
vb.cpus = CPUS

5.- On same directory where you have the Vagrant file, use [su_note]vagrant up [/su_note]to provision a new VM

6.- connect to the new vm
[su_note]vagrant ssh[/su_note]
Not required but run all commands as root,
[su_note]sudo su -[/su_note]

7.- Install Puppet, nano and git
rpm -Uvh

yum install -y puppetserver nano git
For Ubuntu 16.04 Xenial
sudo dpkg -i puppet5-release-xenial.deb
sudo apt update
For Ubuntu 14.04 Trusty
sudo dpkg -i puppet5-release-trusty.deb
sudo apt-get update

8. Edit . memory allocation
For Centos 7, the config file for puppetserver is located in:
[su_note]nano /etc/sysconfig/puppetserver [/su_note]
For Ubuntu 1604, the config file for puppetserver is located in:
[su_note]nano /etc/default/puppetserver [/su_note]
Edit 2g to 512mb
[su_note]#JAVA_ARGS=”-Xms2g -Xmx2g -Djruby.logger.class=com.puppetlabs.jruby_utils.jruby.Slf4jLogge$

JAVA_ARGS=”-Xms512m -Xmx512m -Djruby.logger.class=com.puppetlabs.jruby_utils.jruby.Slf4j$

9.- start the puppet service and enable service at boot
systemctl start puppetserver
systemctl enable puppetserver

Configure Puppet agent on server:

1.- edit puppet config and point the server to itself
nano /etc/puppetlabs/puppet/puppet.conf
server = master.puppet.vm

2.- Edit .bash_profile to allow using Ruby that’s installed with puppet
For Centos 7, edit the .bash_profile
nano .bash_profile
Replace the path to:

For Ubuntu 16.04,
export PATH=${PATH}:/opt/puppetlabs/puppet/bin

To make it permanent, Ubuntu 16.04. Add the following at the end of .bashrc
export PATH=${PATH}:/opt/puppetlabs/puppet/bin

3.- run source bash profile to make the changes active
For Centos 7
[su_note] source .bash_profile [/su_note]

For Ubuntu 16.04,
[su_note] source .profile [/su_note]

4.- Test it by running [su_note]gem [/su_note]
5.- Install r10k using gem
[su_note]gem install r10k[/su_note]

6.- Test: [su_note] puppet agent -t[/su_note]


Configure r10k to connect to github
1.- Create the directory:
[su_note]mkdir /etc/puppetlabs/r10k[/su_note]

2.- configure the yaml file
[su_note]nano /etc/puppetlabs/r10k/r10k.yaml [/su_note]


:cachedir: <space>’/var/cache/r10k’

<space> :my-org:
<space><space> remote: <space>’’
<space><space> basedir: <space>’/etc/puppetlabs/code/environments’

[su_note] r10k deploy environment -p[/su_note]
If you get an error with your yaml file,  go to to validate your yaml code then copy and paste the validated code into r10k.yaml



Virtual box: share folders between Windows host and Ubuntu guests

Virtual box ver: 5.22

Create a folder in windows, i.e c:\shared
Open virtualbox.
Select your guest OS, i.e Ubuntu
Click settings
click Shared Folders, and add c:\shared  (enable auto mount)
Click OK
Start your guest OS (Ubuntu)
Login to your guest OS
Click Devices, click “Insert Guest Additions CD image…”
If the installation fails, install linux-headers with the following command
[su_note] sudo apt-get install linux-headers-$(uname -r) [/su_note]
Try again, click Devices,  “Insert Guest Additions CD image…”

Now check what shares are available.
[su_note] sudo VBoxControl sharedfolder list [/su_note]
You should see:
[su_note] 1. shared [/su_note]

Mount it:
First create a folder on your linux host, i.e mkdir  winfolder
then mount it.
[su_note] sudo mount -t vboxsf shared  ~/winfolder [/su_note]


a start job is running for raise network interfaces

1.- edit, then reboot
[su_note]  /etc/systemd/system/network-online.targets.wants/networking.service [/su_note]
change timeout from 5 min to 1min
[su_note] TimeoutStartSec=5min [/su_note]