Publicado en Uncategorized

(LXDE) Indicador de Bateria

En particular sobre Debian based distributions.
Lo primero es instalar el paquete del repositorio:


sudo apt-get install fdpowermon

Una vez instalado lo agregaremos al autostart
sudo gedit /etc/xdg/lxsession/LXDE/autostart
y agregamos la siguiente línea
@fdpowermon

En caso de contar con un archivo de inicio local, a nivel usuario
gedit ~/.config/lxsession/LXDE/autostart
y agregamos ahí la línea mencionada anteriormente.

Hasta la próxima

Publicado en Uncategorized

-Instalar zoom Ubuntu 64 Bits

Hola nuevamente, esta vez vamos a contarles como instalar Zoom en Ubuntu al menos para versiones 1910 o 2004.

Primero lo descargamos desde: https://zoom.us/download#client_4meeting

o podemos hacerlo desde la terminal:

wget https://zoom.us/client/latest/zoom_amd64.deb

Luego tenemos que instalar las dependencias, en este caso:

sudo aptitude install libxcb-xtest0

y luego terminamos la instalación:

sudo dpkg -i zoom_amd64.deb

y lo ejecutamos:

zoom

Esto es todo y lo podemos usar en estas distros Debian-Based

Publicado en Windows

Get-SCVMMInventory – Get Inventory of all VM’s in SCVMM (2012 R2/2016 and more)

Entrada actualizada para agregar compatibilidad con SCVMM 2016

Credits are from https://vniklas.djungeln.se/2013/09/29/ Niklas AkerlundGet an inventory of all VM’s from System Center Virtual Machine Manager including the vCPU’s, memory, all VHD´s, IP addresses.  Report to CSV and HTML. Adapted to work with last actuallly SCVMM version 3.2.8224

__________________________

Créditos son de Niklas AkerlundGet https://vniklas.djungeln.se/2013/09/29/

Exportar un inventario de todas las VM’s es SCVMM. Se exporta a CSV y HTML, compatible con la 3.2.8224 /SCVMM 2016 y más.

Get an inventory of all VM’s from System Center Virtual Machine Manager including the vCPU’s, memory, up to 3 VHD´s, up to 4 interfaces and IP addresses.  Report to CSV and HTML. Adapted to work with SCVMM version 3.2.8224. and at least SCVMM 2016 UR7

Thanks to @leleco for the suggestions and collaboration improvements

Example:

Get-SCVMInventory -report

Give a reports for «All Hosts»

Get-SCVMInventory -VMHost SERVER01

Give data from SERVER01 Hyper-v Host.

Publicado también en https://gallery.technet.microsoft.com/scriptcenter/Get-SCVMMInventory-Get-053afdc1


function Get-SCVMInventory
{
    [CmdletBinding()]

    Param
    (

        $VMHostGroup = "All Hosts",
        [Parameter(ValueFromPipeline=$True)][Alias('ClusterName')]
        $VMHostCluster = $null,
        $VMHost = $null,
        [switch]$report,
        [string]$path =".\",
        [string]$CSVFile = "VMdata.csv",
        [string]$HTMLReport = "VMdata.html"
    )

    Begin
    {
        if(!(Get-Module virtualmachinemanager)){
            Import-Module Hyper-V
            Import-Module virtualmachinemanager
        }
        if(Get-SCVMMServer localhost | where ProductVersion -gt 3){
            $isR2 = $true
        }else{
            $isR2 = $false
        }
    }
    Process
    {
         if ($VMHostCluster -eq $null){
            if($VMHost -eq $null){
                $VMHosts = (Get-SCVMHostGroup -Name $VMhostGroup).AllChildHosts
            }else{
                $VMHosts = Get-SCVMHost $VMHost
            }
         }else{
            $VMHosts = (Get-SCVMHostCluster -Name $VMHostCluster).Nodes
         }
            $VMs = $VMHosts | Get-SCVirtualMachine
            $reportArray = @()
            foreach ($VM in $VMs){
                Write-Verbose $VM.Name
                    $vNics = $VM.VirtualNetworkAdapters
                    $VHDConf = $VM.VirtualHardDisks
                    $driveConf = $VM.VirtualDiskDrives
                    if(($vNics[0].IPv4Addresses -ne $null)){
                        Write-Verbose $vNics[0].IPv4Addresses[0]
                        $IPAddress1 = $vNics[0].IPv4Addresses[0]

                    }else{
                        if (!$isR2){
                            if(($vNics[0].IPv4Addresses -ne $null)){
                            $IPAddress1= (Hyper-V\Get-VMNetworkAdapter -ComputerName $VM.HostName -VMName $VM.Name).IPv4Addresses[0]
                            }else{
                                $IPAddress1 = "N/A"
                            }
                        }else{
                            Write-Verbose "NO IP"
                            $IPAddress1 = "N/A"
                        }
                    }
                    if(($vNics[1].IPv4Addresses -ne $null)){
                        Write-Verbose $vNics[1].IPv4Addresses[0]
                        $IPAddress2 = $vNics[1].IPv4Addresses[0]

                    }else{
                        if (!$isR2){
                            if(($vNics[1].IPv4Addresses -ne $null)){
                            $IPAddress2= (Hyper-V\Get-VMNetworkAdapter -ComputerName $VM.HostName -VMName $VM.Name).IPv4Addresses[0]
                            }else{
                                $IPAddress2 = "N/A"
                            }
                        }else{
                            Write-Verbose "NO IP"
                            $IPAddress2 = "N/A"
                        }
                    }
                    if(($vNics[2].IPv4Addresses -ne $null)){
                        Write-Verbose $vNics[2].IPv4Addresses[0]
                        $IPAddress3 = $vNics[2].IPv4Addresses[0]

                    }else{
                        if (!$isR2){
                            if(($vNics[2].IPv4Addresses -ne $null)){
                            $IPAddress3= (Hyper-V\Get-VMNetworkAdapter -ComputerName $VM.HostName -VMName $VM.Name).IPv4Addresses[0]
                            }else{
                                $IPAddress3 = "N/A"
                            }
                        }else{
                            Write-Verbose "NO IP"
                            $IPAddress3 = "N/A"
                        }
                    }
                    if(($vNics[3].IPv4Addresses -ne $null)){
                        Write-Verbose $vNics[3].IPv4Addresses[0]
                        $IPAddress4 = $vNics[3].IPv4Addresses[0]

                    }else{
                        if (!$isR2){
                            if(($vNics[3].IPv4Addresses -ne $null)){
                            $IPAddress4= (Hyper-V\Get-VMNetworkAdapter -ComputerName $VM.HostName -VMName $VM.Name).IPv4Addresses[0]
                            }else{
                                $IPAddress4 = "N/A"
                            }
                        }else{
                            Write-Verbose "NO IP"
                            $IPAddress4 = "N/A"
                        }
                    }
                    if($VM.VMCheckpoints){
                    $Snapshots = "Yes"
                    }else{
                    $Snapshots = "No"
                    }

                    $data = [ordered]@{
                    VMName = $VM.Name
                    vCPUs = $VM.CPUCount
                    
                    MemoryAssignedMB = $VM.MemoryAssignedMB
                    Status = $VM.Status
                    OperatingSystem = $VM.OperatingSystem
                    HostName = $VM.HostName
                     TotalSizeGB = $VM.TotalSize/1GB -as [int]
                    vNics = $vNics.Count                                                         
                    VirtualNetwork1 = $vNics[0].VirtualNetwork
                    MacAddressType1 = $vNics[0].MacAddressType
                    MacAddress1 = $vNics[0].MacAddress
                    VirtualNetworkAdapterType1 = $vNics[0].VirtualNetworkAdapterType
                    VLANEnabled1 = $vNics[0].VlanEnabled
                    VLanID1 = $vNics[0].VlanID 
                    IPAddress1 = $IPAddress1

                    VirtualNetwork2 = $vNics[1].VirtualNetwork
                    MacAddressType2 = $vNics[1].MacAddressType
                    MacAddress2 = $vNics[1].MacAddress
                    VirtualNetworkAdapterType2 = $vNics[1].VirtualNetworkAdapterType
                    VLANEnabled2 = $vNics[1].VlanEnabled
                    VLanID2 = $vNics[1].VlanID 
                    IPAddress2 = $IPAddress2

                    VirtualNetwork3 = $vNics[2].VirtualNetwork
                    MacAddressType3 = $vNics[2].MacAddressType
                    MacAddress3 = $vNics[2].MacAddress
                    VirtualNetworkAdapterType3 = $vNics[2].VirtualNetworkAdapterType
                    VLANEnabled3 = $vNics[2].VlanEnabled
                    VLanID3 = $vNics[2].VlanID 
                    IPAddress3 = $IPAddress3

                    VirtualNetwork4 = $vNics[3].VirtualNetwork
                    MacAddressType4 = $vNics[3].MacAddressType
                    MacAddress4 = $vNics[3].MacAddress
                    VirtualNetworkAdapterType4 = $vNics[3].VirtualNetworkAdapterType
                    VLANEnabled4 = $vNics[3].VlanEnabled
                    VLanID4 = $vNics[3].VlanID 
                    IPAddress4 = $IPAddress4

                    NumberofVHD = $VHDConf.Count
                    VHDName = $VHDConf[0].Name
                    VHDFormatType = $VHDconf[0].VHDFormatType
                    VHDType = $VHDconf[0].VHDType
                    VHDSize = $VHDconf[0].MaximumSize/1GB -as [int]
                    VHDCurrentSize = $VHDconf[0].Size/1GB -as [int]
                    VHDBusType = $driveConf[0].BusType
                    VHDBus = $driveConf[0].Bus
                    VHDLUN = $DriveConf[0].Lun
                    VHDDatastore = $VHDconf[0].Directory

                    VHDName2 = $VHDConf[1].Name
                    VHDFormatType2 = $VHDconf[1].VHDFormatType
                    VHDType2 = $VHDconf[1].VHDType
                    VHDSize2 = $VHDconf[1].MaximumSize/1GB -as [int]
                    VHDCurrentSize2 = $VHDconf[1].Size/1GB -as [int]
                    VHDBusType2 = $driveConf[1].BusType
                    VHDBus2 = $driveConf[1].Bus
                    VHDLUN2 = $DriveConf[1].Lun
                    VHDDatastore2 = $VHDconf[1].Directory

                    VHDName3 = $VHDConf[2].Name
                    VHDFormatType3 = $VHDconf[2].VHDFormatType
                    VHDType3 = $VHDconf[2].VHDType
                    VHDSize3 = $VHDconf[2].MaximumSize/1GB -as [int]
                    VHDCurrentSize3 = $VHDconf[2].Size/1GB -as [int]
                    VHDBusType3 = $driveConf[2].BusType
                    VHDBus3 = $driveConf[2].Bus
                    VHDLUN3 = $DriveConf[2].Lun
                    VHDDatastore3 = $VHDconf[2].Directory

                    StartMemoryGB = $VM.Memory/1024
                    DynamicMemory = $VM.DynamicMemoryEnabled
                    DynamicMemoryDemandMB = $VM.DynamicMemoryDemandMB
                    DynamicMemoryStatus = $VM.DynamicMemoryStatus -as [int]
                    DynamicMemoryMinMB = $VM.DynamicMemoryMinimumMB -as [int]
                    DynamicMemoryMaxGB = $VM.DynamicMemoryMaximumMB/1024 -as [int]
                    HasSnaphots = $Snapshots
                    Owner = $VM.Owner
                    Cloud = $VM.Cloud
                    CreationTime = $VM.CreationTime
                    HasVMAdditions = $VM.HasVMAdditions
                    VMAddition = $VM.VMAddition
                   
            }
            $obj= New-Object -TypeName PSObject -property $data
            $reportArray +=$obj 
            Write-Output $obj
            }

            if($report){
                # $reportArray
                $CSVReport = $path + $CSVFile
                $HTMLReport = $path + $HTMLReport
                $reportArray | Export-Csv -Path $CSVReport -NoTypeInformation -UseCulture
                $reportArray | ConvertTo-HTML | Out-File $HTMLReport
            }
    }
    End
    {
        # Should we clean anything?
    }
}
Publicado en Informatica, juegos, Linux, Ubuntu

Compiling QMC2 (Mame)

Ubuntu 17.04

svn co https://svn.code.sf.net/p/qmc2/code/trunk qmc2-svn

cd qmc2-svn/

make os-detect

sudo apt-get install libSDL1.2-dev libsdl2-dev

sudo dpkg-reconfigure dash

Choose No

sudo apt-get install libqtwebkit-dev

sudo apt-get install libphonon-dev

make

sudo make install

For Arcade

 

sudo apt-get install libqt4-opengl-dev libqt4-declarative-shaders libqt4-declarative-particles qtmobility-dev
make arcade DISTCFG=1
sudo make arcade-install DISTCFG=1

For CHDMAN

 

make qchdman DISTCFG=1

sudo make qchdman-install DISTCFG=1

Optionally convert & install the man-pages:

make man
sudo make man-install

http://wiki.batcom-it.net/index.php?title=The_%27ultimate%27_guide_to_QMC2#Building_and_installing_QMC2_from_source

Publicado en Windows

Add AD to Existent Domain – Powershell

To Add a Write Controller to an existing Domain, first add Domain Services

Add-WindowsFeature AD-Domain-Services

Then install Role:

Install-ADDSDomainController -CreateDnsDelegation:$false -DatabasePath 'D:\Windows\NTDS' -DomainName 'MyExistentDomain.local' -InstallDns:$true -LogPath 'D:\Windows\NTDS' -NoGlobalCatalog:$false -SiteName 'MySite' -SysvolPath 'D:\Windows\SYSVOL' -NoRebootOnCompletion:$true -Force:$true -Credential (Get-Credential MyExistentDomain\AdminUser)

 

Thanks to Mike Robbins http://mikefrobbins.com/2013/03/14/use-powershell-to-add-an-additional-domain-controller-to-an-existing-windows-server-2012-active-directory-domain/

Publicado en Windows

Enable RDP Powershell Windows 2016

Only is needed three comands to enable RDP in powershell

New-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name 'fDenyTSConnections' -Value 0 -PropertyType dword -Force

To Enable RDP

 

New-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name 'UserAuthentication' -Value 1 -PropertyType dword -Force

 

To Enable NLA

 

Enable-NetFirewallRule -DisplayGroup 'Remote Desktop'

 

To Enable on Firewall

 

 

 

 

Publicado en Ubuntu, Uncategorized

Linux Server Daily Reboot

Schedule a daily reboot with cron

Type:

sudo crontab -e
[sudo] password for user:
no crontab for root - using an empty one

Select an editor. To change later, run 'select-editor'.
 1. /bin/nano <---- easiest
 2. /usr/bin/vim.tiny

Choose 1-2 [1]:
crontab: installing new crontab

Add:

# m h dom mon dow command
40 1 * * * /sbin/reboot

In this case Every Day at 01:40 AM

Thanks to https://stackoverflow.com/questions/15393875/using-cron-to-reboot

Publicado en Ubuntu

Add Tomcat as Service Linux (Systemd)

Create file tomcat-systemd on  /etc/systemd/system/tomcat-systemd.service

nano /etc/systemd/system/tomcat-systemd.servicee

 

# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target

[Service]
Type=forking

Environment=JAVA_HOME=/opt/tomcat/jdk1.8.0_121
Environment=CATALINA_PID=/opt/tomcat/apache-tomcat-7.0.75/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat/apache-tomcat-7.0.75/
Environment=CATALINE_BASE=/opt/tomcat/apache-tomcat-7.0.75/
Environment='CATALINE_OPTS=-Xms1G -Xmx1G -Djava.net.preferIPv4Stack=true'
Environment='JAVA_OPTS=-Djava.awt.haedless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/apache-tomcat-7.0.75/bin/startup.sh
ExecStop=/opt/tomcat/apache-tomcat-7.0.75/bin/shutdown.sh
#ExecStop=/bin/kill -15 $MAINPID

User=tomcat
Group=tomcat

[Install]
WantedBy=multi-user.target

Enable and start service

systemctl enable tomcat-systemd.service
systemctl start tomcat-systemd.service

We can test OK with:

ps -ef |grep java
systemctl status tomcat-systemd.service

Thanks to https://gist.github.com/obatiuk/15c84fb25826d4f39a303a454087e85a for systemd Script.

Publicado en HyperV, Seguridad, Ubuntu, Windows

How to configure iLO from command line (HPe)

Si nos encontramos que tenemos que reconfigurar la IP de la placa ILO (OOB para HP) y no tenemos acceso desde esa LAN por algun motivo, podemos:

Teniendo instalado «HP Lights-Out Online» incluído en el «Service Pack for ProLiant»

 

Goto C:\Program Files\HP\hponcfg> or %ProgramFile%\HP\hponcfg

 

Then type:

hponcfg /w ilo.xml

this dumps iLO configuration into ilo.xml file

<RIBCL VERSION=”2.0″>
<LOGIN USER_LOGIN=”user” PASSWORD=”password”>
<RIB_INFO MODE=”WRITE” >
<MOD_NETWORK_SETTINGS>
<IP_ADDRESS VALUE = “x.x.x.x”/>
<SUBNET_MASK VALUE = “x.x.x.x”/>
<GATEWAY_IP_ADDRESS VALUE = “x.x.x.x”/>
<PRIM_DNS_SERVER value = “x.x.x.x”/>
<DHCP_ENABLE VALUE = “N”/>
</MOD_NETWORK_SETTINGS>
</RIB_INFO>
</LOGIN>
</RIBCL>

NOTE: The USER_LOGIN and PASSWORD tags are required, and must contain data, although any data is accepted.

 

Change IP related values and:

hponcfg /f ilo.xml

this writes new configuration back to the iLO and voilá.

 

Based on  Scripting Toolkit for Windows – Using HPONCFG also available on Linux.

 

Thanks to https://srvops.wordpress.com/2012/02/13/how-to-configure-ilo-from-command-line/