Code Snippet

Just another Code Snippet site

Random Post :




[ESX] vSphere CLI

Install CLI (with internet access) : https://pubs.vmware.com/vsphere-60/index.jsp?topic=%2Fcom.vmware.vcli.getstart.doc%2Fcli_install.4.5.html
without internet access : https://pubs.vmware.com/vsphere-60/index.jsp?topic=%2Fcom.vmware.vcli.getstart.doc%2Fcli_install.4.4.html

Pre requisite :

yum install e2fsprogs-devel libuuid-devel glibc.i686 perl-XML-LibXML

DL VMware-vSphere-CLI-6.X.X-XXXXX.XXXX.x86_64.tar.gz from VM Ware siteUnzip the installer :

tar –zxvf VMware-vSphere-CLI-6.X.X-XXXXX.XXXX.x86_64.tar.gz

Execute the installer :

cd vmware-vsphere-cli-distrib
./vmware-install.pl

Connect to the vSphere server

esxcli --server <ESXI_HOSTNAME_OR_IP> --username <MY_USERNAME> --password <MY_PASSWORD>

[How-To] curl

cURL HTTPS with client certificate :

curl --key ./mykey.key --cert ./mycert.pem -H "X-Requested-With:curl" -v https://target.com

-k to avoid Server certificate check

Send data using curl

curl -X POST "https://target" --data "user_id=2&group=3"

,

[VirtualBox] Start/Stop VM Headless

Windows Env :

Start :

./VBoxHeadless.exe -startvm "<VM_name>"

Stop (Shutdown ACPI)

VBoxManage controlvm "<VM_name>" acpipowerbutton 

Stop (Save State)

VBoxManage controlvm "<VM_name>" savestate 

,

[SVN] Create new repo

Create repo :

svnadmin create --fs-type fsfs /home/svn/REPO

Change permission :

chown -R www-data:subversion /home/svn/REPO
chmod -R 770 /home/svn/REPO

Restart SVN :

/etc/init.d/svnserve restart

Update WebSVN file :

/etc/apache2/mods-enabled/dav_svn.conf

Add :

                <Location /REPO>
                  DAV svn
                  SVNPath /home/svn/REPO
                  AuthType Basic
                  AuthName "Subversion Repository"
                  AuthUserFile /etc/apache2/dav_svn.passwd
                  Require valid-user
                  SSLRequireSSL
                </Location>

[Oracle] UNDO tablespace

Create new TBS :

create undo tablespace UNDO_RBS1 datafile '/path/to/file.dbf' size 1000m AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED;

Set as default undo tablespace :

alter system set undo_tablespace=undo_rbs1;

Retrieve the old one

SELECT tablespace_name, file_name FROM dba_data_files WHERE tablespace_name like 'UNDO%';

Drop it

drop tablespace XXX;

or :

DROP TABLESPACE XXX INCLUDING CONTENTS AND DATAFILES;

,

Previous Posts Next posts