working on it ...


Explore Public Snippets

Sort by

Found 12 snippets matching: "hardware information"

    public by p.kontalis  3286  1  5  0

    Retrieve System Characteristics

    Windows System Information Function
    Public Function RetrievePCInfo() As DataTable
        Dim DT As New DataTable
        Dim search3 As New ManagementObjectSearcher("SELECT * FROM meta_class")
        Dim info3 As New ManagementObject
        For Each info3 In search3.Get
            Dim search4 As New ManagementObjectSearcher("SELECT * FROM " & info3("__CLASS").ToString)
            Dim Squerysearch4 As String = search4.Query.QueryString.ToString
            Dim info4 As New ManagementObject
            For Each info4 In search4.Get
                For Each Prop As PropertyData In info4.Properties
                    DT.Rows.Add(info3("__CLASS").ToString, Prop.Name, Prop.Value)
        Return DT
    End Function
    ' Beware this of code requires a large amount of RAM.
    ' Recommended to Extract all classes first and then for each class retieve the values.
    ' info class from motherboard is Win32_Bios
    ' info class from CPU is Win32_Prosessor

    external by valenz  2404  3  4  0

    Get computer system and hardware information

    Get computer system and hardware information: system.ps1
    # thx@thommck (twitter)
    # Local System Information v3
    # Shows details of currently running PC
    # Thom McKiernan 11/09/2014
    $computerSystem = Get-CimInstance CIM_ComputerSystem
    $computerBIOS = Get-CimInstance CIM_BIOSElement
    $computerOS = Get-CimInstance CIM_OperatingSystem
    $computerCPU = Get-CimInstance CIM_Processor
    $computerHDD = Get-CimInstance Win32_LogicalDisk -Filter "DeviceID = 'C:'"
    Write-Host "System Information for: " $computerSystem.Name -BackgroundColor DarkCyan
    "Manufacturer: " + $computerSystem.Manufacturer
    "Model: " + $computerSystem.Model
    "Serial Number: " + $computerBIOS.SerialNumber
    "CPU: " + $computerCPU.Name
    "HDD Capacity: "  + "{0:N2}" -f ($computerHDD.Size/1GB) + "GB"
    "HDD Space: " + "{0:P2}" -f ($computerHDD.FreeSpace/$computerHDD.Size) + " Free (" + "{0:N2}" -f ($computerHDD.FreeSpace/1GB) + "GB)"
    "RAM: " + "{0:N2}" -f ($computerSystem.TotalPhysicalMemory/1GB) + "GB"
    "Operating System: " + $computerOS.caption + ", Service Pack: " + $computerOS.ServicePackMajorVersion
    "User logged In: " + $computerSystem.UserName
    "Last Reboot: " + $computerOS.LastBootUpTime

    external by dungmanh88  22  0  1  0

    Get hardware information

    Get hardware information: Get hardware information
    dmidecode -t processor | grep -i version
    dmidecode -t process | grep -i cache
    dmidecode -t processor  | grep -i count
    dmidecode -t processor  | grep -i capable
    uname -r
    cat /etc/issue
    cat /etc/redhat-*
    free -m
    dmidecode -t memory | grep -i "Number of devices"
    dmidecode -t memory | grep -i "Maximum"
    dmidecode -t memory | grep -i "Manufacturer"
    dmidecode -t memory | grep -i "size"
    dmidecode -t memory | grep -i "speed"
    dmidecode -t memory | grep -i "Interleaved Data Depth"
    dmidecode -t memory | grep -i "Part"
    cat /proc/meminfo  | grep -i slab
    dmidecode -t baseboard
    fdisk -l
    df -Th
    lspci | egrep -i 'network|ethernet'
    ethtool eth0
    lspci | grep -i raid
    lshw -class storage
    lshw -class network
    cat /proc/mdstat

    external by RobotRebels  196  0  2  0

    Snippets for getting device hardware information

    Snippets for getting device hardware information: Hardware.swift
    func coresNum() -> UInt {
      var ncpu: UInt = 0
      var len = sizeof(UInt)
      sysctlbyname ("hw.ncpu", &ncpu, &len, nil, 0);
      return ncpu
    func platform() -> String {
      var size: Int = 0
      sysctlbyname("hw.ncpu", nil, &size, nil, 0)
      var machine = [CChar](count: Int(size), repeatedValue: 0)
      sysctlbyname("hw.ncpu", &machine, &size, nil, 0)
      if let res = String.fromCString(machine) {
        return res
      } else {
        return "Can't detect platform"

    external by CMCDragonkai  184  0  2  0

    CLI: Detect Hardware Information (dmidecode)

    CLI: Detect Hardware Information (dmidecode):
    Detect Hardware Information
    Not all hardware information is accessible through the operating system. But the 
    ones that are, are exposed through the `dmidecode` command:
    > dmidecode --string='bios-vendor'
    > dmidecode --string='bios-version'
    1.03.15EC v2
    > dmidecode --string='system-manufacturer'
    > dmidecode --string='system-product-name'
    P7 Pro SE
    > dmidecode --string='system-version'
    Not Applicable
    > dmidecode --string='baseboard-manufacturer'
    > dmidecode --string='baseboard-product-name'
    powered by
    > sudo dmidecode --string='chassis-manufacturer'
    > sudo dmidecode --string='chassis-version'  
    > sudo dmidecode --string='chassis-serial-number'
    > sudo dmidecode --string='chassis-asset-tag'
    No Asset Tag
    > sudo dmidecode --string='processor-family'
    > sudo dmidecode --string='processor-manufacturer'
    > sudo dmidecode --string='processor-version'
    Intel(R) Xeon(R) CPU E3-1241 v3 @ 3.50GHz
    > sudo dmidecode --string='processor-frequency'
    3500 MHz
    Would be great to have a database of hardware to correlate.

    external by cspolecat  148  0  2  0

    Get device hardware information at runtime

    Get device hardware information at runtime:
    import android.content.Context;
    import android.os.Build;
    import android.telephony.TelephonyManager;
    import android.util.DisplayMetrics;
    import android.view.WindowManager;
    public class DeviceHelper {
        public static int getNetwork(Context context) {
            ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo info = cm.getActiveNetworkInfo();
            if (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_WIFI) {
                return 1;
            TelephonyManager mTelephonyManager = (TelephonyManager)
            int networkType = mTelephonyManager.getNetworkType();
            switch (networkType) {
                case TelephonyManager.NETWORK_TYPE_GPRS:
                case TelephonyManager.NETWORK_TYPE_EDGE:
                case TelephonyManager.NETWORK_TYPE_CDMA:
                case TelephonyManager.NETWORK_TYPE_1xRTT:
                case TelephonyManager.NETWORK_TYPE_IDEN:
                    return 2;
                case TelephonyManager.NETWORK_TYPE_UMTS:
                case TelephonyManager.NETWORK_TYPE_EVDO_0:
                case TelephonyManager.NETWORK_TYPE_EVDO_A:
                case TelephonyManager.NETWORK_TYPE_HSDPA:
                case TelephonyManager.NETWORK_TYPE_HSUPA:
                case TelephonyManager.NETWORK_TYPE_HSPA:
                case TelephonyManager.NETWORK_TYPE_EVDO_B:
                case TelephonyManager.NETWORK_TYPE_EHRPD:
                case TelephonyManager.NETWORK_TYPE_HSPAP:
                    return 3;
                case TelephonyManager.NETWORK_TYPE_LTE:
                    return 4;
                    return 6;
        public static String getDisplayResolution(Context context) {
            WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
            DisplayMetrics displaymetrics = new DisplayMetrics();
            int height = displaymetrics.heightPixels;
            int width = displaymetrics.widthPixels;
            return height + "×" + width;
        public static String getBrand() {
            return Build.MANUFACTURER + " " + Build.BRAND + " " + Build.MODEL;
        public static String getIMEI(Context context) {
            TelephonyManager telephonyManager = (TelephonyManager)
            return telephonyManager.getDeviceId();
         * Check if the CPU architecture is X64
         * @return
        public static boolean isX64() {
            String arch = System.getProperty("os.arch").toLowerCase();
            return arch.contains("64");
         * Check the application is installed or not
         * @param context
         * @param packageName the application package name
         * @return
        public static boolean isPackageInstalled(Context context, String packageName) {
            PackageManager pm = context.getPackageManager();
            try {
                pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
                return true;
            } catch (PackageManager.NameNotFoundException e) {
                return false;

    external by kisski  82  0  1  0

    Hardware information linux

    Hardware information linux: gistfile1.txt
    #show hardware information
    sudo lshw -html > ~/hardware_info.html && google-chrome ~/hardware_info.html

    external by Github  69  0  1  0

    Emc 5700 hardware information guide

    Emc 5700 hardware information guide: Emc 5700 hardware information
    <br><br><br><center><b>File: <u><a href="" target="_blank" rel="nofollow">Download Emc 5700 hardware information guide</a></u></b><br><br></center><br><br><p>emc vnxe3200 administration guide<br> vnx5200 cabling guide<br> emc vnxe3200 installation guide<br> emc vnxe3200 manual<br> vnxe3150 hardware information guide<br> vnxe3200 admin guide<br> vnx5200 hardware information guide<br> vnxe3200 hardware information guide<br> <br> <br> </p><p>&nbsp;</p><p>&nbsp;</p><p>26 Oct 2014 Downloading the VNX5700 Hardware Information Guide c. Completing the VNX Unified worksheets d. Reviewing the resource requirements EMC believes the information in this course is accurate as of its publication date. It is based on Hardware. This module introduces the VNX unified platform hardware. .. This concludes the instruction; proceed to the course assessment. 25 Jun 2012 This guide describes one of five models available in the VNX Series, the EMC®. VNX5300™. This document provides an overview of the 27 Jun 2012 VNX Hardware Parts heading, click on the desired guide. . information about EMC products, licensing, and service, go to the EMC online 25 Jun 2012 This guide describes one of five models available in the VNX Series, the EMC®. VNX5500™. This document provides an overview of the 6 Aug 2012 EMC? VNX5300? Hardware Information Guide The EMC VNX series implements a modular architecture that integrates hardware components Hardware Information Guide REV A03 October, 2011. This guide describes one of five models available in the VNX Series, the EMC® VNX5700™. download and review the VNX5700 Hardware. Information Guide before you begin the installation. Go to and select VNX Series. 28 Mar 2016 Select the EMC®. VNXe® VNXe3200 Hardware Information Guide from this list. This guide and other related. VNXe Series guides can be synopsis. The following is a simple document providing information and background on a number of configuration guidelines specific to EMC's VNX5700 (Block)     </p><br><a href="">Nigeria airways flight 2120 report shoes</a>, <a href="">Uso del commando usermod example</a>, <a href="">Solognote restaurant guide</a>, <a href="">Six thinking hats example questions on lsat</a>, <a href="">Solucionar problema operation 7 error report</a>. 

    external by Marcos Vinícius Rodrigues  59  0  1  0

    Get hardware informations for OS X

    Get hardware informations for OS X:
    import commands, json, os
    data = []
    gpus = {}
    data_info = commands.getstatusoutput('{ system_profiler SPDisplaysDataType ; sw_vers ; system_profiler SPHardwareDataType ; }')[1].splitlines()
    nome = os.environ['USER']
    owner = filter(None, [line.split(':')[1].strip() if 'Model Name' in line else None for line in data_info])[0]+' de '+nome
    for i in range(len(data_info)):
    	if 'Model Name' in data_info[i]:
    	if 'ProductVersion' in data_info[i]:
    	if 'Processor Name' in data_info[i]:
    	if 'Processor Speed' in data_info[i]:
    	if 'Number of Processors' in data_info[i]:
    	if 'Total Number of Cores' in data_info[i]:
    	if 'L3 Cache' in data_info[i]:
    	if 'Memory' in data_info[i]:
    	if 'Chipset Model' in data_info[i]:
    		line_id = i
    	if 'VRAM' in data_info[i]:
    		gpus[data_info[line_id].split(':')[1].strip()] = data_info[i].split(':')[1].strip()
    json.dump({owner:data}, open('my_mac_info.json', 'w'), ensure_ascii=False)

    external by V0v1kkk  25  0  1  0

    C# Get hardware information whith WMI

    C# Get hardware information whith WMI: WMI.cs
    /// <summary>
    /// Use WMI for check percentage of CPU Usage
    /// Write to private field _cpuUsage
    /// </summary>
    private void CheckCpuUsage()
            var searcher =
                new ManagementObjectSearcher("select * from Win32_PerfFormattedData_PerfOS_Processor");
            var cpuTimes = searcher.Get()
                .Select(mo => new
                    Name = mo["Name"],
                    Usage = mo["PercentProcessorTime"]
            _cpuUsage = (ulong) cpuTimes[0].Usage; //atomic assignment
        catch (Exception exception)
            _subscriberOnMessages($"Error on checking cpu usage: {exception.Message}");
            _subscriberOnMessages($"Total errors on checking cpu usage: {CheckCpuUsageErrors}");
    /// <summary>
    /// Use WMI for check RAM usage (int %)
    /// Write to private field _memoryUsage
    /// </summary>
    private void CheckMemoryUsage()
            ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem");
            var hddUsage = searcher.Get().Cast<ManagementObject>().Select(m=>new
                TotalVisibleMemorySize = m["TotalVisibleMemorySize"],
                FreeMemory = m["FreePhysicalMemory"]
            if(hddUsage == null) throw new Exception("Can't recive informacion about memory usage.");
            var freeRam = (ulong) hddUsage.FreeMemory;
            var totalRam = (ulong) hddUsage.TotalVisibleMemorySize;
            _memoryUsage = (totalRam - freeRam)/(float)totalRam * 100;
        catch (Exception exception)
            _subscriberOnMessages($"Error on checking RAM usage: {exception.Message}");
            _subscriberOnMessages($"Total errors on checking RAM usage: {CheckMemoryUsageErrors}");
    /// <summary>
    /// Use WMI for check HddUsage (PercentDiskTime)
    /// Write to private field _hddUsage
    /// </summary>
    /// <param name="diskLetter">Disk name in format: "D:\\"</param>
    private void CheckHddUsage(string diskLetter)
        diskLetter = diskLetter.Replace("\\", "");
            var searcher =
                new ManagementObjectSearcher("select * from Win32_PerfFormattedData_PerfDisk_PhysicalDisk");
            var hddUsage = searcher.Get()
                .Select(mo => new
                    Usage = mo["PercentDiskTime"],
                    Name = mo["Name"]
            for (var i = 0; i < hddUsage.Length; i++)
                if (!hddUsage[i].Name.ToString().Contains(diskLetter)) continue;
                _hddUsage = (ulong) hddUsage[i].Usage; //atomic assignment
        catch (Exception exception)
            _subscriberOnMessages($"Error on checking hdd usage: {exception.Message}");
            _subscriberOnMessages($"Total errors on checking hdd usage: {CheckHddUsageErrors}");
    /// <summary>
    /// Use WMI for check amount of free memory
    /// </summary>
    /// <returns>Amount of free memory in bytes</returns>
    private ulong GetFreeMomory()
            ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem");
            return searcher.Get().Cast<ManagementObject>().Select(m => (ulong)m["FreePhysicalMemory"]).FirstOrDefault() * 1024;
        catch (Exception exception)
            _subscriberOnMessages($"Error on checking free RAM: {exception.Message}");
            return 0;
    /// <summary>
    /// Use WMI for check type of disk
    /// </summary>
    /// <returns>One of DiskTypeEnum: Hdd or Ssd</returns>
    private DiskTypeEnum GetDriveType(string diskName)
            char driveLetter = diskName[0];
            if(driveLetter < 'A' || driveLetter > 'Z') throw new Exception("Failed to recognize drive character.");
            using (var partitionSearcher = new ManagementObjectSearcher(
            @"\\localhost\ROOT\Microsoft\Windows\Storage", "SELECT * FROM MSFT_Partition"))
                var partitions = partitionSearcher.Get().Cast<ManagementBaseObject>();
                ManagementBaseObject partition = partitions.FirstOrDefault(managementBaseObject => (char) managementBaseObject["DriveLetter"] == driveLetter);
                if(partition == null) throw new Exception("Filed to recognize disk partition containing file.");
                using (var physicalDiskSearcher = new ManagementObjectSearcher(
                            @"\\localhost\ROOT\Microsoft\Windows\Storage", "SELECT * FROM MSFT_PhysicalDisk"))
                    var physicalDisk = physicalDiskSearcher.Get().Cast<ManagementBaseObject>().FirstOrDefault(m=> ((string)m["DeviceID"]).Contains(((uint)partition["DiskNumber"]).ToString()));
                    if (physicalDisk == null) throw new Exception("Error on WMI request of disk type");
                    if (((ushort) physicalDisk["MediaType"] == 4) && ((uint) physicalDisk["SpindleSpeed"] == 0))
                        return DiskTypeEnum.Ssd;
                    return DiskTypeEnum.Hdd;
        catch (Exception exception)
            _subscriberOnMessages($"Error on getting disk type: {exception.Message}");
            return DiskTypeEnum.Hdd;
    • Public Snippets
    • Channels Snippets