Thursday, September 11, 2014

Dumping computer’s DMI (SMBIOS) in Linux

dmidecode

dmidecode -t

The SMBIOS specification defines the following DMI types:

       Type   Information
       --------------------------------------------
          0   BIOS
          1   System
          2   Baseboard
          3   Chassis
          4   Processor
          5   Memory Controller
          6   Memory Module
          7   Cache
          8   Port Connector
          9   System Slots
         10   On Board Devices
         11   OEM Strings
         12   System Configuration Options
         13   BIOS Language
         14   Group Associations
         15   System Event Log
         16   Physical Memory Array
         17   Memory Device
         18   32-bit Memory Error
         19   Memory Array Mapped Address
         20   Memory Device Mapped Address
         21   Built-in Pointing Device
         22   Portable Battery
         23   System Reset
         24   Hardware Security
         25   System Power Controls
         26   Voltage Probe
         27   Cooling Device
         28   Temperature Probe
         29   Electrical Current Probe
         30   Out-of-band Remote Access
         31   Boot Integrity Services
         32   System Boot
         33   64-bit Memory Error
         34   Management Device
         35   Management Device Component
         36   Management Device Threshold Data
         37   Memory Channel
         38   IPMI Device
         39   Power Supply
         40   Additional Information
         41   Onboard Devices Extended Information
         42   Management Controller Host Interface

Additionally, type 126 is used for disabled entries and type 127 is an end-of-table marker. Types 128 to 255 are for OEM-specific data.

Keywords can be used instead of type numbers with --type.  Each keyword is equivalent to a list of type numbers:

       Keyword     Types
       ------------------------------
       bios        0, 13
       system      1, 12, 15, 23, 32
       baseboard   2, 10, 41
       chassis     3
       processor   4
       memory      5, 6, 16, 17
       cache       7
       connector   8
       slot        9

Wednesday, August 13, 2014

Excel Regular Expressions

Sub RegEx_Tester()
    Dim objRegExp_1 As Object
    Dim regExp_Matches As Object
    
    Dim strToSearch As String
    
    Set objRegExp_1 = CreateObject("vbscript.regexp")
    objRegExp_1.Global = True
    objRegExp_1.IgnoreCase = True
    objRegExp_1.Pattern = "[a-z,A-Z]*@[a-z,A-Z]*.com"
    
    strToSearch = "ABC@xyz.com"
    
    Set regExp_Matches = objRegExp_1.Execute(strToSearch)
    
    If regExp_Matches.Count = 1 Then
        MsgBox ("This string is a valid email address.")
    End If
    
End Sub

Thursday, July 10, 2014

flock - Manage locks from shell scripts

Only one running instance of a script:

flock -n /var/lock/lock_file.lock script.sh


Thursday, May 29, 2014

SYMPATHY

I know what the caged bird feels, alas!
When the sun is bright on the upland slopes;
When the wind stirs soft through the springing grass,
And the river flows like a stream of glass;
When the first bird sings and the first bud opes,
And the faint perfume from its chalice steals—
I know what the caged bird feels!
I know why the caged bird beats his wing
Till its blood is red on the cruel bars;
For he must fly back to his perch and cling
When he fain would be on the bough a-swing;
And a pain still throbs in the old, old scars
And they pulse again with a keener sting—
I know why he beats his wing!
I know why the caged bird sings, ah me,
When his wing is bruised and his bosom sore,—
When he beats his bars and he would be free;
It is not a carol of joy or glee,
But a prayer that he sends from his heart's deep core,
But a plea, that upward to Heaven he flings—
I know why the caged bird sings!

Paul Laurence Dunbar

http://www.gutenberg.org/files/18338/18338-h/18338-h.htm#Page_102

Wednesday, April 30, 2014

systemd-analyze - Analyze system boot-up performance

systemd-analyze may be used to determine system boot-up performance of the current boot.

systemd-analyze blame prints a list of all running units, ordered by the time they took to initialize.

SysVinit to Systemd Cheatsheet

http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet